]> git.saurik.com Git - wxWidgets.git/commitdiff
Add comment to ITEM_MENU reflecting why it's the best choice for context menus in...
authorKevin Hock <hockkn@yahoo.com>
Sat, 21 May 2005 03:03:40 +0000 (03:03 +0000)
committerKevin Hock <hockkn@yahoo.com>
Sat, 21 May 2005 03:03:40 +0000 (03:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/treectrl/treetest.cpp

index 4f3c978c76ef12d9d9e2d5537f04816320957853..eb66c8d47da4f284f67ba1931c182d0975a7e481 100644 (file)
@@ -144,6 +144,9 @@ BEGIN_EVENT_TABLE(MyTreeCtrl, wxTreeCtrl)
 
     // so many differents ways to handle right mouse button clicks...
     EVT_CONTEXT_MENU(MyTreeCtrl::OnContextMenu)
+    // EVT_TREE_ITEM_MENU is the preferred event for creating context menus
+    // on a tree control, because it includes the point of the click or item,
+    // meaning that no additional placement calculations are required.
     EVT_TREE_ITEM_MENU(TreeTest_Ctrl, MyTreeCtrl::OnItemMenu)
     EVT_TREE_ITEM_RIGHT_CLICK(TreeTest_Ctrl, MyTreeCtrl::OnItemRClick)