X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d7fa7eaa2dc8ef4154ac4d9d739bcfb6be1669ac..d0604192a55216dd4d7494541ab32cfe4afd1ad0:/src/gtk1/radiobox.cpp?ds=inline diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp index 98e57717ad..5bc55111c2 100644 --- a/src/gtk1/radiobox.cpp +++ b/src/gtk1/radiobox.cpp @@ -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(); }