Controls will readjust their size and minsize when SetLabel or SetFont
are called. Fixed up wxStaticText to blend the wxST_NO_AUTOSIZE with this new functionality. Made SetBestSize public under the SetBestFittingSize name. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27890 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -92,27 +92,9 @@ void wxStaticText::SetLabel(const wxString& st )
|
||||
SetControlData( *m_peer, kControlEntireControl , kControlStaticTextCFStringTag, sizeof( CFStringRef ),
|
||||
&ref );
|
||||
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
{
|
||||
SetSize( GetBestSize() ) ;
|
||||
SetSizeHints(GetSize());
|
||||
}
|
||||
if (GetAdjustMinSizeFlag())
|
||||
SetBestSize(wxDefaultSize);
|
||||
|
||||
Update() ;
|
||||
}
|
||||
|
||||
bool wxStaticText::SetFont(const wxFont& font)
|
||||
{
|
||||
bool ret = wxControl::SetFont(font);
|
||||
|
||||
if ( ret )
|
||||
{
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
{
|
||||
SetSize( GetBestSize() );
|
||||
SetSizeHints(GetSize());
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user