From: Vadim Zeitlin Date: Thu, 6 Sep 2001 20:07:32 +0000 (+0000) Subject: set mouse position for COL_CLICK event X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/651d7a1ff84fabae7da9455c4fcf81f3b83f7c9a set mouse position for COL_CLICK event git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index b556a2e8eb..38ff1e693c 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2044,6 +2044,14 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event ) : wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, parent->GetId() ); le.SetEventObject( parent ); + le.m_pointDrag = event.GetPosition(); + + // the position should be relative to the parent window, not + // this one for compatibility with MSW and common sense: the + // user code doesn't know anything at all about this header + // window, so why should it get positions relative to it? + le.m_pointDrag.y -= GetSize().y; + le.m_col = m_column; parent->GetEventHandler()->ProcessEvent( le ); }