]> git.saurik.com Git - wxWidgets.git/commitdiff
account for parent area origin when creating controls and windows
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 22 Oct 2003 08:43:28 +0000 (08:43 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 22 Oct 2003 08:43:28 +0000 (08:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/control.cpp
src/msw/window.cpp

index 4d4c0e159f080617c6f68e9e42f3155527f3b4bd..df2d8b11095b5a7d491ca688c8593dfa1922379d 100644 (file)
@@ -106,11 +106,15 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
         style |= WS_VISIBLE;
     }
 
+    // choose the position for the control
     int x = pos.x == -1 ? 0 : pos.x,
         y = pos.y == -1 ? 0 : pos.y,
         w = size.x == -1 ? 0 : size.x,
         h = size.y == -1 ? 0 : size.y;
 
+    // ... and adjust it to account for ap ossible parent frames toolbar
+    AdjustForParentClientOrigin(x, y);
+
     m_hWnd = (WXHWND)::CreateWindowEx
                        (
                         exstyle,            // extended style
index 65006bc51b3e810af1bcf06ae2de389c5baff2d4..610126c65c0c650395cc1705991d79076c940049 100644 (file)
@@ -2994,6 +2994,8 @@ bool wxWindowMSW::MSWGetCreateWindowCoords(const wxPoint& pos,
         nonDefault = TRUE;
     }
 
+    AdjustForParentClientOrigin(x, y);
+
     return nonDefault;
 }