]> git.saurik.com Git - wxWidgets.git/commitdiff
fix wxMDIChidFrame::GetPosition() (patch 1626610)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 7 Jan 2007 16:42:00 +0000 (16:42 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 7 Jan 2007 16:42:00 +0000 (16:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/mdi.h
src/msw/mdi.cpp

index 2148e5ab0a1b330f3885c49d2655f0de80b5c077..3a45a535aa66e9fcb88821bcd21141f514bd2789 100644 (file)
@@ -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();
index 399c30e7a456c833d3558a4e69d9bf7e7fbd5793..874d23d937030967b177f2086fe715d8380c869b 100644 (file)
@@ -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;