X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe161a2685012cf90bb5bfe95f2260aee71d8ad7..2e11bb424c946b702a17f121539c28d692a2ae00:/src/mac/classic/stattext.cpp diff --git a/src/mac/classic/stattext.cpp b/src/mac/classic/stattext.cpp index 8bc3ee9272..50acd4a904 100644 --- a/src/mac/classic/stattext.cpp +++ b/src/mac/classic/stattext.cpp @@ -24,9 +24,7 @@ #include -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) -#endif #include "wx/mac/uma.h" @@ -232,11 +230,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; +}