]> git.saurik.com Git - wxWidgets.git/commitdiff
Override AdjustForParentClientOrigin() in wxNonOwnedWindow to do nothing.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 5 Mar 2012 13:00:55 +0000 (13:00 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 5 Mar 2012 13:00:55 +0000 (13:00 +0000)
No real changes, just replace an IsTopLevel() check in the base class
implementation of AdjustForParentClientOrigin() and override it for all top
level windows in wxNonOwnedWindow instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70812 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/nonownedwnd.h
src/common/wincmn.cpp

index a959b3472c4961d46477f21b953968911d7ca92f..536b55cef4c79442efb0fbe77814ebe655ccaa72 100644 (file)
@@ -58,6 +58,17 @@ public:
     }
 #endif // wxUSE_GRAPHICS_CONTEXT
 
+
+    // Overridden base class methods.
+    // ------------------------------
+
+    virtual void AdjustForParentClientOrigin(int& WXUNUSED(x), int& WXUNUSED(y),
+                                             int WXUNUSED(sizeFlags) = 0) const
+    {
+        // Non owned windows positions don't need to be adjusted for parent
+        // client area origin so simply do nothing here.
+    }
+
 protected:
     virtual bool DoClearShape()
     {
index 97bbf4fcb14bd8e7b01ef81054addc67288e6145..ecc4aa88320254cabed2bb34b32af847d3c00f49 100644 (file)
@@ -2607,17 +2607,12 @@ void wxWindowBase::GetPositionConstraint(int *x, int *y) const
 
 void wxWindowBase::AdjustForParentClientOrigin(int& x, int& y, int sizeFlags) const
 {
-    // don't do it for the dialogs/frames - they float independently of their
-    // parent
-    if ( !IsTopLevel() )
+    wxWindow *parent = GetParent();
+    if ( !(sizeFlags & wxSIZE_NO_ADJUSTMENTS) && parent )
     {
-        wxWindow *parent = GetParent();
-        if ( !(sizeFlags & wxSIZE_NO_ADJUSTMENTS) && parent )
-        {
-            wxPoint pt(parent->GetClientAreaOrigin());
-            x += pt.x;
-            y += pt.y;
-        }
+        wxPoint pt(parent->GetClientAreaOrigin());
+        x += pt.x;
+        y += pt.y;
     }
 }