]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1113565 ] generic treectl multiselection
authorJulian Smart <julian@anthemion.co.uk>
Thu, 10 Feb 2005 15:33:51 +0000 (15:33 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 10 Feb 2005 15:33:51 +0000 (15:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 49ad284c2bb19ccb15a3c064cadda8ba86564197..80e77ad8aa2aa0bb48e7d4ec1eb1de2711791445 100644 (file)
@@ -2637,7 +2637,7 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
     bool is_multiple, extended_select, unselect_others;
     EventFlagsToSelType(GetWindowStyleFlag(),
                         event.ShiftDown(),
-                        event.ControlDown(),
+                        event.CmdDown(),
                         is_multiple, extended_select, unselect_others);
 
     // + : Expand
@@ -3225,7 +3225,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
                 size_t count = GetSelections(selections);
 
                 if (count > 1 &&
-                    !event.ControlDown() &&
+                    !event.CmdDown() &&
                     !event.ShiftDown())
                 {
                     DoSelectItem(item, true, false);
@@ -3279,14 +3279,14 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
             // user clicked outside of the present selection.
             // otherwise, perform the deselection on mouse-up.
             // this allows multiple drag and drop to work.
-
-            if (!IsSelected(item))
+            // but if Cmd is down, toggle selection of the clicked item
+            if (!IsSelected(item) || event.CmdDown())
             {
                 // how should the selection work for this event?
                 bool is_multiple, extended_select, unselect_others;
                 EventFlagsToSelType(GetWindowStyleFlag(),
                                     event.ShiftDown(),
-                                    event.ControlDown(),
+                                    event.CmdDown(),
                                     is_multiple, extended_select, unselect_others);
 
                 DoSelectItem(item, unselect_others, extended_select);