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

@@ -189,6 +189,8 @@ public:
virtual bool SetFont( const wxFont &font ) wxOVERRIDE;
virtual bool SetCursor( const wxCursor &cursor ) wxOVERRIDE;
virtual void ExtendRulesAndAlternateColour(bool extend = true) wxOVERRIDE;
#if wxUSE_DRAG_AND_DROP
virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE;
virtual wxDropTarget *GetDropTarget() const wxOVERRIDE;
@@ -208,8 +210,6 @@ public:
wxListHeaderWindow *m_headerWin;
wxListMainWindow *m_mainWin;
void SetListRulesAlternateColourOnBlank(bool state, const wxColour& colour);
protected:
// Implement base class pure virtual methods.
long DoInsertColumn(long col, const wxListItem& info) wxOVERRIDE;