From: Julian Smart Date: Thu, 10 Feb 2005 15:33:51 +0000 (+0000) Subject: Applied patch [ 1113565 ] generic treectl multiselection X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/105fc244a190a98f1fc890281a35e0b206b9ab56 Applied patch [ 1113565 ] generic treectl multiselection git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 49ad284c2b..80e77ad8aa 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -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);