]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix to allow proper positioning of child windows under OS/2 when auto layouts are...
authorDavid Webster <Dave.Webster@bhmi.com>
Fri, 30 Aug 2002 13:39:01 +0000 (13:39 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Fri, 30 Aug 2002 13:39:01 +0000 (13:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/panelg.cpp

index a67f7da2e556f1d644102a94c97377f9657f914f..0c7b85fb4255bf1de28292127cc773ba2c599b5d 100644 (file)
@@ -108,6 +108,33 @@ void wxPanel::OnSize(wxSizeEvent& event)
     if (GetAutoLayout())
         Layout();
 #endif // wxUSE_CONSTRAINTS
+
+    //
+    // Need to properly move child windows under OS/2
+    //
+#if defined(__WXPM__)
+    else
+    {
+        PSWP                        pWinSwp = GetSwp();
+
+        if (pWinSwp->cx == 0 && pWinSwp->cy == 0 && pWinSwp->fl == 0)
+            //
+            // Uninitialized
+            //
+            ::WinQueryWindowPos(GetHWND(), pWinSwp);
+        else
+        {
+            SWP                     vSwp;
+            int                     nYDiff;
+
+            ::WinQueryWindowPos(GetHWND(), &vSwp);
+            nYDiff = pWinSwp->cy - vSwp.cy;
+            MoveChildren(nYDiff);
+            pWinSwp->cx = vSwp.cx;
+            pWinSwp->cy = vSwp.cy;
+        }
+    }
+#endif
     event.Skip();
 }