don't update the tree unnecessarily in Expand/CollapseAllChildren() (patch 1809520)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-10-20 14:55:50 +00:00
parent c4b64a941e
commit 624f89c2d7
3 changed files with 18 additions and 3 deletions

View File

@@ -191,6 +191,7 @@ void wxTreeCtrlBase::ExpandAll()
void wxTreeCtrlBase::ExpandAllChildren(const wxTreeItemId& item)
{
Freeze();
// expand this item first, this might result in its children being added on
// the fly
if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) )
@@ -205,6 +206,7 @@ void wxTreeCtrlBase::ExpandAllChildren(const wxTreeItemId& item)
{
ExpandAllChildren(idCurr);
}
Thaw();
}
void wxTreeCtrlBase::CollapseAll()
@@ -217,6 +219,7 @@ void wxTreeCtrlBase::CollapseAll()
void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item)
{
Freeze();
// first (recursively) collapse all the children
wxTreeItemIdValue cookie;
for ( wxTreeItemId idCurr = GetFirstChild(item, cookie);
@@ -228,6 +231,7 @@ void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item)
// then collapse this element too
Collapse(item);
Thaw();
}
bool wxTreeCtrlBase::IsEmpty() const