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
This commit is contained in:
Vadim Zeitlin
2014-10-24 21:54:34 +00:00
parent f0aea4098c
commit 693f41781b

View File

@@ -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;
}