From 55094d8b356fe5793984909046cfcee517127b36 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 8 Feb 2004 13:22:53 +0000 Subject: [PATCH] redraw forced for size changes (layout for measuring is simpler than word-wrapping drawing code) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/stattext.cpp | 20 +++++++++++++++----- src/mac/stattext.cpp | 20 +++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 2d81d33b16..4c8b9414a4 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -233,8 +233,11 @@ void wxStaticText::SetLabel(const wxString& st ) SetTitle( st ) ; m_label = st ; if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) + { + // temporary fix until layout measurement and drawing are in synch again + Refresh() ; SetSize( GetBestSize() ) ; - + } Refresh() ; Update() ; } @@ -243,10 +246,17 @@ bool wxStaticText::SetFont(const wxFont& font) { bool ret = wxControl::SetFont(font); - // adjust the size of the window to fit to the label unless autoresizing is - // disabled - if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) - SetSize( GetBestSize() ); + 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() ; + SetSize( GetBestSize() ); + } + } return ret; } diff --git a/src/mac/stattext.cpp b/src/mac/stattext.cpp index 2d81d33b16..4c8b9414a4 100644 --- a/src/mac/stattext.cpp +++ b/src/mac/stattext.cpp @@ -233,8 +233,11 @@ void wxStaticText::SetLabel(const wxString& st ) SetTitle( st ) ; m_label = st ; if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) + { + // temporary fix until layout measurement and drawing are in synch again + Refresh() ; SetSize( GetBestSize() ) ; - + } Refresh() ; Update() ; } @@ -243,10 +246,17 @@ bool wxStaticText::SetFont(const wxFont& font) { bool ret = wxControl::SetFont(font); - // adjust the size of the window to fit to the label unless autoresizing is - // disabled - if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) - SetSize( GetBestSize() ); + 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() ; + SetSize( GetBestSize() ); + } + } return ret; } -- 2.45.2