Simplify API for extending wxListCtrl background display

Replace SetListRulesAlternateColourOnBlank() taking 2 arguments, with
the second of them being used only when the first one is true, with a
simpler but still sufficient ExtendRulesAndAlternateColour(bool).

Make the new method virtual and define it as doing nothing in
wxListCtrlBase class, so that it's still available, even if currently
not implemented, in wxMSW.

Also simplify the implementation, fix style problems and other minor
improvements.
This commit is contained in:
Vadim Zeitlin
2020-11-09 00:37:55 +01:00
parent 584d1ae47d
commit 5ae2a8ebb8
7 changed files with 80 additions and 96 deletions

View File

@@ -417,6 +417,8 @@ public:
void SetAlternateRowColour(const wxColour& colour);
wxColour GetAlternateRowColour() const { return m_alternateRowColour.GetBackgroundColour(); }
virtual void ExtendRulesAndAlternateColour(bool WXUNUSED(extend) = true) { }
// Header attributes support: only implemented in wxMSW currently.
virtual bool SetHeaderAttr(const wxItemAttr& WXUNUSED(attr)) { return false; }