From 853dcc57c6e5ba58e9e546c65ca4965256f3ac21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 27 Sep 2005 16:54:43 +0000 Subject: [PATCH] wxItemContainerImmutable::FindString unified. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/choice.h | 6 +- include/wx/cocoa/combobox.h | 4 +- include/wx/cocoa/listbox.h | 6 +- include/wx/ctrlsub.h | 18 ++++- include/wx/gtk/choice.h | 8 +-- include/wx/gtk/combobox.h | 4 +- include/wx/gtk/listbox.h | 6 +- include/wx/gtk/radiobox.h | 2 +- include/wx/gtk1/choice.h | 8 +-- include/wx/gtk1/combobox.h | 4 +- include/wx/gtk1/listbox.h | 6 +- include/wx/gtk1/radiobox.h | 2 +- include/wx/mac/carbon/choice.h | 114 +++++++++++++++--------------- include/wx/mac/carbon/combobox.h | 4 +- include/wx/mac/carbon/listbox.h | 4 +- include/wx/mac/classic/choice.h | 111 ++++++++++++++--------------- include/wx/mac/classic/combobox.h | 4 +- include/wx/mac/classic/listbox.h | 8 +-- include/wx/motif/checklst.h | 12 ++-- include/wx/motif/choice.h | 20 +++--- include/wx/motif/combobox.h | 4 +- include/wx/motif/listbox.h | 22 +++--- include/wx/motif/radiobox.h | 4 +- include/wx/msw/choice.h | 4 +- include/wx/msw/listbox.h | 2 +- include/wx/msw/wince/choicece.h | 2 +- include/wx/os2/choice.h | 3 +- include/wx/os2/listbox.h | 7 +- include/wx/os2/radiobox.h | 11 ++- include/wx/palmos/choice.h | 1 - include/wx/palmos/listbox.h | 1 - include/wx/radiobox.h | 4 -- include/wx/univ/combobox.h | 2 +- include/wx/univ/listbox.h | 4 +- 34 files changed, 211 insertions(+), 211 deletions(-) diff --git a/include/wx/cocoa/choice.h b/include/wx/cocoa/choice.h index 55df3d4234..c4f8a5dcb7 100644 --- a/include/wx/cocoa/choice.h +++ b/include/wx/cocoa/choice.h @@ -4,9 +4,9 @@ // Author: David Elliott // Modified by: // Created: 2003/03/16 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __WX_COCOA_CHOICE_H__ @@ -85,7 +85,7 @@ public: virtual int GetCount() const; virtual wxString GetString(int) const; virtual void SetString(int, const wxString&); - virtual int FindString(const wxString&) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual int GetSelection() const; virtual int DoAppend(const wxString&); virtual int DoInsert(const wxString&, int); diff --git a/include/wx/cocoa/combobox.h b/include/wx/cocoa/combobox.h index d0e7cb6b1a..e7d8e342c6 100644 --- a/include/wx/cocoa/combobox.h +++ b/include/wx/cocoa/combobox.h @@ -26,7 +26,7 @@ class wxCocoaNSComboBox public: void AssociateNSComboBox(WX_NSComboBox cocoaNSComboBox); void DisassociateNSComboBox(WX_NSComboBox cocoaNSComboBox); - + virtual void doWxEvent(int nEvent) = 0; }; @@ -110,7 +110,7 @@ public: virtual int GetCount() const; virtual wxString GetString(int) const; virtual void SetString(int, const wxString&); - virtual int FindString(const wxString&) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual int GetSelection() const; virtual int DoAppend(const wxString&); virtual int DoInsert(const wxString&, int); diff --git a/include/wx/cocoa/listbox.h b/include/wx/cocoa/listbox.h index 6ada4abc57..9d5f21d6f3 100644 --- a/include/wx/cocoa/listbox.h +++ b/include/wx/cocoa/listbox.h @@ -4,9 +4,9 @@ // Author: David Elliott // Modified by: // Created: 2003/03/16 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __WX_COCOA_LISTBOX_H__ @@ -98,7 +98,7 @@ public: virtual int GetCount() const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; // selection virtual int GetSelection() const; protected: diff --git a/include/wx/ctrlsub.h b/include/wx/ctrlsub.h index 3f60c85585..ff5f02fe57 100644 --- a/include/wx/ctrlsub.h +++ b/include/wx/ctrlsub.h @@ -44,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 @@ -208,4 +223,3 @@ inline int wxItemContainer::Number() const #endif // wxUSE_CONTROLS #endif // _WX_CTRLSUB_H_BASE_ - diff --git a/include/wx/gtk/choice.h b/include/wx/gtk/choice.h index 78ff53846c..5b0526a275 100644 --- a/include/wx/gtk/choice.h +++ b/include/wx/gtk/choice.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: choice.h +// Name: wx/gtk/choice.h // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -70,7 +70,7 @@ public: void SetSelection( int n ); virtual int GetCount() const; - int FindString( const wxString& string ) const; + virtual int FindString(const wxString& s, bool bCase = false) const; wxString GetString( int n ) const; void SetString( int n, const wxString& string ); @@ -102,8 +102,8 @@ private: wxSortedArrayString *m_strings; public: - // this circumvents a GTK+ 2.0 bug so that the selection is - // invalidated properly + // this circumvents a GTK+ 2.0 bug so that the selection is + // invalidated properly int m_selection_hack; private: diff --git a/include/wx/gtk/combobox.h b/include/wx/gtk/combobox.h index be213a3a23..5f33b99a53 100644 --- a/include/wx/gtk/combobox.h +++ b/include/wx/gtk/combobox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: combobox.h +// Name: wx/gtk/combobox.h // Purpose: // Author: Robert Roebling // Created: 01/02/97 @@ -83,7 +83,7 @@ public: void Clear(); void Delete( int n ); - virtual int FindString( const wxString &item ) const; + virtual int FindString(const wxString& s, bool bCase = false) const; int GetSelection() const; int GetCurrentSelection() const; wxString GetString( int n ) const; diff --git a/include/wx/gtk/listbox.h b/include/wx/gtk/listbox.h index 152c385551..be7a4e444d 100644 --- a/include/wx/gtk/listbox.h +++ b/include/wx/gtk/listbox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: listbox.h +// Name: wx/gtk/listbox.h // Purpose: wxListBox class declaration // Author: Robert Roebling // Id: $Id$ @@ -73,7 +73,7 @@ public: virtual int GetCount() const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual bool IsSelected(int n) const; virtual void DoSetSelection(int n, bool select); @@ -93,7 +93,7 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - + // implementation from now on void GtkAddItem( const wxString &item, int pos=-1 ); diff --git a/include/wx/gtk/radiobox.h b/include/wx/gtk/radiobox.h index 217ac65f3d..c945aab081 100644 --- a/include/wx/gtk/radiobox.h +++ b/include/wx/gtk/radiobox.h @@ -75,7 +75,7 @@ public: const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); - int FindString( const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; void SetSelection( int n ); int GetSelection() const; diff --git a/include/wx/gtk1/choice.h b/include/wx/gtk1/choice.h index 78ff53846c..5b0526a275 100644 --- a/include/wx/gtk1/choice.h +++ b/include/wx/gtk1/choice.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: choice.h +// Name: wx/gtk/choice.h // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -70,7 +70,7 @@ public: void SetSelection( int n ); virtual int GetCount() const; - int FindString( const wxString& string ) const; + virtual int FindString(const wxString& s, bool bCase = false) const; wxString GetString( int n ) const; void SetString( int n, const wxString& string ); @@ -102,8 +102,8 @@ private: wxSortedArrayString *m_strings; public: - // this circumvents a GTK+ 2.0 bug so that the selection is - // invalidated properly + // this circumvents a GTK+ 2.0 bug so that the selection is + // invalidated properly int m_selection_hack; private: diff --git a/include/wx/gtk1/combobox.h b/include/wx/gtk1/combobox.h index be213a3a23..5f33b99a53 100644 --- a/include/wx/gtk1/combobox.h +++ b/include/wx/gtk1/combobox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: combobox.h +// Name: wx/gtk/combobox.h // Purpose: // Author: Robert Roebling // Created: 01/02/97 @@ -83,7 +83,7 @@ public: void Clear(); void Delete( int n ); - virtual int FindString( const wxString &item ) const; + virtual int FindString(const wxString& s, bool bCase = false) const; int GetSelection() const; int GetCurrentSelection() const; wxString GetString( int n ) const; diff --git a/include/wx/gtk1/listbox.h b/include/wx/gtk1/listbox.h index 152c385551..be7a4e444d 100644 --- a/include/wx/gtk1/listbox.h +++ b/include/wx/gtk1/listbox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: listbox.h +// Name: wx/gtk/listbox.h // Purpose: wxListBox class declaration // Author: Robert Roebling // Id: $Id$ @@ -73,7 +73,7 @@ public: virtual int GetCount() const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual bool IsSelected(int n) const; virtual void DoSetSelection(int n, bool select); @@ -93,7 +93,7 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - + // implementation from now on void GtkAddItem( const wxString &item, int pos=-1 ); diff --git a/include/wx/gtk1/radiobox.h b/include/wx/gtk1/radiobox.h index 217ac65f3d..c945aab081 100644 --- a/include/wx/gtk1/radiobox.h +++ b/include/wx/gtk1/radiobox.h @@ -75,7 +75,7 @@ public: const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); - int FindString( const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; void SetSelection( int n ); int GetSelection() const; diff --git a/include/wx/mac/carbon/choice.h b/include/wx/mac/carbon/choice.h index 190b663a11..901702ed00 100644 --- a/include/wx/mac/carbon/choice.h +++ b/include/wx/mac/carbon/choice.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: choice.h +// Name: wx/mac/carbon/choice.h // Purpose: wxChoice class // Author: Stefan Csomor // Modified by: @@ -30,60 +30,60 @@ public: wxChoice() : m_strings(), m_datas(), m_macPopUpMenuHandle(NULL) {} - + virtual ~wxChoice() ; - wxChoice(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr) - { - Create(parent, id, pos, size, n, choices, style, validator, name); - } - wxChoice(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr) - { - Create(parent, id, pos, size, choices, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr); - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr); - - // implement base class pure virtuals - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, int pos); - virtual void Delete(int n); - virtual void Clear(); - - virtual int GetCount() const ; - virtual int GetSelection() const ; - virtual void SetSelection(int n); - int GetCurrentSelection() const { return GetSelection(); } - - virtual int FindString(const wxString& s) const; - virtual wxString GetString(int n) const ; - virtual void SetString( int , const wxString& s ) ; - virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ; + wxChoice(wxWindow *parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + int n = 0, const wxString choices[] = NULL, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxChoiceNameStr) + { + Create(parent, id, pos, size, n, choices, style, validator, name); + } + wxChoice(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxChoiceNameStr) + { + Create(parent, id, pos, size, choices, style, validator, name); + } + + bool Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + int n = 0, const wxString choices[] = NULL, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxChoiceNameStr); + bool Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxChoiceNameStr); + + // implement base class pure virtuals + virtual int DoAppend(const wxString& item); + virtual int DoInsert(const wxString& item, int pos); + virtual void Delete(int n); + virtual void Clear(); + + virtual int GetCount() const ; + virtual int GetSelection() const ; + virtual void SetSelection(int n); + int GetCurrentSelection() const { return GetSelection(); } + + virtual int FindString(const wxString& s, bool bCase = false) const; + virtual wxString GetString(int n) const ; + virtual void SetString( int , const wxString& s ) ; + virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ; protected: virtual wxSize DoGetBestSize() const ; @@ -96,12 +96,12 @@ public: // for wxComboBox only protected: // free all memory we have (used by Clear() and dtor) - // prevent collision with some BSD definitions of macro Free() + // prevent collision with some BSD definitions of macro Free() void FreeData(); - wxArrayString m_strings; - wxChoiceDataArray m_datas ; - WXHMENU m_macPopUpMenuHandle ; + wxArrayString m_strings; + wxChoiceDataArray m_datas ; + WXHMENU m_macPopUpMenuHandle ; }; #endif diff --git a/include/wx/mac/carbon/combobox.h b/include/wx/mac/carbon/combobox.h index a3dcc09d3f..4e2520991c 100644 --- a/include/wx/mac/carbon/combobox.h +++ b/include/wx/mac/carbon/combobox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: combobox.h +// Name: wx/mac/carbon/combobox.h // Purpose: wxComboBox class // Author: Stefan Csomor // Modified by: @@ -89,7 +89,7 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase virtual int GetSelection() const ; int GetCurrentSelection() const { return GetSelection(); } virtual void SetSelection(int n); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual wxString GetString(int n) const ; virtual wxString GetStringSelection() const ; virtual void SetString(int n, const wxString& s) ; diff --git a/include/wx/mac/carbon/listbox.h b/include/wx/mac/carbon/listbox.h index 03659936d9..184fcaf2d9 100644 --- a/include/wx/mac/carbon/listbox.h +++ b/include/wx/mac/carbon/listbox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: listbox.h +// Name: wx/mac/carbon/listbox.h // Purpose: wxListBox class // Author: Stefan Csomor // Modified by: @@ -80,7 +80,7 @@ public: virtual int GetCount() const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual bool IsSelected(int n) const; virtual void DoSetSelection(int n, bool select); diff --git a/include/wx/mac/classic/choice.h b/include/wx/mac/classic/choice.h index a491b32fcf..c5c0dde2f5 100644 --- a/include/wx/mac/classic/choice.h +++ b/include/wx/mac/classic/choice.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: choice.h +// Name: wx/mac/classic/choice.h // Purpose: wxChoice class // Author: Stefan Csomor // Modified by: @@ -30,59 +30,58 @@ public: wxChoice() : m_strings(), m_datas(), m_macPopUpMenuHandle(NULL) {} - + virtual ~wxChoice() ; - wxChoice(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr) - { - Create(parent, id, pos, size, n, choices, style, validator, name); - } - wxChoice(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr) - { - Create(parent, id, pos, size, choices, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr); - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxChoiceNameStr); - - // implement base class pure virtuals - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, int pos); - virtual void Delete(int n); - virtual void Clear(); - - virtual int GetCount() const ; - virtual int GetSelection() const ; - virtual void SetSelection(int n); - - virtual int FindString(const wxString& s) const; - virtual wxString GetString(int n) const ; - virtual void SetString( int , const wxString& s ) ; - void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; + wxChoice(wxWindow *parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + int n = 0, const wxString choices[] = NULL, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxChoiceNameStr) + { + Create(parent, id, pos, size, n, choices, style, validator, name); + } + wxChoice(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxChoiceNameStr) + { + Create(parent, id, pos, size, choices, style, validator, name); + } + + bool Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + int n = 0, const wxString choices[] = NULL, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxChoiceNameStr); + bool Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxChoiceNameStr); + + // implement base class pure virtuals + virtual int DoAppend(const wxString& item); + virtual int DoInsert(const wxString& item, int pos); + virtual void Delete(int n); + virtual void Clear(); + + virtual int GetCount() const ; + virtual int GetSelection() const ; + virtual void SetSelection(int n); + + virtual wxString GetString(int n) const ; + virtual void SetString( int , const wxString& s ) ; + void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; protected: virtual wxSize DoGetBestSize() const ; @@ -95,12 +94,12 @@ public: // for wxComboBox only protected: // free all memory we have (used by Clear() and dtor) - // prevent collision with some BSD definitions of macro Free() + // prevent collision with some BSD definitions of macro Free() void FreeData(); - wxArrayString m_strings; - wxChoiceDataArray m_datas ; - WXHMENU m_macPopUpMenuHandle ; + wxArrayString m_strings; + wxChoiceDataArray m_datas ; + WXHMENU m_macPopUpMenuHandle ; }; #endif diff --git a/include/wx/mac/classic/combobox.h b/include/wx/mac/classic/combobox.h index a46d2b49dc..d207bbdb94 100644 --- a/include/wx/mac/classic/combobox.h +++ b/include/wx/mac/classic/combobox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: combobox.h +// Name: wx/mac/classic/combobox.h // Purpose: wxComboBox class // Author: Stefan Csomor // Modified by: @@ -83,7 +83,7 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase virtual int GetSelection() const ; virtual void SetSelection(int n); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual wxString GetString(int n) const ; virtual wxString GetStringSelection() const ; virtual void SetString(int n, const wxString& s) ; diff --git a/include/wx/mac/classic/listbox.h b/include/wx/mac/classic/listbox.h index 381d54a2c0..67a7e895eb 100644 --- a/include/wx/mac/classic/listbox.h +++ b/include/wx/mac/classic/listbox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: listbox.h +// Name: wx/mac/classic/listbox.h // Purpose: wxListBox class // Author: Stefan Csomor // Modified by: @@ -82,7 +82,7 @@ public: virtual ~wxListBox(); virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL); - + // implement base class pure virtuals virtual void Clear(); virtual void Delete(int n); @@ -90,7 +90,7 @@ public: virtual int GetCount() const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual bool IsSelected(int n) const; virtual void DoSetSelection(int n, bool select); @@ -153,7 +153,7 @@ protected: bool HasMultipleSelection() const; // free memory (common part of Clear() and dtor) - // prevent collision with some BSD definitions of macro Free() + // prevent collision with some BSD definitions of macro Free() void FreeData(); int m_noItems; diff --git a/include/wx/motif/checklst.h b/include/wx/motif/checklst.h index 37e6b6aa41..3577dcc551 100644 --- a/include/wx/motif/checklst.h +++ b/include/wx/motif/checklst.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: checklst.h +// Name: wx/motif/checklst.h // Purpose: wxCheckListBox class - a listbox with checkable items // Note: this is an optional class. // Author: Julian Smart @@ -18,14 +18,14 @@ class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase { DECLARE_DYNAMIC_CLASS(wxCheckListBox) - + public: // ctors wxCheckListBox(); wxCheckListBox(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int nStrings = 0, + int nStrings = 0, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, @@ -46,7 +46,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); - + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, @@ -54,14 +54,14 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); - + // items may be checked bool IsChecked(size_t uiIndex) const; void Check(size_t uiIndex, bool bCheck = true); // override base class functions virtual int DoAppend(const wxString& item); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual void SetString(int n, const wxString& s); virtual wxString GetString(int n) const; diff --git a/include/wx/motif/choice.h b/include/wx/motif/choice.h index ddf7cec308..a6f2c71382 100644 --- a/include/wx/motif/choice.h +++ b/include/wx/motif/choice.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: choice.h +// Name: wx/motif/choice.h // Purpose: wxChoice class // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CHOICE_H_ @@ -29,7 +29,7 @@ class WXDLLEXPORT wxChoice: public wxChoiceBase public: wxChoice(); ~wxChoice(); - + wxChoice(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -41,7 +41,7 @@ public: Init(); Create(parent, id, pos, size, n, choices, style, validator, name); } - + wxChoice(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, @@ -80,7 +80,7 @@ public: virtual wxClientData* DoGetItemClientObject(int n) const; virtual int GetSelection() const; virtual void Delete(int n); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual void Clear(); virtual void SetString(int n, const wxString& s); virtual wxString GetString(int n) const; @@ -89,12 +89,12 @@ public: virtual void SetSelection(int n); virtual void SetColumns(int n = 1 ); virtual int GetColumns() const ; - - // Original API + + // Original API virtual void Command(wxCommandEvent& event); - + void SetFocus(); - + // Implementation virtual void ChangeFont(bool keepOriginalSize = true); virtual void ChangeBackgroundColour(); @@ -120,7 +120,7 @@ protected: WXWidget m_formWidget; wxStringList m_stringList; wxClientDataDictionary m_clientDataDict; - + virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); diff --git a/include/wx/motif/combobox.h b/include/wx/motif/combobox.h index 3397f4f33d..eb5cc9cc34 100644 --- a/include/wx/motif/combobox.h +++ b/include/wx/motif/combobox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: combobox.h +// Name: wx/motif/combobox.h // Purpose: wxComboBox class // Author: Julian Smart // Modified by: @@ -76,7 +76,7 @@ public: virtual void Clear(); virtual int GetSelection() const ; virtual void SetSelection(int n); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual wxString GetString(int n) const ; virtual void SetString(int n, const wxString& s); diff --git a/include/wx/motif/listbox.h b/include/wx/motif/listbox.h index e8626bc398..5604e1c1c4 100644 --- a/include/wx/motif/listbox.h +++ b/include/wx/motif/listbox.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: listbox.h +// Name: wx/motif/listbox.h // Purpose: wxListBox class // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_LISTBOX_H_ @@ -22,7 +22,7 @@ class WXDLLEXPORT wxArrayInt; class WXDLLEXPORT wxListBox: public wxListBoxBase { DECLARE_DYNAMIC_CLASS(wxListBox) - + public: wxListBox(); wxListBox(wxWindow *parent, wxWindowID id, @@ -35,7 +35,7 @@ public: { Create(parent, id, pos, size, n, choices, style, validator, name); } - + wxListBox(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, @@ -46,7 +46,7 @@ public: { Create(parent, id, pos, size, choices, style, validator, name); } - + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -54,7 +54,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); - + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, @@ -62,9 +62,9 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); - + ~wxListBox(); - + // implementation of wxControlWithItems virtual int GetCount() const; virtual int DoAppend(const wxString& item); @@ -74,7 +74,7 @@ public: virtual wxClientData* DoGetItemClientObject(int n) const; virtual int GetSelection() const; virtual void Delete(int n); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual void Clear(); virtual void SetString(int n, const wxString& s); virtual wxString GetString(int n) const; @@ -89,7 +89,7 @@ public: // For single or multiple choice list item void Command(wxCommandEvent& event); - + // Implementation virtual void ChangeBackgroundColour(); virtual void ChangeForegroundColour(); @@ -102,7 +102,7 @@ protected: virtual wxSize DoGetBestSize() const; int m_noItems; - + // List mapping positions->client data wxClientDataDictionary m_clientDataDict; private: diff --git a/include/wx/motif/radiobox.h b/include/wx/motif/radiobox.h index 4a7c71c3cf..4f5b2fce4e 100644 --- a/include/wx/motif/radiobox.h +++ b/include/wx/motif/radiobox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.h +// Name: wx/motif/radiobox.h // Purpose: wxRadioBox class // Author: Julian Smart // Modified by: @@ -72,7 +72,6 @@ public: const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); - int FindString(const wxString& s) const; void SetSelection(int N); int GetSelection() const; @@ -123,4 +122,3 @@ private: }; #endif // _WX_MOTIF_RADIOBOX_H_ - diff --git a/include/wx/msw/choice.h b/include/wx/msw/choice.h index f9d2058492..d3b6689687 100644 --- a/include/wx/msw/choice.h +++ b/include/wx/msw/choice.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: choice.h +// Name: wx/msw/choice.h // Purpose: wxChoice class // Author: Julian Smart // Modified by: Vadim Zeitlin to derive from wxChoiceBase @@ -77,7 +77,7 @@ public: virtual int GetCurrentSelection() const; virtual void SetSelection(int n); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); diff --git a/include/wx/msw/listbox.h b/include/wx/msw/listbox.h index 3e1079e8a1..25a35186ba 100644 --- a/include/wx/msw/listbox.h +++ b/include/wx/msw/listbox.h @@ -84,7 +84,7 @@ public: virtual int GetCount() const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual bool IsSelected(int n) const; virtual void DoSetSelection(int n, bool select); diff --git a/include/wx/msw/wince/choicece.h b/include/wx/msw/wince/choicece.h index bee1802432..e7f6781e60 100644 --- a/include/wx/msw/wince/choicece.h +++ b/include/wx/msw/wince/choicece.h @@ -87,7 +87,7 @@ public: virtual int GetSelection() const; virtual void SetSelection(int n); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); diff --git a/include/wx/os2/choice.h b/include/wx/os2/choice.h index 9293bdab9f..5700c35de4 100644 --- a/include/wx/os2/choice.h +++ b/include/wx/os2/choice.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: choice.h +// Name: wx/os2/choice.h // Purpose: wxChoice class // Author: David Webster // Modified by: @@ -98,7 +98,6 @@ public: virtual int GetSelection(void) const ; virtual void SetSelection(int n); - virtual int FindString(const wxString& rsStr) const; virtual wxString GetString(int n) const ; virtual void SetString( int n ,const wxString& rsStr diff --git a/include/wx/os2/listbox.h b/include/wx/os2/listbox.h index 0a09107a16..9632105689 100644 --- a/include/wx/os2/listbox.h +++ b/include/wx/os2/listbox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: listbox.h +// Name: wx/os2/listbox.h // Purpose: wxListBox class // Author: David Webster // Modified by: @@ -108,10 +108,7 @@ public: virtual int GetCount(void) const; virtual wxString GetString(int n) const; - virtual void SetString( int n - ,const wxString& rsString - ); - virtual int FindString(const wxString& rsString) const; + virtual void SetString(int n, const wxString& rsString); virtual bool IsSelected(int n) const; virtual void DoSetSelection( int n diff --git a/include/wx/os2/radiobox.h b/include/wx/os2/radiobox.h index 955dc12e42..ebf2e10444 100644 --- a/include/wx/os2/radiobox.h +++ b/include/wx/os2/radiobox.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.h +// Name: wx/os2/radiobox.h // Purpose: wxRadioBox class // Author: David Webster // Modified by: @@ -99,11 +99,10 @@ public: ,const wxString& rsName = wxRadioBoxNameStr ); - void Command(wxCommandEvent& rEvent); - bool ContainsHWND(WXHWND hWnd) const; - virtual bool Enable(bool bEnable = true); - virtual bool Enable(int nItem, bool bEnable = true); - int FindString(const wxString& sStr) const; + void Command(wxCommandEvent& rEvent); + bool ContainsHWND(WXHWND hWnd) const; + virtual bool Enable(bool bEnable = true); + virtual bool Enable(int nItem, bool bEnable = true); virtual WXHBRUSH OnCtlColor( WXHDC hDC ,WXHWND hWnd diff --git a/include/wx/palmos/choice.h b/include/wx/palmos/choice.h index 81062d7b19..ed1a42aca1 100644 --- a/include/wx/palmos/choice.h +++ b/include/wx/palmos/choice.h @@ -73,7 +73,6 @@ public: virtual int GetSelection() const; virtual void SetSelection(int n); - virtual int FindString(const wxString& s) const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); diff --git a/include/wx/palmos/listbox.h b/include/wx/palmos/listbox.h index c56dc25dab..fcf443706d 100644 --- a/include/wx/palmos/listbox.h +++ b/include/wx/palmos/listbox.h @@ -84,7 +84,6 @@ public: virtual int GetCount() const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const; virtual bool IsSelected(int n) const; virtual void DoSetSelection(int n, bool select); diff --git a/include/wx/radiobox.h b/include/wx/radiobox.h index c611759c36..646d796457 100644 --- a/include/wx/radiobox.h +++ b/include/wx/radiobox.h @@ -38,10 +38,6 @@ public: // return the item above/below/to the left/right of the given one int GetNextItem(int item, wxDirection dir, long style) const; - - // implement some of wxItemContainerImmutable functions - virtual int FindString(const wxString& s) const; - // deprecated functions // -------------------- diff --git a/include/wx/univ/combobox.h b/include/wx/univ/combobox.h index 4d3a70b503..3e4eff22db 100644 --- a/include/wx/univ/combobox.h +++ b/include/wx/univ/combobox.h @@ -296,7 +296,7 @@ public: virtual int GetCount() const; virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const; + virtual int FindString(const wxString& s, bool bCase = false) const; virtual void SetSelection(int n); virtual int GetSelection() const; diff --git a/include/wx/univ/listbox.h b/include/wx/univ/listbox.h index 1f764791d0..d837a94b04 100644 --- a/include/wx/univ/listbox.h +++ b/include/wx/univ/listbox.h @@ -103,8 +103,8 @@ public: virtual wxString GetString(int n) const { return m_strings->Item(n); } virtual void SetString(int n, const wxString& s); - virtual int FindString(const wxString& s) const - { return m_strings->Index(s); } + virtual int FindString(const wxString& s, bool bCase = false) const + { return m_strings->Index(s, bCase); } virtual bool IsSelected(int n) const { return m_selections.Index(n) != wxNOT_FOUND; } -- 2.45.2