mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-28 16:24:27 +02:00
Add expand all capacity into TreeView class
This commit is contained in:
parent
998ad2aa87
commit
fbde7d2188
@ -263,7 +263,7 @@ void TreeView::cleanSubEntries(HTREEITEM hTreeItem)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TreeView::foldRecursively(HTREEITEM hParentItem) const
|
void TreeView::foldExpandRecursively(HTREEITEM hParentItem, bool isFold) const
|
||||||
{
|
{
|
||||||
if (!hParentItem)
|
if (!hParentItem)
|
||||||
return;
|
return;
|
||||||
@ -272,19 +272,33 @@ void TreeView::foldRecursively(HTREEITEM hParentItem) const
|
|||||||
|
|
||||||
for (; hItem != NULL; hItem = getNextSibling(hItem))
|
for (; hItem != NULL; hItem = getNextSibling(hItem))
|
||||||
{
|
{
|
||||||
foldRecursively(hItem);
|
foldExpandRecursively(hItem, isFold);
|
||||||
fold(hItem);
|
if (isFold)
|
||||||
|
{
|
||||||
|
fold(hItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
expand(hItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TreeView::foldAll() const
|
void TreeView::foldExpandAll(bool isFold) const
|
||||||
{
|
{
|
||||||
for (HTREEITEM tvProj = getRoot();
|
for (HTREEITEM tvProj = getRoot();
|
||||||
tvProj != NULL;
|
tvProj != NULL;
|
||||||
tvProj = getNextSibling(tvProj))
|
tvProj = getNextSibling(tvProj))
|
||||||
{
|
{
|
||||||
foldRecursively(tvProj);
|
foldExpandRecursively(tvProj, isFold);
|
||||||
fold(tvProj);
|
if (isFold)
|
||||||
|
{
|
||||||
|
fold(tvProj);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
expand(tvProj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,8 +88,16 @@ public:
|
|||||||
TreeView_Expand(_hSelf, hItem, TVE_COLLAPSE);
|
TreeView_Expand(_hSelf, hItem, TVE_COLLAPSE);
|
||||||
};
|
};
|
||||||
|
|
||||||
void foldRecursively(HTREEITEM hItem) const;
|
void foldExpandRecursively(HTREEITEM hItem, bool isFold) const;
|
||||||
void foldAll() const;
|
void foldExpandAll(bool isFold) const;
|
||||||
|
|
||||||
|
void foldAll() const {
|
||||||
|
foldExpandAll(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
void expandAll() const {
|
||||||
|
foldExpandAll(false);
|
||||||
|
};
|
||||||
|
|
||||||
void toggleExpandCollapse(HTREEITEM hItem) const {
|
void toggleExpandCollapse(HTREEITEM hItem) const {
|
||||||
TreeView_Expand(_hSelf, hItem, TVE_TOGGLE);
|
TreeView_Expand(_hSelf, hItem, TVE_TOGGLE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user