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
@@ -24,10 +24,7 @@
|
||||
performance nor from user interface point of view, for large number of
|
||||
items.
|
||||
|
||||
Notice that currently @c TAB characters in list box items text are not
|
||||
handled consistently under all platforms, so they should be replaced by
|
||||
spaces to display strings properly everywhere. The list box doesn't
|
||||
support any other control characters at all.
|
||||
Notice that the list box doesn't support control characters other than @c TAB.
|
||||
|
||||
@beginStyleTable
|
||||
@style{wxLB_SINGLE}
|
||||
@@ -321,6 +318,28 @@ public:
|
||||
*/
|
||||
int GetTopItem() const;
|
||||
|
||||
/**
|
||||
MSW-specific function for setting custom tab stop distances.
|
||||
|
||||
Tab stops are expressed in dialog unit widths, i.e. "quarters of the
|
||||
average character width for the font that is selected into the list
|
||||
box".
|
||||
|
||||
@param tabStops
|
||||
If this argument is empty, tab stops are reset to their default
|
||||
value (every 32 dialog units). If it contains a single element, tab
|
||||
stops are set at each multiple of the given value. Otherwise tab
|
||||
stops are set at every element of the array, which must be in
|
||||
ascending order.
|
||||
|
||||
@return @true if all specified tabs are set, @false otherwise
|
||||
|
||||
@onlyfor{wxmsw}
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
virtual void MSWSetTabStops(const wxVector<int>& tabStops);
|
||||
|
||||
// NOTE: Phoenix needs to see the implementation of pure virtuals so it
|
||||
// knows that this class is not abstract.
|
||||
virtual unsigned int GetCount() const;
|
||||
@@ -328,4 +347,3 @@ public:
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user