+ // If the item is already selected, do not update the selection.
+ // Multi-selections should not be cleared if a selected item is clicked.
+ if (!IsSelected(item))
+ {
+ DoSelectItem(item, true, false);
+ }
+
+ wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, this, item);
+ nevent.m_pointDrag = CalcScrolledPosition(pt);
+ event.Skip(!GetEventHandler()->ProcessEvent(nevent));
+
+ // Consistent with MSW (for now), send the ITEM_MENU *after*
+ // the RIGHT_CLICK event. TODO: This behavior may change.
+ wxTreeEvent nevent2(wxEVT_COMMAND_TREE_ITEM_MENU, this, item);
+ nevent2.m_pointDrag = CalcScrolledPosition(pt);
+ GetEventHandler()->ProcessEvent(nevent2);
+ }
+ else if ( event.MiddleDown() )
+ {
+ wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, this, item);