From 79cd1d2ccb62f22adf8b1ed4e8b5dfb5dea845bc Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Tue, 8 Dec 2009 08:39:31 +0000 Subject: Small fixed to SebHoll's user_data() mods (init + copy ctor), added select_all() to Fl_Tree and Fl_Tree_Item. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6957 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Tree_Item.H | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'FL/Fl_Tree_Item.H') 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; tselect_all(); + } + return(count); + } /// Disable the item's selection state. void deselect() { _selected = 0; -- cgit v1.2.3