From 8591268f8f318792178d5a2103a936e73965fdba Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 10 Nov 2000 16:44:27 +0000 Subject: [PATCH] applied patches from Mike Oliver to return click position for item (right) click events in treectrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treectlg.cpp | 2 ++ src/msw/treectrl.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 172514f0b6..5adea43870 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -2449,6 +2449,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, GetId()); nevent.m_item = (long) item; nevent.m_code = 0; + nevent.m_pointDrag = wxPoint(x, y); nevent.SetEventObject(this); GetEventHandler()->ProcessEvent(nevent); } @@ -2501,6 +2502,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() ); nevent.m_item = (long) item; nevent.m_code = 0; + nevent.m_pointDrag = wxPoint(x, y); nevent.SetEventObject( this ); GetEventHandler()->ProcessEvent( nevent ); } diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index d4995dd32f..58a84c5ac4 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -2225,6 +2225,9 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) eventType = (int)hdr->code == NM_DBLCLK ? wxEVT_COMMAND_TREE_ITEM_ACTIVATED : wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK; + + event.m_pointDrag.x = tvhti.pt.x; + event.m_pointDrag.y = tvhti.pt.y; } break;