From 3e85709e97f9d02b5b670fe92ecbfceb810438c6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 7 Jan 2007 16:42:00 +0000 Subject: [PATCH] fix wxMDIChidFrame::GetPosition() (patch 1626610) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/mdi.h | 1 + src/msw/mdi.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/wx/msw/mdi.h b/include/wx/msw/mdi.h index 2148e5ab0a..3a45a535aa 100644 --- a/include/wx/msw/mdi.h +++ b/include/wx/msw/mdi.h @@ -178,6 +178,7 @@ public: virtual bool Show(bool show = true); protected: + virtual void DoGetScreenPosition(int *x, int *y) const; virtual void DoGetPosition(int *x, int *y) const; virtual void DoSetClientSize(int width, int height); virtual void InternalSetMenuBar(); diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 399c30e7a4..874d23d937 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -859,6 +859,21 @@ void wxMDIChildFrame::DoSetClientSize(int width, int height) GetEventHandler()->ProcessEvent(event); } +// Unlike other wxTopLevelWindowBase, the mdi child's "GetPosition" is not the +// same as its GetScreenPosition +void wxMDIChildFrame::DoGetScreenPosition(int *x, int *y) const +{ + HWND hWnd = GetHwnd(); + + RECT rect; + ::GetWindowRect(hWnd, &rect); + if (x) + *x = rect.left; + if (y) + *y = rect.top; +} + + void wxMDIChildFrame::DoGetPosition(int *x, int *y) const { RECT rect; -- 2.45.2