diff --git a/src/generic/stattextg.cpp b/src/generic/stattextg.cpp index bf083853e2..ff8c40270e 100644 --- a/src/generic/stattextg.cpp +++ b/src/generic/stattextg.cpp @@ -101,8 +101,8 @@ void wxGenericStaticText::SetLabel(const wxString& label) { wxControl::SetLabel(label); DoSetLabel(GetEllipsizedLabel()); - if ( !HasFlag(wxST_NO_AUTORESIZE) && !IsEllipsized() ) - InvalidateBestSize(); + if ( !IsEllipsized() ) + AutoResizeIfNecessary(); #if wxUSE_MARKUP if ( m_markupText ) @@ -132,8 +132,7 @@ bool wxGenericStaticText::DoSetLabelMarkup(const wxString& markup) else m_markupText->SetMarkup(markup); - if ( !HasFlag(wxST_NO_AUTORESIZE) ) - InvalidateBestSize(); + AutoResizeIfNecessary(); Refresh(); @@ -146,8 +145,9 @@ bool wxGenericStaticText::SetFont(const wxFont &font) { if ( !wxControl::SetFont(font) ) return false; - if ( !HasFlag(wxST_NO_AUTORESIZE) ) - InvalidateBestSize(); + + AutoResizeIfNecessary(); + Refresh(); return true; }