X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9e691f46b2ec1b5dbbff2e51131e3c532e688a89..2ad99bc1398db5a619b3682e90ad7a99485ae4c9:/src/gtk/radiobox.cpp diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index cd422ade2b..26240cc004 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -37,7 +37,8 @@ extern bool g_isIdle; // data //----------------------------------------------------------------------------- -extern bool g_blockEventsOnDrag; +extern bool g_blockEventsOnDrag; +extern wxWindowGTK *g_delayedFocus; //----------------------------------------------------------------------------- // "clicked" @@ -179,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 @@ -201,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 ); @@ -455,7 +456,6 @@ void wxRadioBox::SetFocus() } node = node->Next(); } - } void wxRadioBox::SetSelection( int n ) @@ -514,7 +514,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 +527,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 ) @@ -711,6 +711,15 @@ void wxRadioBox::OnInternalIdle() (void)GetEventHandler()->ProcessEvent( event ); } + + if (g_delayedFocus == this) + { + if (GTK_WIDGET_REALIZED(m_widget)) + { + g_delayedFocus = NULL; + SetFocus(); + } + } } #endif // wxUSE_RADIOBOX