]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/radiobox.cpp
Applied patch [ 651640 ] Toolbar sizing fix
[wxWidgets.git] / src / gtk1 / radiobox.cpp
index 98e57717ad7fbfb1a2f3e63f2576e5b772995f60..5bc55111c2674038e1b9941dfc5c1c166602580b 100644 (file)
@@ -180,7 +180,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
         return FALSE;
     }
 
-    m_widget = gtk_frame_new( title.mbc_str() );
+    m_widget = gtk_frame_new( wxGTK_CONV( title ) );
 
     // majorDim may be 0 if all trailing parameters were omitted, so don't
     // assert here but just use the correct value for it
@@ -202,7 +202,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
                 label += *pc;
         }
 
-        m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, label.mbc_str() ) );
+        m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, wxGTK_CONV( label ) ) );
 
         gtk_signal_connect( GTK_OBJECT(m_radio), "key_press_event",
            GTK_SIGNAL_FUNC(gtk_radiobox_keypress_callback), (gpointer)this );
@@ -418,7 +418,7 @@ bool wxRadioBox::Show( bool show )
     return TRUE;
 }
 
-int wxRadioBox::FindString( const wxString &s ) const
+int wxRadioBox::FindString( const wxString &find ) const
 {
     wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid radiobox") );
 
@@ -428,7 +428,12 @@ int wxRadioBox::FindString( const wxString &s ) const
     while (node)
     {
         GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
-        if (s == label->label)
+#ifdef __WXGTK20__
+        wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
+#else
+        wxString str( label->label );
+#endif
+        if (find == str)
             return count;
 
         count++;
@@ -505,7 +510,13 @@ wxString wxRadioBox::GetString( int n ) const
 
     GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
 
-    return wxString( label->label );
+#ifdef __WXGTK20__
+    wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
+#else
+    wxString str( label->label );
+#endif
+
+    return str;
 }
 
 void wxRadioBox::SetLabel( const wxString& label )
@@ -514,7 +525,7 @@ void wxRadioBox::SetLabel( const wxString& label )
 
     wxControl::SetLabel( label );
 
-    gtk_frame_set_label( GTK_FRAME(m_widget), wxControl::GetLabel().mbc_str() );
+    gtk_frame_set_label( GTK_FRAME(m_widget), wxGTK_CONV( wxControl::GetLabel() ) );
 }
 
 void wxRadioBox::SetString( int item, const wxString& label )
@@ -527,7 +538,7 @@ void wxRadioBox::SetString( int item, const wxString& label )
 
     GtkLabel *g_label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
 
-    gtk_label_set( g_label, label.mbc_str() );
+    gtk_label_set( g_label, wxGTK_CONV( label ) );
 }
 
 bool wxRadioBox::Enable( bool enable )
@@ -592,7 +603,12 @@ wxString wxRadioBox::GetStringSelection() const
         {
             GtkLabel *label = GTK_LABEL( BUTTON_CHILD(node->Data()) );
 
-            return label->label;
+#ifdef __WXGTK20__
+            wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
+#else
+            wxString str( label->label );
+#endif
+            return str;
         }
         node = node->Next();
     }