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 --- src/Fl_Tree.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Fl_Tree.cxx') diff --git a/src/Fl_Tree.cxx b/src/Fl_Tree.cxx index e946ccaf5..4c3a99b14 100644 --- a/src/Fl_Tree.cxx +++ b/src/Fl_Tree.cxx @@ -347,6 +347,19 @@ int Fl_Tree::deselect_all(Fl_Tree_Item *item) { return(count); } +/// Select item and all its children. +/// If item is NULL, root() is used. +/// Handles calling redraw() if anything was changed. +/// Returns count of how many items were in the 'deselected' state, +/// ie. how many items were "changed". +/// +int Fl_Tree::select_all(Fl_Tree_Item *item) { + item = item ? item : root(); // NULL? use root() + int count = item->select_all(); + if ( count ) redraw(); // anything changed? cause redraw + return(count); +} + /// Select only this item. /// If item is NULL, root() is used. /// Handles calling redraw() if anything was changed. -- cgit v1.2.3