diff --git a/Common/onelab.h b/Common/onelab.h index f7ac2b4defbe25dd2461143d09a0d1dcf339a9ab..36f4a69115aa5530bb4d9a0d4b8c13c6e9bf7fea 100644 --- a/Common/onelab.h +++ b/Common/onelab.h @@ -38,10 +38,9 @@ namespace onelab{ // The base parameter class. class parameter{ private: - // the name of the parameter, including its "path" in the - // parameter hierarchy. The path separator '/' can be followed by - // a number to force ordering (hence a parameter name cannot start - // with a number). + // the name of the parameter, including its '/'-separated path in + // the parameter hierarchy. Parameters or subpaths can start with + // numbers to force their relative ordering. std::string _name; // optional help strings std::string _shortHelp, _help; diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 79f648bd3b1e0719bc4c7040d9262b385f5d211c..9d417bd140408bcf88972b29f9f2f6f4b573efb2 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -772,13 +772,15 @@ void graphicWindow::resizeMessages(int dh) void graphicWindow::showMessages() { - int height = _savedMessageHeight; - if(height < 10) height = 100; - int maxh = win->h() - bottom->h(); - if(height > maxh) height = maxh / 2; - resizeMessages(height - browser->h()); - if(browser->h()) - browser->bottomline(browser->size()); + if(!win->shown()) return; + if(browser->h() < 10){ + int height = _savedMessageHeight; + if(height < 1) height = 100; + int maxh = win->h() - bottom->h(); + if(height > maxh) height = maxh / 2; + resizeMessages(height - browser->h()); + } + browser->bottomline(browser->size()); } void graphicWindow::hideMessages() diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp index 1deba9f52b332ac2e096c14c99c67449b02af475..dcb35cc64c88979db4c102d12c69e0c9b006664a 100644 --- a/Fltk/onelabWindow.cpp +++ b/Fltk/onelabWindow.cpp @@ -340,16 +340,22 @@ onelabWindow::onelabWindow(int deltaFontSize) static std::string getShortName(const std::string &name) { + std::string s = name; + // remove path std::string::size_type last = name.find_last_of('/'); if(last != std::string::npos) - return name.substr(last + 1); - return name; + s = name.substr(last + 1); + // remove starting numbers + while(s.size() && s[0] >= '0' && s[0] <= '9') + s = s.substr(1); + return s; } void onelabWindow::rebuildTree() { _tree->clear(); _tree->sortorder(FL_TREE_SORT_ASCENDING); + _tree->selectmode(FL_TREE_SELECT_NONE); for(unsigned int i = 0; i < _treeWidgets.size(); i++) Fl::delete_widget(_treeWidgets[i]); _treeWidgets.clear(); @@ -358,6 +364,7 @@ void onelabWindow::rebuildTree() onelab::server::instance()->get(numbers); for(unsigned int i = 0; i < numbers.size(); i++){ Fl_Tree_Item *n = _tree->add(numbers[i].getName().c_str()); + n->labelsize(FL_NORMAL_SIZE + 2); std::string label = numbers[i].getShortHelp(); if(label.empty()) label = getShortName(numbers[i].getName()); _tree->begin(); @@ -393,6 +400,7 @@ void onelabWindow::rebuildTree() onelab::server::instance()->get(strings); for(unsigned int i = 0; i < strings.size(); i++){ Fl_Tree_Item *n = _tree->add(strings[i].getName().c_str()); + n->labelsize(FL_NORMAL_SIZE + 2); std::string label = strings[i].getShortHelp(); if(label.empty()) label = getShortName(strings[i].getName()); _tree->begin(); @@ -408,8 +416,21 @@ void onelabWindow::rebuildTree() n->widget(but); _tree->end(); } + + for(Fl_Tree_Item *n = _tree->first(); n; n = n->next()){ + if(n->has_children()){ + _tree->begin(); + Fl_Box *but = new Fl_Box(1,1,IW,1); + but->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + _treeWidgets.push_back(but); + but->copy_label(getShortName(n->label()).c_str()); + n->widget(but); + _tree->end(); + } + } _tree->redraw(); } #endif +