+ wxItemContainerImmutable() { }
+ virtual ~wxItemContainerImmutable();
+
+ // accessing strings
+ // -----------------
+
+ virtual unsigned int GetCount() const = 0;
+ bool IsEmpty() const { return GetCount() == 0; }
+
+ virtual wxString GetString(unsigned int n) const = 0;
+ wxArrayString GetStrings() const;
+ virtual void SetString(unsigned int n, const wxString& s) = 0;
+
+ // finding string natively is either case sensitive or insensitive
+ // but never both so fall back to this base version for not
+ // supported search type
+ virtual int FindString(const wxString& s, bool bCase = false) const
+ {
+ unsigned int count = GetCount();
+
+ for ( unsigned int i = 0; i < count ; ++i )
+ {
+ if (GetString(i).IsSameAs( s , bCase ))
+ return (int)i;
+ }
+
+ return wxNOT_FOUND;
+ }
+
+
+ // selection
+ // ---------
+
+ virtual void SetSelection(int n) = 0;
+ virtual int GetSelection() const = 0;
+
+ // set selection to the specified string, return false if not found
+ bool SetStringSelection(const wxString& s);
+
+ // return the selected string or empty string if none
+ wxString GetStringSelection() const;
+
+ // this is the same as SetSelection( for single-selection controls but
+ // reads better for multi-selection ones
+ void Select(int n) { SetSelection(n); }
+
+
+protected:
+
+ // check that the index is valid
+ inline bool IsValid(unsigned int n) const { return n < GetCount(); }
+ inline bool IsValidInsert(unsigned int n) const { return n <= GetCount(); }
+};
+
+class WXDLLEXPORT wxItemContainer : public wxItemContainerImmutable
+{
+public:
+ wxItemContainer() { m_clientDataItemsType = wxClientData_None; }