From 2cc78389312dce6285d0d6b6e891d24372252ada Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 15 Jul 2001 19:36:25 +0000 Subject: [PATCH] Up-ported code to make tree item visible when programmatically selected. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treectlg.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 7a21820a80..2650eac81d 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -1485,6 +1485,17 @@ void wxGenericTreeCtrl::SelectItem(const wxTreeItemId& itemId, if ( GetEventHandler()->ProcessEvent( event ) && !event.IsAllowed() ) return; + wxTreeItemId parent = GetParent( itemId ); + while (parent.IsOk()) + { + if (!IsExpanded(parent)) + Expand( parent ); + + parent = GetParent( parent ); + } + + EnsureVisible( itemId ); + // ctrl press if (unselect_others) { -- 2.45.2