From 59cd3bbd6c35a797b3ddbd268a49cfc844b2b639 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 3 Jan 2012 00:44:47 +0000 Subject: [PATCH] Fix child selection in multi-selection generic wxTreeCtrl. The children which are not currently shown on the screen shouldn't be affected by Shift-selecting in multi-selection control. Closes #1312. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/generic/treectlg.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index 29b3f0d36a..932f9f4c10 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -463,6 +463,7 @@ All (GUI): - Improve row/column selection modes in wxGrid (joostn). - Allow using wxEVT_UPDATE_UI with wxRibbonButtonBar (Emilien Kia). - Add wxRibbonButtonBar::InsertXXXButton() methods (Emilien Kia). +- Fix multiple item selection in generic wxTreeCtrl (Igor Korot). GTK: diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 7415dafd50..e24ce063b3 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -2054,7 +2054,8 @@ wxGenericTreeCtrl::TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, if (crt_item==last_item) return true; - if (crt_item->HasChildren()) + // We should leave the not shown children of collapsed items alone. + if (crt_item->HasChildren() && crt_item->IsExpanded()) { wxArrayGenericTreeItems& children = crt_item->GetChildren(); size_t count = children.GetCount();