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
This commit is contained in:
Greg Ercolano
2009-12-08 08:39:31 +00:00
parent a657069cc5
commit 79cd1d2ccb
4 changed files with 31 additions and 1 deletions
+13
View File
@@ -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.
+2 -1
View File
@@ -64,6 +64,7 @@ Fl_Tree_Item::Fl_Tree_Item(const Fl_Tree_Prefs &prefs) {
_label_xywh[2] = 0;
_label_xywh[3] = 0;
_usericon = 0;
_userdata = 0;
_parent = 0;
}
@@ -103,7 +104,7 @@ Fl_Tree_Item::Fl_Tree_Item(const Fl_Tree_Item *o) {
_label_xywh[2] = o->_label_xywh[2];
_label_xywh[3] = o->_label_xywh[3];
_usericon = o->usericon();
_userdata = 0;
_userdata = o->user_data();
_parent = o->_parent;
}