X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f644b28c1154d638270d0d1abbc41f760be6abbd..5b12cceef870243338e39d4b15536008491de474:/include/wx/listbox.h diff --git a/include/wx/listbox.h b/include/wx/listbox.h index 0f083697c7..e4931b0b5e 100644 --- a/include/wx/listbox.h +++ b/include/wx/listbox.h @@ -34,7 +34,7 @@ class WXDLLIMPEXP_BASE wxArrayString; // global data // ---------------------------------------------------------------------------- -WXDLLEXPORT_DATA(extern const wxChar*) wxListBoxNameStr; +extern WXDLLEXPORT_DATA(const wxChar*) wxListBoxNameStr; // ---------------------------------------------------------------------------- // wxListBox interface is defined by the class wxListBoxBase @@ -47,7 +47,7 @@ public: virtual ~wxListBoxBase(); // all generic methods are in wxControlWithItems, except for the following - // ones which are not yet implemented by wxChoice/wxCombobox + // ones which are not yet implemented by wxChoice/wxComboBox void Insert(const wxString& item, int pos) { DoInsert(item, pos); } void Insert(const wxString& item, int pos, void *clientData) @@ -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) };