Applied #11106: wxGenericDirCtrl can get into a state where it will no longer expand
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -785,19 +785,12 @@ void wxGenericDirCtrl::CollapseDir(wxTreeItemId parentId)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
data->m_isExpanded = false;
|
data->m_isExpanded = false;
|
||||||
wxTreeItemIdValue cookie;
|
|
||||||
/* Workaround because DeleteChildren has disapeared (why?) and
|
m_treeCtrl->Freeze();
|
||||||
* CollapseAndReset doesn't work as advertised (deletes parent too) */
|
|
||||||
child = m_treeCtrl->GetFirstChild(parentId, cookie);
|
|
||||||
while (child.IsOk())
|
|
||||||
{
|
|
||||||
m_treeCtrl->Delete(child);
|
|
||||||
/* Not GetNextChild below, because the cookie mechanism can't
|
|
||||||
* handle disappearing children! */
|
|
||||||
child = m_treeCtrl->GetFirstChild(parentId, cookie);
|
|
||||||
}
|
|
||||||
if (parentId != m_treeCtrl->GetRootItem())
|
if (parentId != m_treeCtrl->GetRootItem())
|
||||||
m_treeCtrl->Collapse(parentId);
|
m_treeCtrl->CollapseAndReset(parentId);
|
||||||
|
m_treeCtrl->DeleteChildren(parentId);
|
||||||
|
m_treeCtrl->Thaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
|
void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
|
||||||
|
Reference in New Issue
Block a user