]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
Remove my binary compatibility stuff from HEAD. Patch #1367014 used for reference.
[wxWidgets.git] / src / generic / treectlg.cpp
index 0daf721601d712f5c3b3b5b9b7b0c5deb16e2fc5..9f014eb75eff36c56379a85a5b24d0baee169ffd 100644 (file)
@@ -1858,8 +1858,6 @@ void wxGenericTreeCtrl::DoSelectItem(const wxTreeItemId& itemId,
         parent = GetItemParent( parent );
     }
 
-    EnsureVisible( itemId );
-
     // ctrl press
     if (unselect_others)
     {
@@ -1891,6 +1889,11 @@ void wxGenericTreeCtrl::DoSelectItem(const wxTreeItemId& itemId,
         RefreshLine( m_current );
     }
 
+    // This can cause idle processing to select the root
+    // if no item is selected, so it must be after the
+    // selection is set
+    EnsureVisible( itemId );
+
     event.SetEventType(wxEVT_COMMAND_TREE_SEL_CHANGED);
     GetEventHandler()->ProcessEvent( event );
 }