Add wxListCtrl::EnableAlternateRowColours() and SetAlternateRowColour().

Add methods to simply enable alternative row background colours in wxListCtrl.

Closes #14618.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73239 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-12-22 02:33:23 +00:00
parent 87f0b1323b
commit 0ee169da2b
13 changed files with 106 additions and 55 deletions

View File

@@ -407,6 +407,27 @@ public:
wxTextCtrl* EditLabel(long item,
wxClassInfo* textControlClass = wxCLASSINFO(wxTextCtrl));
/**
Enable alternating row background colours (also called zebra striping).
This method can only be called for the control in virtual report mode,
i.e. having ::wxLC_REPORT and ::wxLC_VIRTUAL styles.
When enabling alternating colours, the appropriate colour for the even
rows is chosen automatically depending on the default foreground and
background colours which are used for the odd rows.
@param enable
If @true, enable alternating row background colours, i.e. different
colours for the odd and even rows. If @false, disable this feature
and use the same background colour for all rows.
@since 2.9.5
@see SetAlternateRowColour()
*/
void EnableAlternateRowColours(bool enable = true);
/**
Enable or disable a beep if there is no match for the currently
entered text when searching for the item from keyboard.
@@ -750,6 +771,26 @@ public:
*/
wxRect GetViewRect() const;
/**
Set the alternative row background colour to a specific colour.
It is recommended to call EnableAlternateRowColours() instead of using
these methods as native implementations of this control might support
alternating row colours but not setting the exact colour to be used for
them.
As EnableAlternateRowColours(), this method can only be used with
controls having ::wxLC_REPORT and ::wxLC_VIRTUAL styles.
@param colour
A valid alternative row background colour to enable alternating
rows or invalid colour to disable them and use the same colour for
all rows.
@since 2.9.5
*/
void SetAlternateRowColour(const wxColour& colour);
/**
Determines which item (if any) is at the specified point, giving details
in @a flags. Returns index of the item or @c wxNOT_FOUND if no item is at