diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp index da18acb116d3521da2beaae26cc3d7c5e1820169..098ce28541d3adb452856c0e69ccb21631f4d14d 100644 --- a/Fltk/onelabGroup.cpp +++ b/Fltk/onelabGroup.cpp @@ -1277,17 +1277,6 @@ Fl_Widget *onelabGroup::_addParameterWidget(onelab::number &p, Fl_Tree_Item *n, char *path = strdup(getPath(n).c_str()); _treeStrings.push_back(path); - // non-editable value - if(p.getReadOnly()){ - outputRange *but = new outputRange(1, 1, ww, 1); - but->callback(onelab_number_output_range_cb, (void*)path); - but->value(p.getValue()); - but->align(FL_ALIGN_RIGHT); - but->graph(p.getAttribute("Graph")); - if(highlight) but->color(c); - return but; - } - // enumeration (display choices as value labels, not numbers) if(p.getChoices().size() && p.getChoices().size() == p.getValueLabels().size()){ @@ -1313,6 +1302,7 @@ Fl_Widget *onelabGroup::_addParameterWidget(onelab::number &p, Fl_Tree_Item *n, } but->callback(onelab_number_choice_cb, (void*)path); but->align(FL_ALIGN_RIGHT); + if(p.getReadOnly()) but->deactivate(); return but; } @@ -1326,6 +1316,18 @@ Fl_Widget *onelabGroup::_addParameterWidget(onelab::number &p, Fl_Tree_Item *n, but->value(p.getValue()); but->callback(onelab_number_check_button_cb, (void*)path); if(highlight) but->color(c); + if(p.getReadOnly()) but->deactivate(); + return but; + } + + // non-editable value + if(p.getReadOnly()){ + outputRange *but = new outputRange(1, 1, ww, 1); + but->callback(onelab_number_output_range_cb, (void*)path); + but->value(p.getValue()); + but->align(FL_ALIGN_RIGHT); + but->graph(p.getAttribute("Graph")); + if(highlight) but->color(c); return but; }