X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef70f0ecdbc4268923e132b257c95e8a2525f4ca..b9b3393e48488d37af26cd833ca435b87bc24d73:/src/generic/treectlg.cpp 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) {