]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/radiobox.cpp
Unicode fixes
[wxWidgets.git] / src / gtk1 / radiobox.cpp
index 3e2dc3124cf938f2d6ab5f0a79e517300bc80f51..1871c04a4acc12da0c49924fe5dd4ff9075bbeba 100644 (file)
@@ -166,7 +166,7 @@ wxSize wxRadioBox::LayoutItems()
     if ( m_majorDim == 0 )
     {
         // avoid dividing by 0 below
-        wxFAIL_MSG( "dimension of radiobox should not be 0!" );
+        wxFAIL_MSG( _T("dimension of radiobox should not be 0!") );
 
         m_majorDim = 1;
     }
@@ -328,7 +328,11 @@ void wxRadioBox::SetSelection( int n )
 
     GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
 
+    DisableEvents();
+    
     gtk_toggle_button_set_state( button, 1 );
+    
+    EnableEvents();
 }
 
 int wxRadioBox::GetSelection(void) const
@@ -494,6 +498,30 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
     wxFAIL_MSG(_T("wxRadioBox::SetNumberOfRowsOrCols not implemented."));
 }
 
+void wxRadioBox::DisableEvents()
+{
+    wxNode *node = m_boxes.First();
+    while (node)
+    {
+        gtk_signal_disconnect_by_func( GTK_OBJECT(node->Data()),
+           GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
+
+       node = node->Next();
+    }
+}
+
+void wxRadioBox::EnableEvents()
+{
+    wxNode *node = m_boxes.First();
+    while (node)
+    {
+        gtk_signal_connect( GTK_OBJECT(node->Data()), "clicked",
+           GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this );
+
+       node = node->Next();
+    }
+}
+
 void wxRadioBox::ApplyWidgetStyle()
 {
     SetWidgetStyle();