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:
@@ -101,8 +101,8 @@ void wxGenericStaticText::SetLabel(const wxString& label)
|
|||||||
{
|
{
|
||||||
wxControl::SetLabel(label);
|
wxControl::SetLabel(label);
|
||||||
DoSetLabel(GetEllipsizedLabel());
|
DoSetLabel(GetEllipsizedLabel());
|
||||||
if ( !HasFlag(wxST_NO_AUTORESIZE) && !IsEllipsized() )
|
if ( !IsEllipsized() )
|
||||||
InvalidateBestSize();
|
AutoResizeIfNecessary();
|
||||||
|
|
||||||
#if wxUSE_MARKUP
|
#if wxUSE_MARKUP
|
||||||
if ( m_markupText )
|
if ( m_markupText )
|
||||||
@@ -132,8 +132,7 @@ bool wxGenericStaticText::DoSetLabelMarkup(const wxString& markup)
|
|||||||
else
|
else
|
||||||
m_markupText->SetMarkup(markup);
|
m_markupText->SetMarkup(markup);
|
||||||
|
|
||||||
if ( !HasFlag(wxST_NO_AUTORESIZE) )
|
AutoResizeIfNecessary();
|
||||||
InvalidateBestSize();
|
|
||||||
|
|
||||||
Refresh();
|
Refresh();
|
||||||
|
|
||||||
@@ -146,8 +145,9 @@ bool wxGenericStaticText::SetFont(const wxFont &font)
|
|||||||
{
|
{
|
||||||
if ( !wxControl::SetFont(font) )
|
if ( !wxControl::SetFont(font) )
|
||||||
return false;
|
return false;
|
||||||
if ( !HasFlag(wxST_NO_AUTORESIZE) )
|
|
||||||
InvalidateBestSize();
|
AutoResizeIfNecessary();
|
||||||
|
|
||||||
Refresh();
|
Refresh();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user