]> git.saurik.com Git - wxWidgets.git/commitdiff
don't generate assert when creating wxEVT_COMMAND_TREE_ITEM_MENU and the tree is...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Apr 2005 23:07:11 +0000 (23:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Apr 2005 23:07:11 +0000 (23:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/treectrl.cpp

index c09e85d2056eb470f7e73e5fc4f0e540be2b17aa..3272973786fd543840ca5bac1b3223fc1ea4445d 100644 (file)
@@ -2245,8 +2245,11 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
     if ( nMsg == WM_CONTEXTMENU )
     {
         wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_MENU, GetId() );
-        event.m_item = GetSelection();
+
+        // can't use GetSelection() here as it would assert in multiselect mode
+        event.m_item = wxTreeItemId(TreeView_GetSelection(GetHwnd()));
         event.SetEventObject( this );
+
         if ( GetEventHandler()->ProcessEvent(event) )
             processed = true;
         //else: continue with generating wxEVT_CONTEXT_MENU in base class code