From 693f41781b699ac56e1e6adbe9b355e88e601cfe Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 24 Oct 2014 21:54:34 +0000 Subject: [PATCH] Auto resize wxGenericStaticText when its label or font is changed. This makes the generic version consistent with the native control behaviour. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/stattextg.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; }