From e47e063af24e5f43fdee8b0a1c220e12f7f7e896 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 30 Jan 2009 20:10:44 +0000 Subject: [PATCH] Add wxSIZE_FORCE_EVENT and use is from wxSizerItem::SetDimension git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 2 ++ src/common/sizer.cpp | 5 +++-- src/gtk/window.cpp | 6 ++++++ src/msw/window.cpp | 6 ++++++ src/osx/window_osx.cpp | 7 +++++++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 50be6dfdeb..020ceade94 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2094,6 +2094,8 @@ enum wxHitTest #define wxSIZE_NO_ADJUSTMENTS 0x0008 /* Change the window position even if it seems to be already correct */ #define wxSIZE_FORCE 0x0010 +/* Emit size event even if size didn't change */ +#define wxSIZE_FORCE_EVENT 0x0020 /* ---------------------------------------------------------------------------- */ /* GDI descriptions */ diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 375f5c2824..3cd52cb4ae 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -480,10 +480,11 @@ void wxSizerItem::SetDimension( const wxPoint& pos_, const wxSize& size_ ) break; case Item_Window: + { m_window->SetSize(pos.x, pos.y, size.x, size.y, - wxSIZE_ALLOW_MINUS_ONE); + wxSIZE_ALLOW_MINUS_ONE|wxSIZE_FORCE_EVENT ); break; - + } case Item_Sizer: m_sizer->SetDimension(pos, size); break; diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 7fc84be912..830bfe0431 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2540,6 +2540,12 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags event.SetEventObject( this ); HandleWindowEvent( event ); } + } else + if (sizeFlags & wxSIZE_FORCE_EVENT) + { + wxSizeEvent event( wxSize(m_width,m_height), GetId() ); + event.SetEventObject( this ); + HandleWindowEvent( event ); } } diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 3707a1bad7..0caca386a9 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2007,6 +2007,12 @@ void wxWindowMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags) width == currentW && height == currentH && !(sizeFlags & wxSIZE_FORCE) ) { + if (sizeFlags & wxSIZE_FORCE_EVENT) + { + wxSizeEvent event( wxSize(width,height), GetId() ); + event.SetEventObject( this ); + HandleWindowEvent( event ); + } return; } diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 55aea5d815..b9817fbfc1 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -964,6 +964,13 @@ void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags) // TODO: REMOVE MacRepositionScrollBars() ; // we might have a real position shift + if (sizeFlags & wxSIZE_FORCE_EVENT) + { + wxSizeEvent event( wxSize(width,height), GetId() ); + event.SetEventObject( this ); + HandleWindowEvent( event ); + } + return; } -- 2.45.2