From: Robin Dunn Date: Fri, 7 Jun 2002 15:40:49 +0000 (+0000) Subject: Fixed bug that showed a small gap on the wxStaticBox when the label X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0154a29737d3185127f135dd96f029e65ba89df5?ds=inline Fixed bug that showed a small gap on the wxStaticBox when the label string was empty. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/statbox.cpp b/src/gtk/statbox.cpp index 07c354e4c4..22c946136c 100644 --- a/src/gtk/statbox.cpp +++ b/src/gtk/statbox.cpp @@ -58,7 +58,7 @@ bool wxStaticBox::Create( wxWindow *parent, return FALSE; } - m_widget = gtk_frame_new(m_label.empty() ? (char *)NULL : m_label.mbc_str()); + m_widget = gtk_frame_new(label.empty() ? (char *)NULL : label.mbc_str()); m_parent->DoAddChild( this ); @@ -79,7 +79,7 @@ bool wxStaticBox::Create( wxWindow *parent, if ( xalign ) gtk_frame_set_label_align(GTK_FRAME( m_widget ), xalign, 0.0); - + Show( TRUE ); return TRUE; @@ -89,7 +89,8 @@ void wxStaticBox::SetLabel( const wxString &label ) { wxControl::SetLabel( label ); - gtk_frame_set_label( GTK_FRAME( m_widget ), GetLabel().mbc_str() ); + gtk_frame_set_label( GTK_FRAME( m_widget ), + label.empty() ? (char *)NULL : label.mbc_str() ); } void wxStaticBox::ApplyWidgetStyle() diff --git a/src/gtk1/statbox.cpp b/src/gtk1/statbox.cpp index 07c354e4c4..22c946136c 100644 --- a/src/gtk1/statbox.cpp +++ b/src/gtk1/statbox.cpp @@ -58,7 +58,7 @@ bool wxStaticBox::Create( wxWindow *parent, return FALSE; } - m_widget = gtk_frame_new(m_label.empty() ? (char *)NULL : m_label.mbc_str()); + m_widget = gtk_frame_new(label.empty() ? (char *)NULL : label.mbc_str()); m_parent->DoAddChild( this ); @@ -79,7 +79,7 @@ bool wxStaticBox::Create( wxWindow *parent, if ( xalign ) gtk_frame_set_label_align(GTK_FRAME( m_widget ), xalign, 0.0); - + Show( TRUE ); return TRUE; @@ -89,7 +89,8 @@ void wxStaticBox::SetLabel( const wxString &label ) { wxControl::SetLabel( label ); - gtk_frame_set_label( GTK_FRAME( m_widget ), GetLabel().mbc_str() ); + gtk_frame_set_label( GTK_FRAME( m_widget ), + label.empty() ? (char *)NULL : label.mbc_str() ); } void wxStaticBox::ApplyWidgetStyle()