]> git.saurik.com Git - wxWidgets.git/commitdiff
set mouse position for COL_CLICK event
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 6 Sep 2001 20:07:32 +0000 (20:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 6 Sep 2001 20:07:32 +0000 (20:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index b556a2e8eb27fe50c09d56080533cb22728ca228..38ff1e693c40674e2d09770bf763ca54803abf1e 100644 (file)
@@ -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 );
             }