]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/treebase.cpp
Remove apparently erroneous -1 from DrawBitmap() in wxMSW wxGC code.
[wxWidgets.git] / src / common / treebase.cpp
index c8b990630793295f3b6653bc049e5e4a40005742..483360b4724a6e8401625c5ca14113b6cb9b8781 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        treebase.cpp
+// Name:        src/common/treebase.cpp
 // Purpose:     Base wxTreeCtrl classes
 // Author:      Julian Smart
 // Created:     01/02/97
@@ -29,6 +29,8 @@
 #include "wx/treectrl.h"
 #include "wx/imaglist.h"
 
+extern WXDLLEXPORT_DATA(const char) wxTreeCtrlNameStr[] = "treeCtrl";
+
 // ----------------------------------------------------------------------------
 // events
 // ----------------------------------------------------------------------------
@@ -321,8 +323,10 @@ void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item)
         CollapseAllChildren(idCurr);
     }
 
-    // then collapse this element too
-    Collapse(item);
+    // then collapse this element too unless it's the hidden root which can't
+    // be collapsed
+    if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) )
+        Collapse(item);
     Thaw();
 }