]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed hidden root expansion in extreme usage case
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 30 Jun 2002 22:15:10 +0000 (22:15 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 30 Jun 2002 22:15:10 +0000 (22:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 6d56dc596d4a7b890567776445d9d86f49c78deb..35f2d96708cf24593f940494d47de8d11c2f8f34 100644 (file)
@@ -835,9 +835,17 @@ size_t wxGenericTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recurs
 
 void wxGenericTreeCtrl::SetWindowStyle(const long styles)
 {
-        // right now, just sets the styles.  Eventually, we may
-        // want to update the inherited styles, but right now
-        // none of the parents has updatable styles
+    if (!HasFlag(wxTR_HIDE_ROOT) && (styles & wxTR_HIDE_ROOT))
+    {
+        // if we will hide the root, make sure children are visible
+        m_anchor->SetHasPlus();
+        m_anchor->Expand();
+        CalculatePositions();
+    }
+
+    // right now, just sets the styles.  Eventually, we may
+    // want to update the inherited styles, but right now
+    // none of the parents has updatable styles
     m_windowStyle = styles;
     m_dirty = TRUE;
 }