From 84a6b8590b1e95e0325727059660508e4cf4df05 Mon Sep 17 00:00:00 2001 From: "Unknown (CR)" Date: Wed, 13 Oct 1999 17:05:17 +0000 Subject: [PATCH] Added item clicks event support git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3964 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/treectrl.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index f7ac36c718..8517884f18 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1341,6 +1341,23 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) switch ( hdr->code ) { + case NM_RCLICK: + { + if ( wxControl::MSWOnNotify(idCtrl, lParam, result) ) + return TRUE; + + TV_HITTESTINFO tvhti; + ::GetCursorPos(&(tvhti.pt)); + ::ScreenToClient(GetHwnd(),&(tvhti.pt)); + if(TreeView_HitTest(GetHwnd(),&tvhti)!=NULL) { + if(tvhti.flags & TVHT_ONITEM) { + event.m_item = (WXHTREEITEM) tvhti.hItem; + eventType=wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK; + } + } + break; + } + case TVN_BEGINDRAG: eventType = wxEVT_COMMAND_TREE_BEGIN_DRAG; // fall through -- 2.45.2