X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e5403d7c573d45fcfef73959c41fda93aea1d07f..7f985bd39a0605d8dea4b4b1abc717c5658209c6:/src/gtk1/radiobox.cpp diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp index 2d00f6d3e8..c1f3fcc165 100644 --- a/src/gtk1/radiobox.cpp +++ b/src/gtk1/radiobox.cpp @@ -104,7 +104,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, gtk_myfixed_put( GTK_MYFIXED(m_parent->m_wxwindow), GTK_WIDGET(m_radio), x, y ); - int tmp = 22+gdk_string_measure( GTK_WIDGET(m_radio)->style->font, choices[i] ); + int tmp = 25+gdk_string_measure( GTK_WIDGET(m_radio)->style->font, choices[i] ); if (tmp > maxLen) maxLen = tmp; width = m_width-10; @@ -159,11 +159,16 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, if (newSize.y == -1) newSize.y = height; SetSize( newSize.x, newSize.y ); + m_parent->AddChild( this ); + + (m_parent->m_insertCallback)( m_parent, this ); + PostCreation(); SetLabel( title ); SetBackgroundColour( parent->GetBackgroundColour() ); + SetForegroundColour( parent->GetForegroundColour() ); Show( TRUE ); @@ -460,46 +465,25 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) ) wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented."); } -void wxRadioBox::SetFont( const wxFont &font ) +void wxRadioBox::ApplyWidgetStyle() { - wxCHECK_RET( m_widget != NULL, "invalid radiobox" ); + SetWidgetStyle(); - wxControl::SetFont( font ); - gtk_widget_set_style( m_widget, m_widgetStyle ); wxNode *node = m_boxes.First(); while (node) { - GtkButton *button = GTK_BUTTON( node->Data() ); + GtkWidget *widget = GTK_WIDGET( node->Data() ); + gtk_widget_set_style( widget, m_widgetStyle ); + GtkButton *button = GTK_BUTTON( node->Data() ); gtk_widget_set_style( button->child, m_widgetStyle ); node = node->Next(); } } -void wxRadioBox::SetBackgroundColour( const wxColour &colour ) -{ - wxCHECK_RET( m_widget != NULL, "invalid radiobox" ); - - wxControl::SetBackgroundColour( colour ); - - if (!m_backgroundColour.Ok()) return; - - gtk_widget_set_style( m_widget, m_widgetStyle ); - - wxNode *node = m_boxes.First(); - while (node) - { - GtkWidget *button = GTK_WIDGET( node->Data() ); - - gtk_widget_set_style( button, m_widgetStyle ); - - node = node->Next(); - } -} - bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window ) { if (window == m_widget->window) return TRUE;