From: Vadim Zeitlin Date: Wed, 22 Oct 2003 08:43:28 +0000 (+0000) Subject: account for parent area origin when creating controls and windows X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4e9d23cdae1f6d87c2915910a2998bce9c2e6e71 account for parent area origin when creating controls and windows git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 4d4c0e159f..df2d8b1109 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -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 diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 65006bc51b..610126c65c 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2994,6 +2994,8 @@ bool wxWindowMSW::MSWGetCreateWindowCoords(const wxPoint& pos, nonDefault = TRUE; } + AdjustForParentClientOrigin(x, y); + return nonDefault; }