X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9fce43b779732a4970037f889b6bada60bbaf889..4e1ba52e0a6749942692db66e852994113eac1af:/src/generic/treectlg.cpp diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index c028be3798..80e77ad8aa 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -420,7 +420,7 @@ void wxTreeTextCtrl::Finish() wxPendingDelete.Append(this); m_finished = true; - + m_owner->SetFocusIgnoringChildren(); } } @@ -914,7 +914,7 @@ void wxGenericTreeCtrl::SetWindowStyle(const long styles) wxString wxGenericTreeCtrl::GetItemText(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), wxT(""), wxT("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), wxEmptyString, wxT("invalid tree item") ); return ((wxGenericTreeItem*) item.m_pItem)->GetText(); } @@ -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);