X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68567a967bc8afd37a40cb9a7ee5021b9ee6cd96..8168167976dc3cc5f5223a21e1a62ba91a4f77b3:/src/gtk/statbox.cpp diff --git a/src/gtk/statbox.cpp b/src/gtk/statbox.cpp index 89c9c8adc3..bb499a7cda 100644 --- a/src/gtk/statbox.cpp +++ b/src/gtk/statbox.cpp @@ -56,8 +56,8 @@ bool wxStaticBox::Create( wxWindow *parent, return FALSE; } - m_widget = gtk_frame_new(NULL); - SetLabel(label); + m_widget = GTKCreateFrame(label); + wxControl::SetLabel(label); m_parent->DoAddChild( this ); @@ -87,8 +87,17 @@ void wxStaticBox::SetLabel( const wxString& label ) void wxStaticBox::DoApplyWidgetStyle(GtkRcStyle *style) { - gtk_widget_modify_style(m_widget, style); - gtk_widget_modify_style(GTK_FRAME(m_widget)->label_widget, style); + GTKFrameApplyWidgetStyle(GTK_FRAME(m_widget), style); +} + +bool wxStaticBox::GTKWidgetNeedsMnemonic() const +{ + return true; +} + +void wxStaticBox::GTKWidgetDoSetMnemonic(GtkWidget* w) +{ + GTKFrameSetMnemonicWidget(GTK_FRAME(m_widget), w); } // static @@ -98,4 +107,13 @@ wxStaticBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) return GetDefaultAttributesFromGTKWidget(gtk_frame_new); } + +void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const +{ + const int BORDER = 5; // FIXME: hardcoded value + + *borderTop = GetLabel().empty() ? 2*BORDER : GetCharHeight(); + *borderOther = BORDER; +} + #endif // wxUSE_STATBOX