Fix getting position of wxPopupWindow in wxMSW.
Don't offset the returned values by the parent window origin unnecessarily: as popup windows are created as children of the desktop window in wxMSW, their coordinates are already expressed in screen coordinate system (which is exactly the same as display window coordinate system) and we must not try to translate them to it once again, this is completely wrong and was probably a left over from earlier wxPopupWindow implementation in which it wasn't created as a child of desktop. Closes #4440. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -35,9 +35,6 @@ public:
|
|||||||
virtual WXHWND MSWGetParent() const;
|
virtual WXHWND MSWGetParent() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// popups handle the position like wxTopLevelWindow, not wxWindow
|
|
||||||
virtual void DoGetPosition(int *x, int *y) const;
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow)
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -47,16 +47,6 @@ bool wxPopupWindow::Create(wxWindow *parent, int flags)
|
|||||||
flags | wxPOPUP_WINDOW);
|
flags | wxPOPUP_WINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPopupWindow::DoGetPosition(int *x, int *y) const
|
|
||||||
{
|
|
||||||
// the position of a "top level" window such as this should be in
|
|
||||||
// screen coordinates, not in the client ones which MSW gives us
|
|
||||||
// (because we are a child window)
|
|
||||||
wxPopupWindowBase::DoGetPosition(x, y);
|
|
||||||
|
|
||||||
GetParent()->ClientToScreen(x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
WXDWORD wxPopupWindow::MSWGetStyle(long flags, WXDWORD *exstyle) const
|
WXDWORD wxPopupWindow::MSWGetStyle(long flags, WXDWORD *exstyle) const
|
||||||
{
|
{
|
||||||
// we only honour the border flags, the others don't make sense for us
|
// we only honour the border flags, the others don't make sense for us
|
||||||
|
Reference in New Issue
Block a user