]> git.saurik.com Git - wxWidgets.git/commitdiff
Added right/middle click item support
authorUnknown (CR) <nobody@localhost>
Wed, 13 Oct 1999 17:03:24 +0000 (17:03 +0000)
committerUnknown (CR) <nobody@localhost>
Wed, 13 Oct 1999 17:03:24 +0000 (17:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3962 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectrl.cpp

index edfceee22510faac3b9bebe825105b8b96753d04..95744550b790cc7d7db98a9f0b82f8306f09c333 100644 (file)
@@ -1901,7 +1901,7 @@ void wxTreeCtrl::OnRenameAccept()
 
 void wxTreeCtrl::OnMouse( wxMouseEvent &event )
 {
-    if ( !(event.LeftUp() || event.LeftDClick() || event.Dragging()) ) return;
+    if ( !(event.LeftUp() || event.RightDown() || event.LeftDClick() || event.Dragging()) ) return;
 
     if ( !m_anchor ) return;
 
@@ -1939,6 +1939,15 @@ void wxTreeCtrl::OnMouse( wxMouseEvent &event )
 
     if (item == NULL) return;  /* we hit the blank area */
 
+    if (event.RightDown()) { 
+       wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK,GetId());
+       nevent.m_item=item;
+       nevent.m_code=0;
+       nevent.SetEventObject(this);
+       GetEventHandler()->ProcessEvent(nevent);
+       return;
+    }
+
     if (event.LeftUp() && (item == m_current) &&
         (flags & wxTREE_HITTEST_ONITEMLABEL) &&
         HasFlag(wxTR_EDIT_LABELS) )