File tree Expand file tree Collapse file tree 2 files changed +30
-8
lines changed
PowerEditor/src/WinControls/ProjectPanel Expand file tree Collapse file tree 2 files changed +30
-8
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ void TreeView::cleanSubEntries(HTREEITEM hTreeItem)
263263}
264264}
265265
266- void TreeView::foldRecursively (HTREEITEM hParentItem) const
266+ void TreeView::foldExpandRecursively (HTREEITEM hParentItem, bool isFold ) const
267267{
268268if (!hParentItem)
269269return ;
@@ -272,19 +272,33 @@ void TreeView::foldRecursively(HTREEITEM hParentItem) const
272272
273273for (; hItem != NULL ; hItem = getNextSibling (hItem))
274274{
275- foldRecursively (hItem);
276- fold (hItem);
275+ foldExpandRecursively (hItem, isFold);
276+ if (isFold)
277+ {
278+ fold (hItem);
279+ }
280+ else
281+ {
282+ expand (hItem);
283+ }
277284}
278285}
279286
280- void TreeView::foldAll ( ) const
287+ void TreeView::foldExpandAll ( bool isFold ) const
281288{
282289for (HTREEITEM tvProj = getRoot ();
283290tvProj != NULL ;
284291tvProj = getNextSibling (tvProj))
285292{
286- foldRecursively (tvProj);
287- fold (tvProj);
293+ foldExpandRecursively (tvProj, isFold);
294+ if (isFold)
295+ {
296+ fold (tvProj);
297+ }
298+ else
299+ {
300+ expand (tvProj);
301+ }
288302}
289303}
290304
Original file line number Diff line number Diff line change @@ -88,8 +88,16 @@ class TreeView : public Window {
8888TreeView_Expand (_hSelf, hItem, TVE_COLLAPSE);
8989};
9090
91- void foldRecursively (HTREEITEM hItem) const ;
92- void foldAll () const ;
91+ void foldExpandRecursively (HTREEITEM hItem, bool isFold) const ;
92+ void foldExpandAll (bool isFold) const ;
93+
94+ void foldAll () const {
95+ foldExpandAll (true );
96+ };
97+
98+ void expandAll () const {
99+ foldExpandAll (false );
100+ };
93101
94102void toggleExpandCollapse (HTREEITEM hItem) const {
95103TreeView_Expand (_hSelf, hItem, TVE_TOGGLE);
You can’t perform that action at this time.
0 commit comments