]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wxSIZE_FORCE_EVENT and use is from wxSizerItem::SetDimension
authorRobert Roebling <robert@roebling.de>
Fri, 30 Jan 2009 20:10:44 +0000 (20:10 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 30 Jan 2009 20:10:44 +0000 (20:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h
src/common/sizer.cpp
src/gtk/window.cpp
src/msw/window.cpp
src/osx/window_osx.cpp

index 50be6dfdeb46b1a6784c8c8f52519d454c9b4897..020ceade94bd6cde72098e51a1f22d0c42c0b945 100644 (file)
@@ -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 */
index 375f5c282496db1794aa40089a415a9e6fc64ed1..3cd52cb4ae1d5c4c8b2ecdca143aea13d81ceb46 100644 (file)
@@ -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;
index 7fc84be9129a2b9e789681eb16bf3efd7536a2d6..830bfe04318411bc41b4de931919a32dd3bd412b 100644 (file)
@@ -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 );
     }
 }
 
index 3707a1bad723a588ff0669d463198f6b6bfe16e9..0caca386a952d5dff425cf371737b06465ea1d6f 100644 (file)
@@ -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;
     }
 
index 55aea5d8151fb0a20fe11f81a7db10078bec1d0e..b9817fbfc108ed1af488756b191a5dcdbbfe0a20 100644 (file)
@@ -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;
     }