]> git.saurik.com Git - wxWidgets.git/commitdiff
Do not modify selection if right-click is on a selected item [patch 1111174]
authorKevin Hock <hockkn@yahoo.com>
Fri, 28 Jan 2005 03:41:01 +0000 (03:41 +0000)
committerKevin Hock <hockkn@yahoo.com>
Fri, 28 Jan 2005 03:41:01 +0000 (03:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31613 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 89df6f6b1954038a6c6f6243cbcb9bb978c1ef38..70a21e2ceda6516fac91c03071281faa871eeae9 100644 (file)
@@ -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);