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:
@@ -740,6 +740,12 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void ExtendRulesAndAlternateColour(bool extend)
|
||||
{
|
||||
m_extendRulesAndAlternateColour = extend;
|
||||
}
|
||||
|
||||
|
||||
// these are for wxListLineData usage only
|
||||
|
||||
// get the backpointer to the list ctrl
|
||||
@@ -779,13 +785,6 @@ public:
|
||||
const wxRect& rect,
|
||||
int lineNumber );
|
||||
|
||||
void SetListRulesAlternateColourOnBlank( const bool state,
|
||||
const wxColour& colour)
|
||||
{
|
||||
m_listRulesAlternateColourOnBlank = state;
|
||||
m_alternateColourOnBlank = colour;
|
||||
}
|
||||
|
||||
protected:
|
||||
// the array of all line objects for a non virtual list control (for the
|
||||
// virtual list control we only ever use m_lines[0])
|
||||
@@ -947,18 +946,14 @@ private:
|
||||
// NULL if no item is being edited
|
||||
wxListTextCtrlWrapper *m_textctrlWrapper;
|
||||
|
||||
// tells whether or not to paint empty rows with alternate colour and draw
|
||||
// rulers on empty rows
|
||||
bool m_extendRulesAndAlternateColour;
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
|
||||
friend class wxGenericListCtrl;
|
||||
friend class wxListCtrlMaxWidthCalculator;
|
||||
|
||||
// tells whether or not to paint empty rows with alternate colour and draw
|
||||
// rulers on empty rows
|
||||
bool m_listRulesAlternateColourOnBlank;
|
||||
|
||||
// colour to paint empty rows (zebra effect)
|
||||
wxColour m_alternateColourOnBlank;
|
||||
};
|
||||
|
||||
#endif // wxUSE_LISTCTRL
|
||||
|
Reference in New Issue
Block a user