diff options
Diffstat (limited to 'FL/Fl_Tree_Item.H')
| -rw-r--r-- | FL/Fl_Tree_Item.H | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/FL/Fl_Tree_Item.H b/FL/Fl_Tree_Item.H index 674955cd4..b10b1e838 100644 --- a/FL/Fl_Tree_Item.H +++ b/FL/Fl_Tree_Item.H @@ -221,6 +221,21 @@ public: select(); // select if deselected } } + /// Select self and all children + /// Returns count of how many items were in the 'deselected' state, + /// ie. how many items were "changed". + /// + int select_all() { + int count = 0; + if ( ! is_selected() ) { + select(); + ++count; + } + for ( int t=0; t<children(); t++ ) { + count += child(t)->select_all(); + } + return(count); + } /// Disable the item's selection state. void deselect() { _selected = 0; |
