don't generate assert when creating wxEVT_COMMAND_TREE_ITEM_MENU and the tree is in multi select mode (replaces patch 1177263)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2005-04-05 23:07:11 +00:00
parent c545c23009
commit 9ea0f2c57f

View 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