- // ctor
- wxChoiceBase() { m_clientDataItemsType = ClientData_None; }
-
- // add a new item to the list
- // no client data
- void Append(const wxString& item) { DoAppend(item); }
- // with client data which belongs to the caller
- void Append(const wxString &item, void* clientData)
- { int n = DoAppend(item); SetClientData(n, clientData); }
- // with client data which will be deleted by the control
- void Append(const wxString &item, wxClientData* clientData)
- { int n = DoAppend(item); SetClientObject(n, clientData); }
-
- // delete items from the list
- // one item
- virtual void Delete(int n) = 0;
- // all of them
- virtual void Clear() = 0;
-
- // selection (at most one item may be selected in wxChoice)
- // get the index of currently selected item or -1
- virtual int GetSelection() const = 0;
- // get the text of the currently selected item or empty string
- virtual wxString GetStringSelection() const;
-
- // set selectionto current item
- virtual void SetSelection(int n) = 0;
- // set selection to the current item, returns TRUE if ok
- virtual bool SetStringSelection(const wxString& sel);
-
- // accessors to the list of strings
- // get the number of items in the list of strings
- virtual int GetCount() const = 0;
-
- // find string in the list, return wxNOT_FOUND if not found
- virtual int FindString(const wxString& s) const = 0;
- // get the string with the specified index
- virtual wxString GetString(int n) const = 0;
-
- // set/get the number of columns in the control (as they're not supporte on
+ wxChoiceBase() { }
+ virtual ~wxChoiceBase();
+
+ // all generic methods are in wxControlWithItems
+
+ // get the current selection: this can only be different from the normal
+ // selection if the popup items list is currently opened and the user
+ // selected some item in it but didn't close the list yet; otherwise (and
+ // currently always on platforms other than MSW) this is the same as
+ // GetSelection()
+ virtual int GetCurrentSelection() const { return GetSelection(); }
+
+ // set/get the number of columns in the control (as they're not supported on