1. added SetSelection() to wxItemContainer and removed its declarations
from derived classes 2. made wxItemContainer::Select() non virtual: it simply calls SetSelection() 3. renamed wxListBox::SetSelection(n, select) to DoSetSelection() for all ports and defined non virtual SetSelection() overloads in the base class to avoid virtual functions hiding git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -65,12 +65,16 @@ public:
|
||||
|
||||
// multiple selection logic
|
||||
virtual bool IsSelected(int n) const = 0;
|
||||
virtual void SetSelection(int n, bool select = true) = 0;
|
||||
virtual void Select(int n) { SetSelection(n, true); }
|
||||
void Deselect(int n) { SetSelection(n, false); }
|
||||
virtual void SetSelection(int n) { DoSetSelection(n, true); }
|
||||
void SetSelection(int n, bool select) { DoSetSelection(n, select); }
|
||||
void Deselect(int n) { DoSetSelection(n, false); }
|
||||
void DeselectAll(int itemToLeaveSelected = -1);
|
||||
|
||||
virtual bool SetStringSelection(const wxString& s, bool select = true);
|
||||
virtual bool SetStringSelection(const wxString& s, bool select);
|
||||
virtual bool SetStringSelection(const wxString& s)
|
||||
{
|
||||
return SetStringSelection(s, true);
|
||||
}
|
||||
|
||||
// works for single as well as multiple selection listboxes (unlike
|
||||
// GetSelection which only works for listboxes with single selection)
|
||||
@@ -119,6 +123,9 @@ protected:
|
||||
|
||||
virtual void DoSetFirstItem(int n) = 0;
|
||||
|
||||
virtual void DoSetSelection(int n, bool select) = 0;
|
||||
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxListBoxBase)
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user