]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
removed assert which could be provoked by correct code
[wxWidgets.git] / src / generic / treectlg.cpp
index 7a21820a808d0bed1771f73ddfb2b3a3ff25f8c7..2650eac81d69d983d4f94be744644f1b4768e1b9 100644 (file)
@@ -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)
     {