Improve support for TABs in wxListBox under MSW
Always set the LB_USETABSTOPS style flag to achieve behaviour more compatible with other platforms and expand TABs to align them at tab stops positioned at every 8 characters. Also add MSW-specific MSWSetTabStops() method allowing to customize tab stops. Update the documentation and the sample to demonstrate using TABs. Closes https://github.com/wxWidgets/wxWidgets/pull/1789
This commit is contained in:
committed by
Vadim Zeitlin
parent
ebe7816516
commit
d1553c63ed
@@ -187,6 +187,9 @@ WXDWORD wxListBox::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
}
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
|
||||
// tabs stops are expanded by default on linux/GTK and macOS/Cocoa
|
||||
msStyle |= LBS_USETABSTOPS;
|
||||
|
||||
return msStyle;
|
||||
}
|
||||
|
||||
@@ -611,6 +614,12 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
|
||||
//else: it shouldn't change
|
||||
}
|
||||
|
||||
bool wxListBox::MSWSetTabStops(const wxVector<int>& tabStops)
|
||||
{
|
||||
return SendMessage(GetHwnd(), LB_SETTABSTOPS, (WPARAM)tabStops.size(),
|
||||
tabStops.size() ? (LPARAM)tabStops.begin() : NULL);
|
||||
}
|
||||
|
||||
wxSize wxListBox::DoGetBestClientSize() const
|
||||
{
|
||||
// find the widest string
|
||||
|
Reference in New Issue
Block a user