X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ecf902bc836f2808444b34eff48cdb12f289460..2c01d33555e3125057f4575ca7d0d2aba93f421f:/include/wx/ctrlsub.h diff --git a/include/wx/ctrlsub.h b/include/wx/ctrlsub.h index d747a60d2b..ff5f02fe57 100644 --- a/include/wx/ctrlsub.h +++ b/include/wx/ctrlsub.h @@ -12,10 +12,6 @@ #ifndef _WX_CTRLSUB_H_BASE_ #define _WX_CTRLSUB_H_BASE_ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "controlwithitems.h" -#endif - #include "wx/defs.h" #if wxUSE_CONTROLS @@ -48,7 +44,22 @@ public: virtual wxString GetString(int n) const = 0; wxArrayString GetStrings() const; virtual void SetString(int n, const wxString& s) = 0; - virtual int FindString(const wxString& s) const = 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 + { + int count = GetCount(); + + for ( int i = 0; i < count ; i ++ ) + { + if (GetString(i).IsSameAs( s , bCase )) + return i; + } + + return wxNOT_FOUND; + } // selection @@ -212,4 +223,3 @@ inline int wxItemContainer::Number() const #endif // wxUSE_CONTROLS #endif // _WX_CTRLSUB_H_BASE_ -