Skip to content
Snippets Groups Projects
Commit 71420c75 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

add way to highlight attributes (for Francois)

parent 388cdc3b
No related branches found
No related tags found
No related merge requests found
...@@ -664,6 +664,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key, ...@@ -664,6 +664,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
if(copt.count("ShortHelp")) ps[0].setShortHelp(copt["ShortHelp"][0]); if(copt.count("ShortHelp")) ps[0].setShortHelp(copt["ShortHelp"][0]);
if(copt.count("Loop")) ps[0].setAttribute("Loop", copt["Loop"][0]); if(copt.count("Loop")) ps[0].setAttribute("Loop", copt["Loop"][0]);
if(copt.count("Graph")) ps[0].setAttribute("Graph", copt["Graph"][0]); if(copt.count("Graph")) ps[0].setAttribute("Graph", copt["Graph"][0]);
if(copt.count("Hightlight")) ps[0].setAttribute("Highlight", copt["Hightlight"][0]);
_onelabClient->set(ps[0]); _onelabClient->set(ps[0]);
#endif #endif
} }
......
...@@ -312,4 +312,6 @@ class inputRange : public Fl_Group { ...@@ -312,4 +312,6 @@ class inputRange : public Fl_Group {
std::string loop(){ return _loop_val; } std::string loop(){ return _loop_val; }
void graph(const std::string &val){ _set_graph_value(val); } void graph(const std::string &val){ _set_graph_value(val); }
std::string graph(){ return _graph_val; } std::string graph(){ return _graph_val; }
void color(int col){ _input->color(col); }
int color(){ return _input->color(); }
}; };
...@@ -967,7 +967,8 @@ void onelabWindow::rebuildTree() ...@@ -967,7 +967,8 @@ void onelabWindow::rebuildTree()
std::string label = numbers[i].getShortName(); std::string label = numbers[i].getShortName();
_tree->begin(); _tree->begin();
if(numbers[i].getChoices().size() == 2 && if(numbers[i].getChoices().size() == 2 &&
numbers[i].getChoices()[0] == 0 && numbers[i].getChoices()[1] == 1){ numbers[i].getChoices()[0] == 0 &&
numbers[i].getChoices()[1] == 1){
Fl_Check_Button *but = new Fl_Check_Button(1, 1, width, 1); Fl_Check_Button *but = new Fl_Check_Button(1, 1, width, 1);
_treeWidgets.push_back(but); _treeWidgets.push_back(but);
but->copy_label(label.c_str()); but->copy_label(label.c_str());
...@@ -987,6 +988,8 @@ void onelabWindow::rebuildTree() ...@@ -987,6 +988,8 @@ void onelabWindow::rebuildTree()
but->choices(numbers[i].getChoices()); but->choices(numbers[i].getChoices());
but->loop(numbers[i].getAttribute("Loop")); but->loop(numbers[i].getAttribute("Loop"));
but->graph(numbers[i].getAttribute("Graph")); but->graph(numbers[i].getAttribute("Graph"));
if(numbers[i].getAttribute("Highlight").size())
but->color(FL_YELLOW);
but->align(FL_ALIGN_RIGHT); but->align(FL_ALIGN_RIGHT);
but->callback(onelab_input_range_cb, (void*)n); but->callback(onelab_input_range_cb, (void*)n);
but->when(FL_WHEN_RELEASE | FL_WHEN_ENTER_KEY); but->when(FL_WHEN_RELEASE | FL_WHEN_ENTER_KEY);
...@@ -1030,6 +1033,8 @@ void onelabWindow::rebuildTree() ...@@ -1030,6 +1033,8 @@ void onelabWindow::rebuildTree()
menu.push_back(it); menu.push_back(it);
but->menubutton()->copy(&menu[0]); but->menubutton()->copy(&menu[0]);
but->value(strings[i].getValue().c_str()); but->value(strings[i].getValue().c_str());
if(strings[i].getAttribute("Highlight").size())
but->color(FL_YELLOW);
but->align(FL_ALIGN_RIGHT); but->align(FL_ALIGN_RIGHT);
but->callback(onelab_input_choice_cb, (void*)n); but->callback(onelab_input_choice_cb, (void*)n);
but->when(FL_WHEN_RELEASE | FL_WHEN_ENTER_KEY); but->when(FL_WHEN_RELEASE | FL_WHEN_ENTER_KEY);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment