]> git.saurik.com Git - wxWidgets.git/commitdiff
Refresh a window's non-client area when it is resized.
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Sat, 6 Aug 2005 01:41:18 +0000 (01:41 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Sat, 6 Aug 2005 01:41:18 +0000 (01:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mgl/window.cpp

index 17646da080aaadcb80abf7226bd424e3a63ac372..66913019c51d6b25a4951b7af9061608ace8d438 100644 (file)
@@ -939,7 +939,33 @@ void wxWindowMGL::DoGetClientSize(int *x, int *y) const
 
 void wxWindowMGL::DoMoveWindow(int x, int y, int width, int height)
 {
-    MGL_wmSetWindowPosition(GetHandle(), x, y, width, height);
+    wxRect rcClient(GetClientRect());
+
+    MGL_wmSetWindowPosition(m_wnd, x, y, width, height);
+
+    // When the origin or a window stays fixed but the height or width
+    // changes, invalidate the old and new non-client areas
+    if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) &&
+         m_wnd->x == x && m_wnd->y == y &&
+         rcClient.Intersect(GetClientRect()) != wxRect(0, 0, width, height) )
+    {
+        wxRegion rgn(0, 0, width, height);
+        rgn.Subtract(rcClient);
+
+        // This should work I think, but doesn't seem to:
+        //MGL_wmInvalidateWindowRegion(m_wnd, rgn.GetMGLRegion().rgnPointer());
+
+        // Use MGL_wmInvalidateWindowRect instead:
+        for (wxRegionIterator it(rgn); it; it++)
+        {
+            rect_t rc;
+            rc.left = it.GetX();
+            rc.top = it.GetY();
+            rc.right = rc.left + it.GetW();
+            rc.bottom = rc.top + it.GetH();
+            MGL_wmInvalidateWindowRect(m_wnd, &rc);
+        }
+    }
 }
 
 // set the size of the window: if the dimensions are positive, just use them,