wxMenu doesn't anylonger call the callback if the
[wxWidgets.git] / src / gtk / radiobox.cpp
index c8120af62416e6a9b2a5ebe05101ec56f9730120..31e9a8e85687b23a87f0ba88c375f4154576886b 100644 (file)
@@ -53,6 +53,10 @@ static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRad
 
 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
 
+BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
+  EVT_SIZE(wxRadioBox::OnSize)
+END_EVENT_TABLE()
+
 wxRadioBox::wxRadioBox(void)
 {
 }
@@ -118,6 +122,24 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
   return TRUE;
 }
 
+void wxRadioBox::OnSize( wxSizeEvent &WXUNUSED(event) )
+{
+  int x = m_x+5;
+  int y = m_y+15;
+  
+  GSList *item = gtk_radio_button_group( m_radio );
+  while (item)
+  {
+    GtkWidget *button = GTK_WIDGET( item->data );
+    
+    gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y );
+    
+    y += 20;
+    
+    item = item->next;
+  }
+}
+
 bool wxRadioBox::Show( bool show )
 {
   wxWindow::Show( show );
@@ -279,3 +301,19 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
   wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
 }
 
+void wxRadioBox::SetFont( const wxFont &font )
+{
+  wxWindow::SetFont( font );
+   
+  GSList *item = gtk_radio_button_group( m_radio );
+  while (item)
+  {
+    GtkButton *button = GTK_BUTTON( item->data );
+    
+    gtk_widget_set_style( button->child, 
+      gtk_style_ref(
+        gtk_widget_get_style( m_widget ) ) ); 
+    
+    item = item->next;
+  }
+}