diff --git a/include/wx/nonownedwnd.h b/include/wx/nonownedwnd.h index a959b3472c..536b55cef4 100644 --- a/include/wx/nonownedwnd.h +++ b/include/wx/nonownedwnd.h @@ -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() { diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 97bbf4fcb1..ecc4aa8832 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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; } }