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

allow onelab enumerations with unsorted keys

parent 904a56f3
No related branches found
No related tags found
No related merge requests found
...@@ -95,7 +95,7 @@ opt(WRAP_PYTHON "Enable generation of Python wrappers" OFF) ...@@ -95,7 +95,7 @@ opt(WRAP_PYTHON "Enable generation of Python wrappers" OFF)
set(GMSH_MAJOR_VERSION 2) set(GMSH_MAJOR_VERSION 2)
set(GMSH_MINOR_VERSION 9) set(GMSH_MINOR_VERSION 9)
set(GMSH_PATCH_VERSION 0) set(GMSH_PATCH_VERSION 1)
set(GMSH_EXTRA_VERSION "" CACHE STRING "Gmsh extra version string") set(GMSH_EXTRA_VERSION "" CACHE STRING "Gmsh extra version string")
set(GMSH_VERSION "${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}") set(GMSH_VERSION "${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}")
......
...@@ -706,10 +706,10 @@ Fl_Widget *onelabGroup::_addParameterWidget(onelab::number &p, int ww, int hh, ...@@ -706,10 +706,10 @@ Fl_Widget *onelabGroup::_addParameterWidget(onelab::number &p, int ww, int hh,
p.getChoices().size() == p.getValueLabels().size()){ p.getChoices().size() == p.getValueLabels().size()){
Fl_Choice *but = new Fl_Choice(1, 1, ww, hh); Fl_Choice *but = new Fl_Choice(1, 1, ww, hh);
std::vector<Fl_Menu_Item> menu; std::vector<Fl_Menu_Item> menu;
std::vector<double> choices = p.getChoices();
std::map<double, std::string> labels(p.getValueLabels()); std::map<double, std::string> labels(p.getValueLabels());
for(std::map<double, std::string>::iterator it = labels.begin(); for(unsigned int i = 0; i < choices.size(); i++){
it != labels.end(); it++){ char *str = strdup(labels[choices[i]].c_str());
char *str = strdup(it->second.c_str());
_treeStrings.push_back(str); _treeStrings.push_back(str);
Fl_Menu_Item menuItem = {str, 0, 0, 0, 0}; Fl_Menu_Item menuItem = {str, 0, 0, 0, 0};
if(highlight) menuItem.labelcolor(c); if(highlight) menuItem.labelcolor(c);
...@@ -718,8 +718,8 @@ Fl_Widget *onelabGroup::_addParameterWidget(onelab::number &p, int ww, int hh, ...@@ -718,8 +718,8 @@ Fl_Widget *onelabGroup::_addParameterWidget(onelab::number &p, int ww, int hh,
Fl_Menu_Item it = {0}; Fl_Menu_Item it = {0};
menu.push_back(it); menu.push_back(it);
but->copy(&menu[0]); but->copy(&menu[0]);
for(unsigned int i = 0; i < p.getChoices().size(); i++){ for(unsigned int i = 0; i < choices.size(); i++){
if(p.getValue() == p.getChoices()[i]){ if(p.getValue() == choices[i]){
but->value(i); but->value(i);
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment