X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c67daf87774c71ae9f73af9969008af220e52a11..13439807d34f5a71f95dadb727e7b0056dba210a:/src/gtk/radiobox.cpp diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index c8120af624..31e9a8e856 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -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; + } +}