]> git.saurik.com Git - wxWidgets.git/commitdiff
wxItemContainerImmutable::FindString unified.
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 27 Sep 2005 17:05:26 +0000 (17:05 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 27 Sep 2005 17:05:26 +0000 (17:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

34 files changed:
src/cocoa/choice.mm
src/cocoa/combobox.mm
src/cocoa/listbox.mm
src/common/radiocmn.cpp
src/gtk/choice.cpp
src/gtk/combobox.cpp
src/gtk/listbox.cpp
src/gtk/radiobox.cpp
src/gtk1/choice.cpp
src/gtk1/combobox.cpp
src/gtk1/listbox.cpp
src/gtk1/radiobox.cpp
src/mac/carbon/choice.cpp
src/mac/carbon/combobox.cpp
src/mac/carbon/combobxc.cpp
src/mac/carbon/listbox.cpp
src/mac/classic/choice.cpp
src/mac/classic/combobox.cpp
src/mac/classic/listbox.cpp
src/motif/checklst.cpp
src/motif/choice.cpp
src/motif/combobox.cpp
src/motif/combobox_native.cpp
src/motif/listbox.cpp
src/motif/radiobox.cpp
src/msw/choice.cpp
src/msw/listbox.cpp
src/msw/wince/choicece.cpp
src/os2/choice.cpp
src/os2/listbox.cpp
src/os2/radiobox.cpp
src/palmos/choice.cpp
src/palmos/listbox.cpp
src/univ/combobox.cpp

index e5c2431dc83d93895172f5b4cb85ffb3c31073fc..3c5d47916257615276a44dfc499624563c62b335 100644 (file)
@@ -1,12 +1,12 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        cocoa/choice.mm
+// Name:        src/cocoa/choice.mm
 // Purpose:     wxChoice
 // Author:      David Elliott
 // Modified by:
 // Created:     2003/03/16
-// RCS-ID:      $Id: 
+// Id:          $Id$
 // Copyright:   (c) 2003 David Elliott
-// Licence:    wxWidgets licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
@@ -173,8 +173,9 @@ void wxChoice::SetString(int n, const wxString& title)
     [item setTitle:wxNSStringWithWxString(title)];
 }
 
-int wxChoice::FindString(const wxString& title) const
+int wxChoice::FindString(const wxString& title, bool bCase) const
 {
+    // FIXME: use wxItemContainerImmutable::FindString for bCase parameter
     return [(NSPopUpButton*)m_cocoaNSView indexOfItemWithTitle:
         wxNSStringWithWxString(title)];
 }
@@ -186,7 +187,7 @@ int wxChoice::GetSelection() const
 
 int wxChoice::DoAppend(const wxString& title)
 {
-    wxAutoNSAutoreleasePool pool;    
+    wxAutoNSAutoreleasePool pool;
     NSMenu *nsmenu = [(NSPopUpButton*)m_cocoaNSView menu];
     NSMenuItem *item;
     if(m_sortedStrings)
index 46187fbd3494b32a28cd83c31c3712a79f5e8b35..0e19e3d340ff9752fb0fb29aaf07e1f4c3c71bb9 100644 (file)
@@ -1,20 +1,18 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        cocoa/combobox.mm
+// Name:        src/cocoa/combobox.mm
 // Purpose:     wxComboBox
-// Author:             Ryan Norton
+// Author:      Ryan Norton
 // Modified by:
 // Created:     2005/02/16
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 David Elliott
-// Licence:    wxWidgets licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
-// #include "wx/wxprec.h"
-
 //
 // Impl notes:
 // There is no custom data source because doing so unnecessarily sacrifices
-// some native autocompletion behavior (we would have to make our own - 
+// some native autocompletion behavior (we would have to make our own -
 // the SimpleComboBox sample does so in the developer folder that
 // comes with OSX).  One reason you might want this would be to have
 // only one array or be able to display numbers returned by an NSNumber
@@ -28,9 +26,9 @@
 // doWxEvent is really hackish... but since there's only one event...
 //
 // Ideas for future improvement - other notes:
-// Combox w/o wxCB_DROPDOWN doesn't seem to be implementable   
-//wxCB_READONLY        Same as wxCB_DROPDOWN but only the strings specified as the combobox choices can be selected, it is impossible to select (even from a program) a string which is not in the choices list.
-//wxCB_SORT    is possible with data source
+// Combox w/o wxCB_DROPDOWN doesn't seem to be implementable
+//wxCB_READONLY  Same as wxCB_DROPDOWN but only the strings specified as the combobox choices can be selected, it is impossible to select (even from a program) a string which is not in the choices list.
+//wxCB_SORT      is possible with data source
 //
 // setIntercellSpacing:/setItemHeight: to autoadjust to number of inserted items?
 //
@@ -55,7 +53,7 @@
     NSString *lowercasePrefix = [prefix lowercaseString];
     NSEnumerator *stringEnum = [genres objectEnumerator];
     while ((string = [stringEnum nextObject])) {
-       if ([[string lowercaseString] hasPrefix: lowercasePrefix]) return string;
+        if ([[string lowercaseString] hasPrefix: lowercasePrefix]) return string;
     }
     return nil;
 }
 }
 */
 
-/////////////////////////////////////////////////////////////////////////////
-// Name:        cocoa/NSComboBox.mm
-// Purpose:     wxCocoaNSComboBox
-// Author:      Ryan Norton
-// Modified by:
-// Created:     2005/02/16
-// RCS-ID:      $Id: 
-// Copyright:   (c) 2003 David Elliott
-// Licence:     wxWidgets licence
-/////////////////////////////////////////////////////////////////////////////
-
 // ============================================================================
 // declarations
 // ============================================================================
@@ -111,7 +98,7 @@ void wxCocoaNSComboBox::AssociateNSComboBox(WX_NSComboBox cocoaNSComboBox)
     if(cocoaNSComboBox)
     {
         sm_cocoaHash.insert(wxCocoaNSComboBoxHash::value_type(cocoaNSComboBox,this));
-        
+
         [[NSNotificationCenter defaultCenter] addObserver:(id)cocoaNSComboBox selector:@selector(comboBoxSelectionDidChange:) name:@"NSComboBoxSelectionDidChangeNotification" object:cocoaNSComboBox];
         [[NSNotificationCenter defaultCenter] addObserver:(id)cocoaNSComboBox selector:@selector(comboBoxSelectionDidChange:) name:@"NSComboBoxSelectionIsChangingNotification" object:cocoaNSComboBox];
         [[NSNotificationCenter defaultCenter] addObserver:(id)cocoaNSComboBox selector:@selector(comboBoxSelectionDidChange:) name:@"NSComboBoxWillDismissNotification" object:cocoaNSComboBox];
@@ -211,7 +198,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID winid,
     wxAutoNSAutoreleasePool pool;
     if(!CreateControl(parent,winid,pos,size,style,validator,name))
         return false;
-        
+
     m_cocoaNSView = NULL;
     SetNSComboBox([[wxPoserNSComboBox alloc] initWithFrame:MakeDefaultNSRect(size)]);
     [m_cocoaNSView release];
@@ -223,9 +210,9 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID winid,
 
     for(int i = 0; i < n; ++i)
         wxComboBox::DoAppend(choices[i]);
-        
+
     [GetNSComboBox() setCompletes:true]; //autocomplete :)
-    
+
     return true;
 }
 
@@ -279,22 +266,29 @@ int wxComboBox::GetCount() const
 }
 
 wxString wxComboBox::GetString(int nIndex) const
-{      return wxStringWithNSString([GetNSComboBox() itemObjectValueAtIndex:nIndex]);   }
+{
+    return wxStringWithNSString([GetNSComboBox() itemObjectValueAtIndex:nIndex]);
+}
 
 void wxComboBox::SetString(int nIndex, const wxString& szString)
-{      
+{
     wxAutoNSAutoreleasePool pool;
     //FIXME:  There appears to be no "set item data" method - maybe
     //an assignment would work?
     [GetNSComboBox() removeItemAtIndex:nIndex];
-    [GetNSComboBox() insertItemWithObjectValue:wxNSStringWithWxString(szString) atIndex:nIndex];    
+    [GetNSComboBox() insertItemWithObjectValue:wxNSStringWithWxString(szString) atIndex:nIndex];
 }
 
-int wxComboBox::FindString(const wxString& szItem) const
-{      return [GetNSComboBox() indexOfItemWithObjectValue:wxNSStringWithWxString(szItem)];     }
+int wxComboBox::FindString(const wxString& szItem, bool bCase) const
+{
+    // FIXME: use wxItemContainerImmutable::FindString for bCase parameter
+    return [GetNSComboBox() indexOfItemWithObjectValue:wxNSStringWithWxString(szItem)];
+}
 
 int wxComboBox::GetSelection() const
-{      return [GetNSComboBox() indexOfSelectedItem];   }
+{
+    return [GetNSComboBox() indexOfSelectedItem];
+}
 
 int wxComboBox::DoAppend(const wxString& szItem)
 {
index e17fc1cfc2e18f940ed3d09bd7b53fe5a114cfbf..01cba46d60c5f1b85b411915ac68e64d9236e34c 100644 (file)
@@ -4,9 +4,9 @@
 // Author:      David Elliott
 // Modified by:
 // Created:     2003/03/18
-// RCS-ID:      $Id: 
+// Id:          $Id$
 // Copyright:   (c) 2003 David Elliott
-// Licence:    wxWidgets licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
@@ -56,26 +56,26 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID winid,
             const wxString& name)
 {
 /*
-wxLB_SINGLE 
-Single-selection list. 
+wxLB_SINGLE
+Single-selection list.
 
-wxLB_MULTIPLE 
-Multiple-selection list: the user can toggle multiple items on and off. 
+wxLB_MULTIPLE
+Multiple-selection list: the user can toggle multiple items on and off.
 
-wxLB_EXTENDED 
-Extended-selection list: the user can select multiple items using the SHIFT key and the mouse or special key combinations. 
+wxLB_EXTENDED
+Extended-selection list: the user can select multiple items using the SHIFT key and the mouse or special key combinations.
 
-wxLB_HSCROLL 
-Create horizontal scrollbar if contents are too wide (Windows only). 
+wxLB_HSCROLL
+Create horizontal scrollbar if contents are too wide (Windows only).
 
-wxLB_ALWAYS_SB 
-Always show a vertical scrollbar. 
+wxLB_ALWAYS_SB
+Always show a vertical scrollbar.
 
-wxLB_NEEDED_SB 
-Only create a vertical scrollbar if needed. 
+wxLB_NEEDED_SB
+Only create a vertical scrollbar if needed.
 
-wxLB_SORT 
-The listbox contents are sorted in alphabetical order. 
+wxLB_SORT
+The listbox contents are sorted in alphabetical order.
 */
     wxAutoNSAutoreleasePool pool;
     if(!CreateControl(parent,winid,pos,size,style,validator,name))
@@ -113,9 +113,9 @@ The listbox contents are sorted in alphabetical order.
     // NSScrollView seems to be the only reasonable solution.
     CocoaCreateNSScrollView();
     SetInitialFrameRect(pos,size);
-    
+
     // Set up extended/multiple selection flags
-    if ((style & wxLB_EXTENDED) || (style & wxLB_MULTIPLE)) 
+    if ((style & wxLB_EXTENDED) || (style & wxLB_MULTIPLE))
         //diff is that mult requires shift down for multi selection
         [GetNSTableView() setAllowsMultipleSelection:true];
 
@@ -184,7 +184,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
 void wxListBox::DoSetItems(const wxArrayString& items, void **clientData)
 {
     wxAutoNSAutoreleasePool pool;
-    
+
     // Remove everything
     [m_cocoaItems removeAllObjects];
     m_itemClientData.Clear();
@@ -220,7 +220,7 @@ void wxListBox::Delete(int n)
 {
     [m_cocoaItems removeObjectAtIndex:n];
     m_itemClientData.RemoveAt(n);
-    [GetNSTableView() reloadData];    
+    [GetNSTableView() reloadData];
 }
 
     // accessing strings
@@ -239,11 +239,12 @@ void wxListBox::SetString(int n, const wxString& s)
     wxAutoNSAutoreleasePool pool;
     [m_cocoaItems removeObjectAtIndex:n];
     [m_cocoaItems insertObject: wxNSStringWithWxString(s) atIndex: n];
-    [GetNSTableView() reloadData];    
+    [GetNSTableView() reloadData];
 }
 
-int wxListBox::FindString(const wxString& s) const
+int wxListBox::FindString(const wxString& s, bool bCase) const
 {
+    // FIXME: use wxItemContainerImmutable::FindString for bCase parameter
     wxAutoNSAutoreleasePool pool;
     return [m_cocoaItems indexOfObject:wxNSStringWithWxString(s)];
 }
@@ -257,8 +258,8 @@ int wxListBox::GetSelection() const
 int wxListBox::DoAppend(const wxString& item)
 {
     wxAutoNSAutoreleasePool pool;
-    [m_cocoaItems addObject:wxNSStringWithWxString(item)];    
-    [GetNSTableView() reloadData];    
+    [m_cocoaItems addObject:wxNSStringWithWxString(item)];
+    [GetNSTableView() reloadData];
     m_itemClientData.Add(NULL);
     return [m_cocoaItems count];
 }
index 9f4572fa6ecf67d43dd86ee505c513049ac6a0ec..dbaae7076d91fb1d994a84276dc5a3efcdb5ee82 100644 (file)
 // implementation
 // ============================================================================
 
-int wxRadioBoxBase::FindString(const wxString& s) const
-{
-    int count = GetCount();
-    for ( int n = 0; n < count; n++ )
-    {
-        if ( GetString(n) == s )
-            return n;
-    }
-
-    return wxNOT_FOUND;
-}
-
 int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const
 {
     int count = GetCount(),
@@ -176,4 +164,3 @@ void wxRadioBoxBase::SetLabel(int n, const wxString& label)
 #endif // WXWIN_COMPATIBILITY_2_2
 
 #endif // wxUSE_RADIOBOX
-
index 234f5786dd90309a036b9d6da93acf0416e17bd3..f5a9bd503497de5185ad13a9592f221c3de897b7 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choice.cpp
+// Name:        src/gtk/choice.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -334,9 +334,9 @@ void wxChoice::Delete( int n )
     }
 }
 
-int wxChoice::FindString( const wxString &string ) const
+int wxChoice::FindString( const wxString &string, bool bCase ) const
 {
-    wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid choice") );
+    wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid choice") );
 
     // If you read this code once and you think you understand
     // it, then you are very wrong. Robert Roebling.
@@ -360,7 +360,7 @@ int wxChoice::FindString( const wxString &string ) const
 #else
          wxString tmp( label->label );
 #endif
-        if (string == tmp)
+        if (string.IsSameAs( tmp, bCase ))
             return count;
 
         child = child->next;
@@ -372,7 +372,7 @@ int wxChoice::FindString( const wxString &string ) const
 
 int wxChoice::GetSelection() const
 {
-    wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid choice") );
+    wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid choice") );
 
     return m_selection_hack;
 
index ee5fdba2a54b49886b5e7adc754bd3b7d4ff7081..3480b849047306342f16d50c08b2a0effd9ee911 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        combobox.cpp
+// Name:        src/gtk/combobox.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -527,7 +527,7 @@ void wxComboBox::SetString(int n, const wxString &text)
     InvalidateBestSize();
 }
 
-int wxComboBox::FindString( const wxString &item ) const
+int wxComboBox::FindString( const wxString &item, bool bCase ) const
 {
     wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid combobox") );
 
@@ -544,7 +544,7 @@ int wxComboBox::FindString( const wxString &item ) const
 #else
         wxString str( label->label );
 #endif
-        if (item == str)
+        if (item.IsSameAs( str , bCase ) )
             return count;
 
         count++;
index e5b773de6998925ea61a76e3f28579ce50147234..40fb0c0a0c71ad637a55b38d5f129cc26e0abd06 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        listbox.cpp
+// Name:        src/gtk/listbox.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -931,7 +931,7 @@ void wxListBox::SetString( int n, const wxString &string )
 
 wxString wxListBox::GetString( int n ) const
 {
-    wxCHECK_MSG( m_list != NULL, wxT(""), wxT("invalid listbox") );
+    wxCHECK_MSG( m_list != NULL, wxEmptyString, wxT("invalid listbox") );
 
     GList *child = g_list_nth( m_list->children, n );
     if (child)
@@ -941,7 +941,7 @@ wxString wxListBox::GetString( int n ) const
 
     wxFAIL_MSG(wxT("wrong listbox index"));
 
-    return wxT("");
+    return wxEmptyString;
 }
 
 int wxListBox::GetCount() const
@@ -952,15 +952,15 @@ int wxListBox::GetCount() const
     return g_list_length(children);
 }
 
-int wxListBox::FindString( const wxString &item ) const
+int wxListBox::FindString( const wxString &item, bool bCase ) const
 {
-    wxCHECK_MSG( m_list != NULL, -1, wxT("invalid listbox") );
+    wxCHECK_MSG( m_list != NULL, wxNOT_FOUND, wxT("invalid listbox") );
 
     GList *child = m_list->children;
     int count = 0;
     while (child)
     {
-        if ( GetRealLabel(child) == item )
+        if ( item.IsSameAs( GetRealLabel(child), bCase ) )
             return count;
 
         count++;
@@ -1262,4 +1262,3 @@ wxListBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
 }
 
 #endif // wxUSE_LISTBOX
-
index 87a5816ff346da2d4362879e73358c9ab11e8654..66adc7a20703548a1583586bc2a697ea6558455c 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        radiobox.cpp
+// Name:        src/gtk/radiobox.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -218,7 +218,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
         num_of_cols = num_per_major;
         num_of_rows = m_majorDim;
     }
-    
+
     GtkRadioButton *m_radio = (GtkRadioButton*) NULL;
 
     GtkWidget *table = gtk_table_new( num_of_rows, num_of_cols, FALSE );
@@ -226,7 +226,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
     gtk_table_set_row_spacings( GTK_TABLE(table), 1 );
     gtk_widget_show( table );
     gtk_container_add( GTK_CONTAINER(m_widget), table );
-    
+
     wxString label;
     GSList *radio_button_group = (GSList *) NULL;
     for (int i = 0; i < n; i++)
@@ -255,8 +255,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
             int right = (i%num_of_cols) + 1;
             int top = i/num_of_cols;
             int bottom = (i/num_of_cols)+1;
-            gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(m_radio), left, right, top, bottom, 
-                  GTK_FILL, GTK_FILL, 1, 1 ); 
+            gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(m_radio), left, right, top, bottom,
+                  GTK_FILL, GTK_FILL, 1, 1 );
         }
         else
         {
@@ -264,8 +264,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
             int right = (i/num_of_rows) + 1;
             int top = i%num_of_rows;
             int bottom = (i%num_of_rows)+1;
-            gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(m_radio), left, right, top, bottom, 
-                  GTK_FILL, GTK_FILL, 1, 1 ); 
+            gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(m_radio), left, right, top, bottom,
+                  GTK_FILL, GTK_FILL, 1, 1 );
         }
 
         ConnectWidget( GTK_WIDGET(m_radio) );
@@ -328,7 +328,7 @@ bool wxRadioBox::Show( bool show )
     return true;
 }
 
-int wxRadioBox::FindString( const wxString &find ) const
+int wxRadioBox::FindString( const wxString &find, bool bCase ) const
 {
     wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid radiobox") );
 
@@ -343,7 +343,7 @@ int wxRadioBox::FindString( const wxString &find ) const
 #else
         wxString str( label->label );
 #endif
-        if (find == str)
+        if (find.IsSameAs( str, bCase ))
             return count;
 
         count++;
@@ -678,4 +678,3 @@ void wxRadioBox::SetLabel( int item, const wxString& label )
 #endif // WXWIN_COMPATIBILITY_2_2
 
 #endif // wxUSE_RADIOBOX
-
index 234f5786dd90309a036b9d6da93acf0416e17bd3..f5a9bd503497de5185ad13a9592f221c3de897b7 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choice.cpp
+// Name:        src/gtk/choice.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -334,9 +334,9 @@ void wxChoice::Delete( int n )
     }
 }
 
-int wxChoice::FindString( const wxString &string ) const
+int wxChoice::FindString( const wxString &string, bool bCase ) const
 {
-    wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid choice") );
+    wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid choice") );
 
     // If you read this code once and you think you understand
     // it, then you are very wrong. Robert Roebling.
@@ -360,7 +360,7 @@ int wxChoice::FindString( const wxString &string ) const
 #else
          wxString tmp( label->label );
 #endif
-        if (string == tmp)
+        if (string.IsSameAs( tmp, bCase ))
             return count;
 
         child = child->next;
@@ -372,7 +372,7 @@ int wxChoice::FindString( const wxString &string ) const
 
 int wxChoice::GetSelection() const
 {
-    wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid choice") );
+    wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid choice") );
 
     return m_selection_hack;
 
index ee5fdba2a54b49886b5e7adc754bd3b7d4ff7081..3480b849047306342f16d50c08b2a0effd9ee911 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        combobox.cpp
+// Name:        src/gtk/combobox.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -527,7 +527,7 @@ void wxComboBox::SetString(int n, const wxString &text)
     InvalidateBestSize();
 }
 
-int wxComboBox::FindString( const wxString &item ) const
+int wxComboBox::FindString( const wxString &item, bool bCase ) const
 {
     wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid combobox") );
 
@@ -544,7 +544,7 @@ int wxComboBox::FindString( const wxString &item ) const
 #else
         wxString str( label->label );
 #endif
-        if (item == str)
+        if (item.IsSameAs( str , bCase ) )
             return count;
 
         count++;
index e5b773de6998925ea61a76e3f28579ce50147234..40fb0c0a0c71ad637a55b38d5f129cc26e0abd06 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        listbox.cpp
+// Name:        src/gtk/listbox.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -931,7 +931,7 @@ void wxListBox::SetString( int n, const wxString &string )
 
 wxString wxListBox::GetString( int n ) const
 {
-    wxCHECK_MSG( m_list != NULL, wxT(""), wxT("invalid listbox") );
+    wxCHECK_MSG( m_list != NULL, wxEmptyString, wxT("invalid listbox") );
 
     GList *child = g_list_nth( m_list->children, n );
     if (child)
@@ -941,7 +941,7 @@ wxString wxListBox::GetString( int n ) const
 
     wxFAIL_MSG(wxT("wrong listbox index"));
 
-    return wxT("");
+    return wxEmptyString;
 }
 
 int wxListBox::GetCount() const
@@ -952,15 +952,15 @@ int wxListBox::GetCount() const
     return g_list_length(children);
 }
 
-int wxListBox::FindString( const wxString &item ) const
+int wxListBox::FindString( const wxString &item, bool bCase ) const
 {
-    wxCHECK_MSG( m_list != NULL, -1, wxT("invalid listbox") );
+    wxCHECK_MSG( m_list != NULL, wxNOT_FOUND, wxT("invalid listbox") );
 
     GList *child = m_list->children;
     int count = 0;
     while (child)
     {
-        if ( GetRealLabel(child) == item )
+        if ( item.IsSameAs( GetRealLabel(child), bCase ) )
             return count;
 
         count++;
@@ -1262,4 +1262,3 @@ wxListBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
 }
 
 #endif // wxUSE_LISTBOX
-
index 87a5816ff346da2d4362879e73358c9ab11e8654..66adc7a20703548a1583586bc2a697ea6558455c 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        radiobox.cpp
+// Name:        src/gtk/radiobox.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -218,7 +218,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
         num_of_cols = num_per_major;
         num_of_rows = m_majorDim;
     }
-    
+
     GtkRadioButton *m_radio = (GtkRadioButton*) NULL;
 
     GtkWidget *table = gtk_table_new( num_of_rows, num_of_cols, FALSE );
@@ -226,7 +226,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
     gtk_table_set_row_spacings( GTK_TABLE(table), 1 );
     gtk_widget_show( table );
     gtk_container_add( GTK_CONTAINER(m_widget), table );
-    
+
     wxString label;
     GSList *radio_button_group = (GSList *) NULL;
     for (int i = 0; i < n; i++)
@@ -255,8 +255,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
             int right = (i%num_of_cols) + 1;
             int top = i/num_of_cols;
             int bottom = (i/num_of_cols)+1;
-            gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(m_radio), left, right, top, bottom, 
-                  GTK_FILL, GTK_FILL, 1, 1 ); 
+            gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(m_radio), left, right, top, bottom,
+                  GTK_FILL, GTK_FILL, 1, 1 );
         }
         else
         {
@@ -264,8 +264,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
             int right = (i/num_of_rows) + 1;
             int top = i%num_of_rows;
             int bottom = (i%num_of_rows)+1;
-            gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(m_radio), left, right, top, bottom, 
-                  GTK_FILL, GTK_FILL, 1, 1 ); 
+            gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(m_radio), left, right, top, bottom,
+                  GTK_FILL, GTK_FILL, 1, 1 );
         }
 
         ConnectWidget( GTK_WIDGET(m_radio) );
@@ -328,7 +328,7 @@ bool wxRadioBox::Show( bool show )
     return true;
 }
 
-int wxRadioBox::FindString( const wxString &find ) const
+int wxRadioBox::FindString( const wxString &find, bool bCase ) const
 {
     wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid radiobox") );
 
@@ -343,7 +343,7 @@ int wxRadioBox::FindString( const wxString &find ) const
 #else
         wxString str( label->label );
 #endif
-        if (find == str)
+        if (find.IsSameAs( str, bCase ))
             return count;
 
         count++;
@@ -678,4 +678,3 @@ void wxRadioBox::SetLabel( int item, const wxString& label )
 #endif // WXWIN_COMPATIBILITY_2_2
 
 #endif // wxUSE_RADIOBOX
-
index 9294e5c61911f6b7f5e32d7b4913b6947a11fba2..1e36605c7e8361eeb3db3ece5999417b541dfe5d 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choice.cpp
+// Name:        src/mac/carbon/choice.cpp
 // Purpose:     wxChoice
 // Author:      Stefan Csomor
 // Modified by:
@@ -80,7 +80,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
         m_strings = wxArrayString(1) ; // autosort
     }
 #endif
-    
+
     for ( int i = 0; i < n; i++ )
     {
         Append(choices[i]);
@@ -97,7 +97,7 @@ int wxChoice::DoAppend(const wxString& item)
 #if wxUSE_STL
     wxArrayString::iterator insertPoint;
     size_t index;
-    
+
     if (GetWindowStyle() & wxCB_SORT)
     {
         insertPoint = std::lower_bound( m_strings.begin(), m_strings.end(), item );
@@ -195,9 +195,9 @@ int wxChoice::GetCount() const
     return m_strings.GetCount() ;
 }
 
-int wxChoice::FindString(const wxString& s) const
+int wxChoice::FindString(const wxString& s, bool bCase ) const
 {
-    return m_strings.Index( s , true , false) ;
+    return m_strings.Index( s , bCase ) ;
 }
 
 void wxChoice::SetString(int n, const wxString& s)
@@ -209,7 +209,7 @@ void wxChoice::SetString(int n, const wxString& s)
 
 wxString wxChoice::GetString(int n) const
 {
-    wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), _T(""),
+    wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), wxEmptyString,
                     _T("wxChoice::GetString(): invalid index") );
 
     return m_strings[n] ;
index dd4234e85f536f0abbfdc42b7ff9e77d75b9ca32..d1cc089a881811b27b260209e891adbea9bc5d5e 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        combobox.cpp
+// Name:        src/mac/carbon/combobox.cpp
 // Purpose:     wxComboBox class
 // Author:      Stefan Csomor
 // Modified by:
@@ -85,7 +85,7 @@ protected:
         if (m_cb->GetEventHandler()->ProcessEvent(kevt))
             // If the event was handled and not skipped then we're done
             return;
-        
+
         if ( event.GetKeyCode() == WXK_RETURN )
         {
             wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_cb->GetId());
@@ -136,14 +136,14 @@ protected:
         if (! m_cb->GetEventHandler()->ProcessEvent(event))
             event.Skip();
     }
-    
+
     void OnText( wxCommandEvent& event )
     {
         event.SetEventObject(m_cb);
         event.SetId(m_cb->GetId());
         if (! m_cb->GetEventHandler()->ProcessEvent(event))
             event.Skip();
-    }        
+    }
 
 private:
     wxComboBox *m_cb;
@@ -381,7 +381,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
 
     SetBestSize(size);   // Needed because it is a wxControlWithItems
     SetStringSelection(value);
-    
+
     return true;
 }
 
@@ -568,9 +568,9 @@ void wxComboBox::SetSelection(int n)
     }
 }
 
-int wxComboBox::FindString(const wxString& s) const
+int wxComboBox::FindString(const wxString& s, bool bCase) const
 {
-    return m_choice->FindString( s );
+    return m_choice->FindString( s, bCase );
 }
 
 wxString wxComboBox::GetString(int n) const
index 32b80d290cf6579e48f15fb2a7aa1023cbd17cee..abb642fcdeab6b72b306f7d37bc5571a068600c5 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        combobox.cpp
+// Name:        src/mac/carbon/combobox.cpp
 // Purpose:     wxComboBox class
 // Author:      Stefan Csomor
 // Modified by:
@@ -677,17 +677,17 @@ void wxComboBox::SetSelection(int n)
 #endif
 }
 
-int wxComboBox::FindString(const wxString& s) const
+int wxComboBox::FindString(const wxString& s, bool bCase) const
 {
 #if USE_HICOMBOBOX
     for( int i = 0 ; i < GetCount() ; i++ )
     {
-        if ( GetString( i ).IsSameAs(s, false) )
+        if ( GetString( i ).IsSameAs(s, bCase) )
             return i ;
     }
     return wxNOT_FOUND ;
 #else
-    return m_choice->FindString( s );
+    return m_choice->FindString( s, bCase );
 #endif
 }
 
index fc3319d92cee6b4ab29ed4d4bc58422cc40d780b..c0084b4a6efc1c793715081a47676dcff4f7b82e 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        listbox.cpp
+// Name:        src/mac/carbon/listbox.cpp
 // Purpose:     wxListBox
 // Author:      Stefan Csomor
 // Modified by:
@@ -380,9 +380,8 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
     }
 }
 
-int wxListBox::FindString(const wxString& s) const
+int wxListBox::FindString(const wxString& s, bool bCase) const
 {
-
     if ( s.Right(1) == wxT("*") )
     {
         wxString search = s.Left( s.Length() - 1 ) ;
@@ -394,7 +393,7 @@ int wxListBox::FindString(const wxString& s) const
         {
             wxMacStringToPascal( m_stringArray[i].Left( len ) , s1 ) ;
 
-            if ( EqualString( s1 , s2 , false , false ) )
+            if ( EqualString( s1 , s2 , bCase , false ) )
                 return i ;
         }
         if ( s.Left(1) == wxT("*") && s.Length() > 1 )
@@ -419,11 +418,11 @@ int wxListBox::FindString(const wxString& s) const
         {
             wxMacStringToPascal( m_stringArray[i] , s1 ) ;
 
-            if ( EqualString( s1 , s2 , false , false ) )
+            if ( EqualString( s1 , s2 , bCase , false ) )
                 return i ;
         }
     }
-    return -1;
+    return wxNOT_FOUND;
 }
 
 void wxListBox::Clear()
@@ -872,4 +871,3 @@ void wxListBox::OnChar(wxKeyEvent& event)
 #endif // !TARGET_API_MAC_OSX
 
 #endif
-
index f3d6144b6799b4674a6b70e4978e60a570b0407d..c608874704e568b8a3ad04dcd48a9f16a88a4da2 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choice.cpp
+// Name:        src/mac/classic/choice.cpp
 // Purpose:     wxChoice
 // Author:      Stefan Csomor
 // Modified by:
@@ -171,16 +171,6 @@ int wxChoice::GetCount() const
     return m_strings.GetCount() ;
 }
 
-int wxChoice::FindString(const wxString& s) const
-{
-    for( int i = 0 ; i < GetCount() ; i++ )
-    {
-        if ( GetString( i ).IsSameAs(s, false) )
-            return i ;
-    }
-    return wxNOT_FOUND ;
-}
-
 void wxChoice::SetString(int n, const wxString& s)
 {
     wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented"));
@@ -192,7 +182,7 @@ void wxChoice::SetString(int n, const wxString& s)
 
 wxString wxChoice::GetString(int n) const
 {
-    wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), _T(""),
+    wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), wxEmptyString,
                     _T("wxChoice::GetString(): invalid index") );
 
     return m_strings[n] ;
index f523a0751e6453f3f573f14575536e740e51cb95..16612c1f81cd63c74dde5a22743214e81c189a3b 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        combobox.cpp
+// Name:        src/mac/classic/combobox.cpp
 // Purpose:     wxComboBox class
 // Author:      Stefan Csomor
 // Modified by:
@@ -486,9 +486,9 @@ void wxComboBox::SetSelection(int n)
     }
 }
 
-int wxComboBox::FindString(const wxString& s) const
+int wxComboBox::FindString(const wxString& s, bool bCase ) const
 {
-    return m_choice->FindString( s );
+    return m_choice->FindString( s , bCase );
 }
 
 wxString wxComboBox::GetString(int n) const
@@ -581,4 +581,3 @@ void wxComboBox::MacHandleControlClick( WXWidget WXUNUSED(control) , wxInt16 WXU
     event.SetString(GetStringSelection());
     ProcessCommand(event);
 }
-
index 0bd0781a511d2f02fa1880030052a3ff7fb197a2..125b84b6828eded13a6be9df3c7d3a692f9f0fff 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        listbox.cpp
+// Name:        src/mac/classic/listbox.cpp
 // Purpose:     wxListBox
 // Author:      Stefan Csomor
 // Modified by:
@@ -70,7 +70,7 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
     list = (wxListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) );
     if ( list == NULL )
         return ;
-    
+
     GrafPtr savePort;
     GrafPtr grafPtr;
     RgnHandle savedClipRegion;
@@ -79,29 +79,29 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
     SetPort((**listHandle).port);
     grafPtr = (**listHandle).port ;
     // typecast our refCon
-    
+
     //  Calculate the cell rect.
-    
+
     switch( message ) {
     case lInitMsg:
         break;
-        
+
     case lCloseMsg:
         break;
-        
+
     case lDrawMsg:
         {
             const wxString linetext = list->m_stringArray[cell.v] ;
-            
+
             //  Save the current clip region, and set the clip region to the area we are about
             //  to draw.
-            
+
             savedClipRegion = NewRgn();
             GetClip( savedClipRegion );
-            
+
             ClipRect( drawRect );
             EraseRect( drawRect );
-            
+
             const wxFont& font = list->GetFont();
             if ( font.Ok() )
             {
@@ -115,50 +115,50 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
                 ::TextSize( 9  );
                 ::TextFace( 0 ) ;
             }
-            
+
 #if TARGET_CARBON
-                       {
-                               Rect frame = { drawRect->top, drawRect->left + 4,
-                                   drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ;
-                               CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext , list->GetFont().GetEncoding()) ) ;
-                               ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ;
-                               ::DrawThemeTextBox( mString,
-                                   kThemeCurrentPortFont,
-                                   kThemeStateActive,
-                                   false,
-                                   &frame,
-                                   teJustLeft,
-                                   nil );
-                               CFRelease( mString ) ;
-                       }
+            {
+                Rect frame = { drawRect->top, drawRect->left + 4,
+                               drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ;
+                CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext , list->GetFont().GetEncoding()) ) ;
+                ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ;
+                ::DrawThemeTextBox( mString,
+                                    kThemeCurrentPortFont,
+                                    kThemeStateActive,
+                                    false,
+                                    &frame,
+                                    teJustLeft,
+                                    nil );
+                                    CFRelease( mString ) ;
+            }
 #else
-            {  
-               wxCharBuffer text = linetext.mb_str( wxConvLocal) ;
+            {
+                wxCharBuffer text = linetext.mb_str( wxConvLocal) ;
                 MoveTo(drawRect->left + 4 , drawRect->top + 10 );
                 DrawText(text, 0 , strlen(text) );
             }
-#endif            
+#endif
             //  If the cell is hilited, do the hilite now. Paint the cell contents with the
             //  appropriate QuickDraw transform mode.
-            
+
             if( isSelected ) {
                 savedPenMode = GetPortPenMode( (CGrafPtr) grafPtr );
                 SetPortPenMode( (CGrafPtr)grafPtr, hilitetransfermode );
                 PaintRect( drawRect );
                 SetPortPenMode( (CGrafPtr)grafPtr, savedPenMode );
             }
-            
+
             //  Restore the saved clip region.
-            
+
             SetClip( savedClipRegion );
             DisposeRgn( savedClipRegion );
         }
         break;
     case lHiliteMsg:
-        
+
         //  Hilite or unhilite the cell. Paint the cell contents with the
         //  appropriate QuickDraw transform mode.
-        
+
         GetPort( &grafPtr );
         savedPenMode = GetPortPenMode( (CGrafPtr)grafPtr );
         SetPortPenMode( (CGrafPtr)grafPtr, hilitetransfermode );
@@ -220,9 +220,9 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
 
     Rect bounds ;
     Str255 title ;
-    
+
     MacPreControlCreate( parent , id ,  wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
-    
+
     ListDefSpec listDef;
     listDef.defType = kListDefUserProcType;
     if ( macListDefUPP == NULL )
@@ -230,7 +230,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
         macListDefUPP = NewListDefUPP( wxMacListDefinition );
     }
     listDef.u.userProc = macListDefUPP ;
-    
+
     Str255 fontName ;
     SInt16 fontSize ;
     Style fontStyle ;
@@ -240,7 +240,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
     GetFontName( kFontIDMonaco , fontName ) ;
     fontSize = 9 ;
     fontStyle = normal ;
-#endif 
+#endif
     SetFont( wxFont (fontSize, wxSWISS, wxNORMAL, wxNORMAL , false , wxMacMakeStringFromPascal( fontName ) ) ) ;
 #if TARGET_CARBON
     Size asize;
@@ -260,7 +260,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
     long    result ;
     wxStAppResource resload ;
     m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
-                  (style & wxLB_HSCROLL) ? kwxMacListWithVerticalAndHorizontalScrollbar : kwxMacListWithVerticalScrollbar , 
+                  (style & wxLB_HSCROLL) ? kwxMacListWithVerticalAndHorizontalScrollbar : kwxMacListWithVerticalScrollbar ,
                   0 , 0, kControlListBoxProc , (long) this ) ;
     ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
                sizeof( ListHandle ) , (char*) &m_macList  , &result ) ;
@@ -412,7 +412,7 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
     MacSetRedraw( false ) ;
     Clear() ;
     int n = choices.GetCount();
-    
+
     for( int i = 0 ; i < n ; ++i )
     {
         if ( clientData )
@@ -427,7 +427,7 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
         else
             Append( choices[i] ) ;
     }
-    
+
 #if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW ) {
         // first delete old items
@@ -437,7 +437,7 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
             m_aItems[ui] = NULL;
         }
         m_aItems.Empty();
-        
+
         // then create new ones
         for ( ui = 0; ui < (size_t)m_noItems; ui++ ) {
             wxOwnerDrawn *pNewItem = CreateItem(ui);
@@ -454,21 +454,20 @@ bool wxListBox::HasMultipleSelection() const
     return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED);
 }
 
-int wxListBox::FindString(const wxString& s) const
+int wxListBox::FindString(const wxString& s, bool bCase) const
 {
-    
     if ( s.Right(1) == wxT("*") )
     {
         wxString search = s.Left( s.Length() - 1 ) ;
         int len = search.Length() ;
         Str255 s1 , s2 ;
         wxMacStringToPascal( search , s2 ) ;
-        
+
         for ( int i = 0 ; i < m_noItems ; ++ i )
         {
-               wxMacStringToPascal( m_stringArray[i].Left( len ) , s1 ) ;
+            wxMacStringToPascal( m_stringArray[i].Left( len ) , s1 ) ;
 
-            if ( EqualString( s1 , s2 , false , false ) )
+            if ( EqualString( s1 , s2 , bCase , false ) )
                 return i ;
         }
         if ( s.Left(1) == wxT("*") && s.Length() > 1 )
@@ -481,23 +480,24 @@ int wxListBox::FindString(const wxString& s) const
                     return i ;
             }
         }
-        
+
     }
     else
     {
         Str255 s1 , s2 ;
-        
+
         wxMacStringToPascal( s , s2 ) ;
-        
+
         for ( int i = 0 ; i < m_noItems ; ++ i )
         {
-               wxMacStringToPascal( m_stringArray[i] , s1 ) ;
+            wxMacStringToPascal( m_stringArray[i] , s1 ) ;
 
-            if ( EqualString( s1 , s2 , false , false ) )
+            if ( EqualString( s1 , s2 , bCase , false ) )
                 return i ;
         }
     }
-    return -1;
+
+    return wxNOT_FOUND;
 }
 
 void wxListBox::Clear()
@@ -521,7 +521,7 @@ bool wxListBox::IsSelected(int N) const
 {
     wxCHECK_MSG( N >= 0 && N < m_noItems, FALSE,
         wxT("invalid index in wxListBox::Selected") );
-    
+
     return MacIsSelected( N ) ;
 }
 
@@ -529,7 +529,7 @@ void *wxListBox::DoGetItemClientData(int N) const
 {
     wxCHECK_MSG( N >= 0 && N < m_noItems, NULL,
         wxT("invalid index in wxListBox::GetClientData"));
-    
+
     return (void *)m_dataArray[N];
 }
 
@@ -542,7 +542,7 @@ void wxListBox::DoSetItemClientData(int N, void *Client_data)
 {
     wxCHECK_RET( N >= 0 && N < m_noItems,
         wxT("invalid index in wxListBox::SetClientData") );
-    
+
 #if wxUSE_OWNER_DRAWN
     if ( m_windowStyle & wxLB_OWNERDRAW )
     {
@@ -552,7 +552,7 @@ void wxListBox::DoSetItemClientData(int N, void *Client_data)
     }
 #endif // wxUSE_OWNER_DRAWN
     wxASSERT_MSG( m_dataArray.GetCount() >= (size_t) N , wxT("invalid client_data array") ) ;
-    
+
     if ( m_dataArray.GetCount() > (size_t) N )
     {
         m_dataArray[N] = (char*) Client_data ;
@@ -583,25 +583,25 @@ int wxListBox::GetSelection() const
 // Find string for position
 wxString wxListBox::GetString(int N) const
 {
-       return m_stringArray[N]  ;
+    return m_stringArray[N]  ;
 }
 
 void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
 {
     wxCHECK_RET( pos >= 0 && pos <= m_noItems,
         wxT("invalid index in wxListBox::InsertItems") );
-    
+
     InvalidateBestSize();
 
     int nItems = items.GetCount();
-    
+
     for ( int i = 0 ; i < nItems ; i++ )
     {
         m_stringArray.Insert( items[i] , pos + i ) ;
         m_dataArray.Insert( NULL , pos + i ) ;
         MacInsert( pos + i , items[i] ) ;
     }
-    
+
     m_noItems += nItems;
 }
 
@@ -616,10 +616,10 @@ wxSize wxListBox::DoGetBestSize() const
     int lbWidth = 100;  // some defaults
     int lbHeight = 110;
     int wLine;
-    
+
     {
-        wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; 
-        
+        wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ;
+
         if ( m_font.Ok() )
         {
             ::TextFont( m_font.GetMacFontNum() ) ;
@@ -632,7 +632,7 @@ wxSize wxListBox::DoGetBestSize() const
             ::TextSize( 9  );
             ::TextFace( 0 ) ;
         }
-        
+
         // Find the widest line
         for(int i = 0; i < GetCount(); i++) {
             wxString str(GetString(i));
@@ -651,15 +651,15 @@ wxSize wxListBox::DoGetBestSize() const
         #endif
             lbWidth = wxMax(lbWidth, wLine);
         }
-        
+
         // Add room for the scrollbar
         lbWidth += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X);
-        
+
         // And just a bit more
         int cy = 12 ;
         int cx = ::TextWidth( "X" , 0 , 1 ) ;
         lbWidth += cx ;
-        
+
         // don't make the listbox too tall (limit height to around 10 items) but don't
         // make it too small neither
         lbHeight = (cy+4) * wxMin(wxMax(GetCount(), 3), 10);
@@ -689,7 +689,7 @@ void wxListBox::Refresh(bool eraseBack, const wxRect *rect)
 class wxListBoxItem : public wxOwnerDrawn
 {
 public:
-    wxListBoxItem(const wxString& str = "");
+    wxListBoxItem(const wxString& str = wxEmptyString);
 };
 
 wxListBoxItem::wxListBoxItem(const wxString& str) : wxOwnerDrawn(str, FALSE)
@@ -722,7 +722,7 @@ list = (wxListBox*)refCon;
   ::TextSize( 9  );
   ::TextFace( 0 ) ;
   DrawText(text, 0 , text.Length());
-  
+
     }
 */
 void wxListBox::MacDelete( int N )
@@ -765,7 +765,7 @@ void wxListBox::MacSetSelection( int n , bool select )
             LSetSelect( false , cell , (ListHandle)m_macList ) ;
         }
     }
-    
+
     cell.v = n ;
     LSetSelect( select , cell , (ListHandle)m_macList ) ;
     LAutoScroll( (ListHandle)m_macList ) ;
@@ -796,12 +796,12 @@ int wxListBox::MacGetSelection() const
 int wxListBox::MacGetSelections( wxArrayInt& aSelections ) const
 {
     int no_sel = 0 ;
-    
+
     aSelections.Empty();
-    
+
     Cell cell = { 0 , 0 } ;
     cell.v = 0 ;
-    
+
     while ( LGetSelect( true , &cell ,(ListHandle) m_macList ) )
     {
         aSelections.Add( cell.v ) ;
@@ -829,7 +829,7 @@ void wxListBox::MacScrollTo( int n )
 void wxListBox::OnSize( wxSizeEvent &event)
 {
     Point pt;
-    
+
 #if TARGET_CARBON
     GetListCellSize((ListHandle)m_macList, &pt);
 #else
@@ -843,7 +843,7 @@ void wxListBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart ,
 {
     Boolean wasDoubleClick = false ;
     long    result ;
-    
+
     ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxDoubleClickTag , sizeof( wasDoubleClick ) , (char*) &wasDoubleClick  , &result ) ;
     if ( !wasDoubleClick )
     {
@@ -858,7 +858,6 @@ void wxListBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart ,
 void wxListBox::MacSetRedraw( bool doDraw )
 {
     LSetDrawingMode( doDraw , (ListHandle)m_macList ) ;
-    
 }
 
 void wxListBox::MacDoClick()
@@ -866,7 +865,7 @@ void wxListBox::MacDoClick()
     wxArrayInt aSelections;
     int n ;
     size_t count = GetSelections(aSelections);
-    
+
     if ( count == m_selectionPreImage.GetCount() )
     {
         bool hasChanged = false ;
@@ -883,12 +882,12 @@ void wxListBox::MacDoClick()
             return ;
         }
     }
-    
+
     m_selectionPreImage = aSelections;
-    
+
     wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId);
     event.SetEventObject( this );
-    
+
     if ( count > 0 )
     {
         n = aSelections[0];
@@ -902,9 +901,9 @@ void wxListBox::MacDoClick()
     {
         n = -1;
     }
-    
+
     event.SetInt(n);
-    
+
     GetEventHandler()->ProcessEvent(event);
 }
 
@@ -922,7 +921,7 @@ void wxListBox::OnChar(wxKeyEvent& event)
         wxWindow* parent = GetParent() ;
         while( parent  && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL )
             parent = parent->GetParent() ;
-        
+
         if ( parent && parent->GetDefaultItem() )
         {
             wxButton *def = wxDynamicCast(parent->GetDefaultItem(),
@@ -940,14 +939,14 @@ void wxListBox::OnChar(wxKeyEvent& event)
     /* generate wxID_CANCEL if command-. or <esc> has been pressed (typically in dialogs) */
     else if (event.GetKeyCode() == WXK_ESCAPE || (event.GetKeyCode() == '.' && event.MetaDown() ) )
     {
-       // FIXME: look in ancestors, not just parent.
+        // FIXME: look in ancestors, not just parent.
         wxWindow* win = GetParent()->FindWindow( wxID_CANCEL ) ;
         if (win)
         {
-               wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
-               new_event.SetEventObject( win );
-               win->GetEventHandler()->ProcessEvent( new_event );
-       }
+            wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
+            new_event.SetEventObject( win );
+            win->GetEventHandler()->ProcessEvent( new_event );
+        }
     }
     else if ( event.GetKeyCode() == WXK_TAB )
     {
@@ -964,10 +963,10 @@ void wxListBox::OnChar(wxKeyEvent& event)
     {
         // perform the default key handling first
         wxControl::OnKeyDown( event ) ;
-        
+
         wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId);
         event.SetEventObject( this );
-        
+
         wxArrayInt aSelections;
         int n, count = GetSelections(aSelections);
         if ( count > 0 )
@@ -983,9 +982,9 @@ void wxListBox::OnChar(wxKeyEvent& event)
         {
             n = -1;
         }
-        
+
         event.SetInt(n);
-        
+
         GetEventHandler()->ProcessEvent(event);
     }
     else
@@ -1004,18 +1003,17 @@ void wxListBox::OnChar(wxKeyEvent& event)
                 SetSelection(line) ;
                 wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, m_windowId);
                 event.SetEventObject( this );
-                
+
                 if ( HasClientObjectData() )
                     event.SetClientObject( GetClientObject( line ) );
                 else if ( HasClientUntypedData() )
                     event.SetClientData( GetClientData(line) );
                 event.SetString( GetString(line) );
-                
+
                 event.SetInt(line);
-                
+
                 GetEventHandler()->ProcessEvent(event);
             }
         }
     }
 }
-
index c014ae3a4e5f988f318f4428479d40a1e26fadac..b2e28eb366ab6ea370b1536e4d4c50841cf1b912 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        checklst.cpp
+// Name:        src/motif/checklst.cpp
 // Purpose:     implementation of wxCheckListBox class
 // Author:      Julian Smart
 // Modified by:
@@ -97,7 +97,7 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
     bool retVal = wxListBox::Create(parent, id, pos, size, n, choices,
                                     style, validator, name);
     return retVal;
-}   
+}
 
 bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
                             const wxPoint& pos,
@@ -111,7 +111,7 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
     bool retVal = wxListBox::Create(parent, id, pos, size, choices,
                                     style, validator, name);
     return retVal;
-}   
+}
 
 // check items
 // -----------
@@ -156,10 +156,10 @@ int wxCheckListBox::DoAppend(const wxString& item)
     return wxListBox::DoAppend( Prefix(false) + item );
 }
 
-int wxCheckListBox::FindString(const wxString& s) const
+int wxCheckListBox::FindString(const wxString& s, bool bCase) const
 {
-    int n1 = wxListBox::FindString(Prefix(false) + s);
-    int n2 = wxListBox::FindString(Prefix(true) + s);
+    int n1 = wxListBox::FindString(Prefix(false) + s, bCase);
+    int n2 = wxListBox::FindString(Prefix(true) + s, bCase);
     int min = wxMin(n1, n2), max = wxMax(n1, n2);
 
     // why this works:
index c035ba3f62fe12b5b7a0a6da01f80df91680515b..8b8062b87b45fa787cfa5b8411b58eaa819127ed 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choice.cpp
+// Name:        src/motif/choice.cpp
 // Purpose:     wxChoice
 // Author:      Julian Smart
 // Modified by:
@@ -278,7 +278,7 @@ int wxChoice::GetSelection() const
     wxXmString freeMe(text);
     wxString s = wxXmStringToString( text );
 
-    if (!s.IsEmpty())
+    if (!s.empty())
     {
         int i = 0;
         for (wxStringList::compatibility_iterator node = m_stringList.GetFirst ();
@@ -329,21 +329,6 @@ void wxChoice::SetSelection(int n)
     m_inSetValue = false;
 }
 
-int wxChoice::FindString(const wxString& s) const
-{
-    int i = 0;
-    for (wxStringList::compatibility_iterator node = m_stringList.GetFirst();
-         node; node = node->GetNext ())
-    {
-        if (s == node->GetData())
-            return i;
-
-        i++;
-    }
-
-    return wxNOT_FOUND;
-}
-
 wxString wxChoice::GetString(int n) const
 {
     wxStringList::compatibility_iterator node = m_stringList.Item(n);
index c1f11b75b957c1d7067ba2a29bf8a5e341603033..2d8be1fbbb13f676d897b2322a634e0000fca7b1 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        combobox.cpp
+// Name:        src/motif/combobox.cpp
 // Purpose:     wxComboBox class
 // Author:      Julian Smart
 // Modified by:
@@ -222,8 +222,10 @@ wxString wxComboBox::GetString(int n) const
         return wxEmptyString;
 }
 
-int wxComboBox::FindString(const wxString& s) const
+int wxComboBox::FindString(const wxString& s, bool bCase) const
 {
+    // FIXME: back to base class for not supported value of bCase
+
     int *pos_list = NULL;
     int count = 0;
     wxXmString text( s );
@@ -237,7 +239,7 @@ int wxComboBox::FindString(const wxString& s) const
         return pos;
     }
 
-    return -1;
+    return wxNOT_FOUND;
 }
 
 // Clipboard operations
index d7f6e74751f03e587a4f4fbc9f9c0df0c5101a05..e63ac735e00f89c5e6c67965d68127367e986fae 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        combobox_native.cpp
+// Name:        src/motif/combobox_native.cpp
 // Purpose:     wxComboBox class
 // Author:      Julian Smart, Ian Brown
 // Modified by:
@@ -292,8 +292,10 @@ wxString wxComboBox::GetString(int n) const
     return wxDoGetStringInList( GetXmList(this), n );
 }
 
-int wxComboBox::FindString(const wxString& s) const
+int wxComboBox::FindString(const wxString& s, bool bCase) const
 {
+    // FIXME: back to base class for not supported value of bCase
+
     return wxDoFindStringInList( GetXmList( this ), s );
 }
 
index 5b85211f215a6aa07f9396abbace32991a7bfd20..f9c75ae82a95e3b3e09dc5db499e10b2f55236f6 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        listbox.cpp
+// Name:        src/motif/listbox.cpp
 // Purpose:     wxListBox
 // Author:      Julian Smart
 // Modified by:
@@ -306,8 +306,10 @@ int wxDoFindStringInList(Widget w, const wxString& s)
         return -1;
 }
 
-int wxListBox::FindString(const wxString& s) const
+int wxListBox::FindString(const wxString& s, bool bCase) const
 {
+    // FIXME: back to base class for not supported value of bCase
+
     return wxDoFindStringInList( (Widget)m_mainWidget, s );
 }
 
@@ -712,4 +714,3 @@ wxSize wxListBox::DoGetBestSize() const
 {
     return wxDoGetListBoxBestSize( (Widget)m_mainWidget, this );
 }
-
index 6f30a74f036008f8faff7f5f9a40760e20e3a824..f5e418295437014fa9bc57152c3bae4f32d50955 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        radiobox.cpp
+// Name:        src/motif/radiobox.cpp
 // Purpose:     wxRadioBox
 // Author:      Julian Smart
 // Modified by:
@@ -192,15 +192,6 @@ void wxRadioBox::SetString(int item, const wxString& label)
     }
 }
 
-int wxRadioBox::FindString(const wxString& s) const
-{
-    int i;
-    for (i = 0; i < m_noItems; i++)
-        if (s == m_radioButtonLabels[i])
-            return i;
-    return wxNOT_FOUND;
-}
-
 void wxRadioBox::SetSelection(int n)
 {
     if (!IsValid(n))
@@ -434,4 +425,3 @@ void wxRadioBoxCallback (Widget w, XtPointer clientData,
   event.SetEventObject(item);
   item->ProcessCommand (event);
 }
-
index a21d63a68873a5b69b34353751b513536bb4f0b8..b643d1d1cbb8f8432b42cee87865a08cce5493d9 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choice.cpp
+// Name:        src/msw/choice.cpp
 // Purpose:     wxChoice
 // Author:      Julian Smart
 // Modified by: Vadim Zeitlin to derive from wxChoiceBase
@@ -331,7 +331,7 @@ int wxChoice::GetCount() const
     return (int)SendMessage(GetHwnd(), CB_GETCOUNT, 0, 0);
 }
 
-int wxChoice::FindString(const wxString& s) const
+int wxChoice::FindString(const wxString& s, bool bCase) const
 {
 #if defined(__WATCOMC__) && defined(__WIN386__)
     // For some reason, Watcom in WIN386 mode crashes in the CB_FINDSTRINGEXACT message.
@@ -340,7 +340,7 @@ int wxChoice::FindString(const wxString& s) const
     for ( int i = 0; i < count; i++ )
     {
         // as CB_FINDSTRINGEXACT is case insensitive, be case insensitive too
-        if ( GetString(i).IsSameAs(s, false) )
+        if ( GetString(i).IsSameAs(s, bCase) )
             return i;
     }
 
@@ -350,21 +350,26 @@ int wxChoice::FindString(const wxString& s) const
    //passed to SendMessage, so we have to do it ourselves in that case
    if ( s.empty() )
    {
-     int count = GetCount();
-     for ( int i = 0; i < count; i++ )
-     {
-       if ( GetString(i).empty() )
-           return i;
-     }
-
-     return wxNOT_FOUND;
+       int count = GetCount();
+       for ( int i = 0; i < count; i++ )
+       {
+         if ( GetString(i).empty() )
+             return i;
+       }
+
+       return wxNOT_FOUND;
+   }
+   else if (bCase)
+   {
+       // back to base class search for not native search type
+       return wxItemContainerImmutable::FindString( s, bCase );
    }
    else
    {
-     int pos = (int)SendMessage(GetHwnd(), CB_FINDSTRINGEXACT,
-                                (WPARAM)-1, (LPARAM)s.c_str());
+       int pos = (int)SendMessage(GetHwnd(), CB_FINDSTRINGEXACT,
+                                  (WPARAM)-1, (LPARAM)s.c_str());
 
-     return pos == LB_ERR ? wxNOT_FOUND : pos;
+       return pos == LB_ERR ? wxNOT_FOUND : pos;
    }
 #endif // Watcom/!Watcom
 }
@@ -675,4 +680,3 @@ WXHBRUSH wxChoice::MSWControlColor(WXHDC hDC, WXHWND hWnd)
 }
 
 #endif // wxUSE_CHOICE && !(__SMARTPHONE__ && __WXWINCE__)
-
index 07b6aaebf2ad70d0d5868e8deea130919a6d2f4f..e8bfb9b75c9b80fb7f74a476e8fc4e0d86863f17 100644 (file)
@@ -348,8 +348,12 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
     InvalidateBestSize();
 }
 
-int wxListBox::FindString(const wxString& s) const
+int wxListBox::FindString(const wxString& s, bool bCase) const
 {
+    // back to base class search for not native search type
+    if (bCase)
+       return wxItemContainerImmutable::FindString( s, bCase );
+
     int pos = ListBox_FindStringExact(GetHwnd(), (WPARAM)-1, s);
     if (pos == LB_ERR)
         return wxNOT_FOUND;
index edadc5f8e423bc232d03503b954c3644e9cf5804..fa7426f1fe55e5423e8298a54c460c433f2e075f 100644 (file)
@@ -223,7 +223,7 @@ bool wxChoice::CreateAndInit(wxWindow *parent,
     if ( style & wxSP_WRAP )
         spiner_style |= UDS_WRAP;
 
-    if ( !MSWCreateControl(UPDOWN_CLASS, spiner_style, posBtn, sizeBtn, _T(""), 0) )
+    if ( !MSWCreateControl(UPDOWN_CLASS, spiner_style, posBtn, sizeBtn, wxEmptyString, 0) )
         return false;
 
     // subclass the text ctrl to be able to intercept some events
@@ -414,8 +414,12 @@ int wxChoice::GetCount() const
     return (int)::SendMessage(GetBuddyHwnd(), LB_GETCOUNT, 0, 0);
 }
 
-int wxChoice::FindString(const wxString& s) const
+int wxChoice::FindString(const wxString& s, bool bCase) const
 {
+    // back to base class search for not native search type
+    if (bCase)
+       return wxItemContainerImmutable::FindString( s, bCase );
+
     int pos = (int)::SendMessage(GetBuddyHwnd(), LB_FINDSTRINGEXACT,
                                (WPARAM)-1, (LPARAM)s.c_str());
 
index f1501642526bf45992322e0edee41b1190753c9f..8235ed353217ecb2283c786fabe413f2f6025fa9 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choice.cpp
+// Name:        src/os2/choice.cpp
 // Purpose:     wxChoice
 // Author:      David Webster
 // Modified by:
@@ -201,38 +201,10 @@ int wxChoice::GetCount() const
     return((int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMCOUNT, (MPARAM)0, (MPARAM)0)));
 } // end of wxChoice::GetCount
 
-int wxChoice::FindString(
-  const wxString&                   rsStr
-) const
+void wxChoice::SetString( int n, const wxString& rsStr )
 {
-    int                             nPos;
-    int                             nTextLength;
-    PSZ                             zStr;
-    int                             nItemCount;
-
-    nItemCount = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMCOUNT, (MPARAM)0, (MPARAM)0));
-    for (nPos = 0; nPos < nItemCount; nPos++)
-    {
-        nTextLength = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0));
-        zStr = new char[nTextLength + 1];
-        ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)nPos, (SHORT)nTextLength), (MPARAM)zStr);
-        if (rsStr == (wxChar*)zStr)
-        {
-            delete [] zStr;
-            break;
-        }
-        delete [] zStr;
-    }
-    return nPos;
-} // end of wxChoice::FindString
-
-void wxChoice::SetString(
-  int                               n
-, const wxString&                   rsStr
-)
-{
-    LONG                            nIndexType = 0;
-    void*                           pData;
+    LONG  nIndexType = 0;
+    void* pData;
 
     if ( m_clientDataItemsType != wxClientData_None )
     {
@@ -263,13 +235,11 @@ void wxChoice::SetString(
     }
 } // end of wxChoice::SetString
 
-wxString wxChoice::GetString(
-  int                               n
-) const
+wxString wxChoice::GetString(int n) const
 {
-    int                             nLen = 0;
-    wxString                        sStr = wxEmptyString;
-    wxChar*                         zBuf;
+    int      nLen = 0;
+    wxString sStr = wxEmptyString;
+    wxChar*  zBuf;
 
     nLen = (size_t)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)n, (MPARAM)0));
     if (nLen != LIT_ERROR && nLen > 0)
index ec5c2588edb43d60ba118e77439c65cd78a5ca12..cd7946293414a799446b9112ad98aac928896692 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        listbox.cpp
+// Name:        src/os2/listbox.cpp
 // Purpose:     wxListBox
 // Author:      David Webster
 // Modified by:
@@ -364,30 +364,6 @@ void wxListBox::DoSetItems(
     ::WinShowWindow(GetHwnd(), TRUE);
 } // end of wxListBox::DoSetItems
 
-int wxListBox::FindString(
-  const wxString&                   rsString
-) const
-{
-    int                             nPos;
-    LONG                            lTextLength;
-    PSZ                             zStr;
-
-
-    for (nPos = 0; nPos < m_nNumItems; nPos++)
-    {
-        lTextLength = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0));
-        zStr = new char[lTextLength + 1];
-        ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT(nPos, (SHORT)lTextLength), (MPARAM)zStr);
-        if (rsString == (wxChar*)zStr)
-        {
-            delete [] zStr;
-            break;
-        }
-        delete [] zStr;
-    }
-    return nPos;
-} // end of wxListBox::FindString
-
 void wxListBox::Clear()
 {
 #if wxUSE_OWNER_DRAWN
index 1e026433fc50a2b5c58173d13797b93aa5bd3ade..af010f9576a6c27f29031397a56818232df0878a 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        radiobox.cpp
+// Name:        src/os2/radiobox.cpp
 // Purpose:     wxRadioBox
 // Author:      David Webster
 // Modified by:
@@ -686,18 +686,6 @@ bool wxRadioBox::Enable(
     return true;
 } // end of wxRadioBox::Enable
 
-int wxRadioBox::FindString(
-  const wxString&                   rsStr
-) const
-{
-    for (int i = 0; i < m_nNoItems; i++)
-    {
-        if (rsStr == wxGetWindowText(m_ahRadioButtons[i]) )
-            return i;
-    }
-    return wxNOT_FOUND;
-} // end of wxRadioBox::FindString
-
 int wxRadioBox::GetColumnCount() const
 {
     return GetNumHor();
@@ -708,9 +696,7 @@ int wxRadioBox::GetCount() const
     return m_nNoItems;
 } // end of wxRadioBox::GetCount
 
-wxString wxRadioBox::GetLabel(
-  int                               nItem
-) const
+wxString wxRadioBox::GetLabel(int nItem) const
 {
     wxCHECK_MSG( IsValid(nItem), wxEmptyString, wxT("invalid radiobox index") );
 
@@ -1051,11 +1037,9 @@ void wxRadioBox::SetString(
     ::WinSetWindowText((HWND)m_ahRadioButtons[nItem], (PSZ)rsLabel.c_str());
 } // end of wxRadioBox::SetString
 
-bool wxRadioBox::SetStringSelection(
-  const wxString&                   rsStr
-)
+bool wxRadioBox::SetStringSelection(const wxString& rsStr)
 {
-    int                             nSel = FindString(rsStr);
+    int nSel = FindString(rsStr);
 
     if (nSel > -1)
     {
index 7f1a5a0bacf094710a0a92627af627c23e032685..ce5eedf27463d27b32d75e994511c7625229881c 100644 (file)
@@ -193,11 +193,6 @@ int wxChoice::GetCount() const
     return 0;
 }
 
-int wxChoice::FindString(const wxString& s) const
-{
-    return 0;
-}
-
 void wxChoice::SetString(int n, const wxString& s)
 {
 }
index 89b033a925d5d6e8f3c9b89f59bb9cf20ca25db0..2ee8226dde3482236b1ee041685446c8234d526b 100644 (file)
@@ -190,11 +190,6 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
 {
 }
 
-int wxListBox::FindString(const wxString& s) const
-{
-    return wxNOT_FOUND;
-}
-
 void wxListBox::Clear()
 {
 }
index 413a6cdc368b2b4f34b783c297b2e90f9cafe830..ba970585eda85e72e7d86ba37579e72d2e82248f 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        univ/combobox.cpp
+// Name:        src/univ/combobox.cpp
 // Purpose:     wxComboControl and wxComboBox implementation
 // Author:      Vadim Zeitlin
 // Modified by:
@@ -825,9 +825,9 @@ void wxComboBox::SetString(int n, const wxString& s)
     GetLBox()->SetString(n, s);
 }
 
-int wxComboBox::FindString(const wxString& s) const
+int wxComboBox::FindString(const wxString& s, bool bCase) const
 {
-    return GetLBox()->FindString(s);
+    return GetLBox()->FindString(s, bCase);
 }
 
 void wxComboBox::SetSelection(int n)