X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b2ff89d648e5b73172dc2f4aa84d2aadbdc063ec..1f71a77057d49f4fbf727ad3a5ad2269d124ed0d:/src/gtk/statbox.cpp diff --git a/src/gtk/statbox.cpp b/src/gtk/statbox.cpp index c000c1306a..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,10 +87,17 @@ void wxStaticBox::SetLabel( const wxString& label ) void wxStaticBox::DoApplyWidgetStyle(GtkRcStyle *style) { - gtk_widget_modify_style(m_widget, style); -#ifdef __WXGTK20__ - gtk_widget_modify_style(GTK_FRAME(m_widget)->label_widget, style); -#endif + GTKFrameApplyWidgetStyle(GTK_FRAME(m_widget), style); +} + +bool wxStaticBox::GTKWidgetNeedsMnemonic() const +{ + return true; +} + +void wxStaticBox::GTKWidgetDoSetMnemonic(GtkWidget* w) +{ + GTKFrameSetMnemonicWidget(GTK_FRAME(m_widget), w); } // static @@ -100,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