From 32716d6b1e8a90cbe61b60994323029ec6abe85c Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 10 Jul 2010 09:44:45 +0000 Subject: Updated the Fluid IDE support for the current source file structure. Changed the Fl_Tree rendering code around a bit to make the tree more like MSWindows on Windows and more like Apple on Apple machines. I hope you guys like it. I also moved the function to load Fl_Preferences into an Fl_Tree into the Fl_Tree class where it belongs. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7672 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Tree.cxx | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'src/Fl_Tree.cxx') diff --git a/src/Fl_Tree.cxx b/src/Fl_Tree.cxx index 25d509c97..54b56ee63 100644 --- a/src/Fl_Tree.cxx +++ b/src/Fl_Tree.cxx @@ -7,6 +7,7 @@ #include #include +#include #define SCROLL_W 15 @@ -426,6 +427,56 @@ int Fl_Tree::select_only(Fl_Tree_Item *selitem, int docallback) { return(changed); } +/** + * Read a preferences database into the tree widget. + * A preferences database is a hierarchical collection of data which can be + * directly loaded into the tree view for inspection. + * \param[in] prefs the Fl_Preferences database + */ +void Fl_Tree::load(Fl_Preferences &prefs) +{ + int i, j, n, pn = strlen(prefs.path()); + char *p; + const char *path = prefs.path(); + if (strcmp(path, ".")==0) + path += 1; // root path is empty + else + path += 2; // child path starts with "./" + n = prefs.groups(); + for (i=0; i