reverted m_adjustMinSize change prepatory for a new approach to fix
the problem git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -184,7 +184,6 @@ void wxBitmapButton::SetLabel( const wxString &label )
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid button") );
|
||||
|
||||
wxControl::SetLabel( label );
|
||||
PostSetLabel();
|
||||
}
|
||||
|
||||
wxString wxBitmapButton::GetLabel() const
|
||||
|
||||
@@ -175,8 +175,6 @@ void wxButton::SetLabel( const wxString &label )
|
||||
#else
|
||||
gtk_label_set( GTK_LABEL( BUTTON_CHILD(m_widget) ), wxGTK_CONV( GetLabel() ) );
|
||||
#endif
|
||||
|
||||
PostSetLabel();
|
||||
}
|
||||
|
||||
bool wxButton::Enable( bool enable )
|
||||
|
||||
@@ -158,8 +158,6 @@ void wxCheckBox::SetLabel( const wxString& label )
|
||||
#else
|
||||
gtk_label_set( GTK_LABEL(m_widgetLabel), wxGTK_CONV( GetLabel() ) );
|
||||
#endif
|
||||
|
||||
PostSetLabel();
|
||||
}
|
||||
|
||||
bool wxCheckBox::Enable( bool enable )
|
||||
|
||||
@@ -33,7 +33,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxControl, wxWindow)
|
||||
wxControl::wxControl()
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
m_createComplete = false;
|
||||
}
|
||||
|
||||
bool wxControl::Create( wxWindow *parent,
|
||||
@@ -44,7 +43,6 @@ bool wxControl::Create( wxWindow *parent,
|
||||
const wxValidator& validator,
|
||||
const wxString &name )
|
||||
{
|
||||
m_createComplete = false;
|
||||
bool ret = wxWindow::Create(parent, id, pos, size, style, name);
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
@@ -70,14 +68,6 @@ void wxControl::SetLabel( const wxString &label )
|
||||
}
|
||||
}
|
||||
|
||||
void wxControl::PostSetLabel()
|
||||
{
|
||||
// make sure the widget has been created, and that PostCreate has already
|
||||
// been called
|
||||
if (m_widget && m_createComplete && GetAdjustMinSizeFlag())
|
||||
SetBestSize(wxDefaultSize);
|
||||
}
|
||||
|
||||
wxString wxControl::GetLabel() const
|
||||
{
|
||||
return m_label;
|
||||
@@ -113,7 +103,6 @@ void wxControl::PostCreation(const wxSize& size)
|
||||
InheritAttributes();
|
||||
ApplyWidgetStyle();
|
||||
SetInitialBestSize(size);
|
||||
m_createComplete = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -540,8 +540,6 @@ void wxRadioBox::SetLabel( const wxString& label )
|
||||
wxControl::SetLabel( label );
|
||||
|
||||
gtk_frame_set_label( GTK_FRAME(m_widget), wxGTK_CONV( wxControl::GetLabel() ) );
|
||||
|
||||
PostSetLabel();
|
||||
}
|
||||
|
||||
void wxRadioBox::SetString( int item, const wxString& label )
|
||||
|
||||
@@ -145,8 +145,6 @@ void wxRadioButton::SetLabel( const wxString& label )
|
||||
#else
|
||||
gtk_label_set( g_label, wxGTK_CONV( GetLabel() ) );
|
||||
#endif
|
||||
|
||||
PostSetLabel();
|
||||
}
|
||||
|
||||
void wxRadioButton::SetValue( bool val )
|
||||
|
||||
@@ -89,7 +89,6 @@ void wxStaticBox::SetLabel( const wxString &label )
|
||||
|
||||
gtk_frame_set_label( GTK_FRAME( m_widget ),
|
||||
m_label.empty() ? (char *)NULL : (const char*) wxGTK_CONV( m_label ) );
|
||||
PostSetLabel();
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
@@ -146,10 +146,27 @@ void wxStaticText::SetLabel( const wxString &label )
|
||||
#else
|
||||
gtk_label_set( GTK_LABEL(m_widget), wxGTK_CONV( m_label ) );
|
||||
#endif
|
||||
|
||||
PostSetLabel();
|
||||
|
||||
// adjust the label size to the new label unless disabled
|
||||
if (!HasFlag(wxST_NO_AUTORESIZE))
|
||||
{
|
||||
SetSize( GetBestSize() );
|
||||
SetSizeHints(GetSize());
|
||||
}
|
||||
}
|
||||
|
||||
bool wxStaticText::SetFont( const wxFont &font )
|
||||
{
|
||||
bool ret = wxControl::SetFont(font);
|
||||
|
||||
// adjust the label size to the new label unless disabled
|
||||
if (!HasFlag(wxST_NO_AUTORESIZE))
|
||||
{
|
||||
SetSize( GetBestSize() );
|
||||
SetSizeHints(GetSize());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
wxSize wxStaticText::DoGetBestSize() const
|
||||
{
|
||||
|
||||
@@ -287,8 +287,6 @@ void wxToggleButton::SetLabel(const wxString& label)
|
||||
wxControl::SetLabel(label);
|
||||
|
||||
gtk_label_set(GTK_LABEL(BUTTON_CHILD(m_widget)), wxGTK_CONV( GetLabel() ) );
|
||||
|
||||
PostSetLabel();
|
||||
}
|
||||
|
||||
bool wxToggleButton::Enable(bool enable /*=TRUE*/)
|
||||
|
||||
Reference in New Issue
Block a user