X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe161a2685012cf90bb5bfe95f2260aee71d8ad7..ea68b7060519bc63646e39fc76a963ecd04e667e:/src/mac/classic/stattext.cpp diff --git a/src/mac/classic/stattext.cpp b/src/mac/classic/stattext.cpp index 8bc3ee9272..38c4b1041b 100644 --- a/src/mac/classic/stattext.cpp +++ b/src/mac/classic/stattext.cpp @@ -232,11 +232,33 @@ void wxStaticText::SetLabel(const wxString& st ) { SetTitle( st ) ; m_label = st ; - - if (GetAdjustMinSizeFlag()) - SetBestSize(wxDefaultSize); - + if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) + { + // temporary fix until layout measurement and drawing are in synch again + Refresh() ; + InvalidateBestSize(); + SetSize( GetBestSize() ) ; + } Refresh() ; Update() ; } +bool wxStaticText::SetFont(const wxFont& font) +{ + bool ret = wxControl::SetFont(font); + + if ( ret ) + { + // adjust the size of the window to fit to the label unless autoresizing is + // disabled + if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) + { + // temporary fix until layout measurement and drawing are in synch again + Refresh() ; + InvalidateBestSize(); + SetSize( GetBestSize() ); + } + } + + return ret; +}