From: Kevin Hock Date: Fri, 28 Jan 2005 03:41:01 +0000 (+0000) Subject: Do not modify selection if right-click is on a selected item [patch 1111174] X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e8cf9a5f01ba57584f95934bdc3e18e06a4ae1cd?ds=inline Do not modify selection if right-click is on a selected item [patch 1111174] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31613 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 89df6f6b19..70a21e2ced 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -3177,7 +3177,13 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) if ( event.RightDown() ) { - DoSelectItem(item, true, false); + // 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, GetId()); nevent.m_item = item; nevent.m_pointDrag = CalcScrolledPosition(pt);