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

- avoid querying menu/browser->value() when it doesn't make sense
- fixed out-of-sync option panel when removing views
parent c78f8dc7
No related branches found
No related tags found
No related merge requests found
// $Id: Options.cpp,v 1.201 2004-11-08 23:28:47 geuzaine Exp $
// $Id: Options.cpp,v 1.202 2004-11-09 02:14:19 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -5306,6 +5306,8 @@ double opt_view_external_view(OPT_ARGS_NUM)
int item = v->ExternalViewIndex + 1;
if(item > -1 && item < WID->view_choice[10]->size()-1)
WID->view_choice[10]->value(item);
else
WID->view_choice[10]->value(0);
}
#endif
return v->ExternalViewIndex;
......
// $Id: GUI.cpp,v 1.375 2004-11-08 23:28:47 geuzaine Exp $
// $Id: GUI.cpp,v 1.376 2004-11-09 02:14:19 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -1441,23 +1441,23 @@ void GUI::reset_option_browser()
sprintf(str, "View [%d]", i);
opt_browser->add(str);
}
if(select <= opt_browser->size())
opt_browser->value(select);
int item = (select <= opt_browser->size()) ? select : opt_browser->size();
opt_browser->value(item);
if(opt_window->shown())
options_browser_cb(NULL, NULL);
}
void GUI::reset_external_view_list()
{
char str[32];
int select = view_choice[10]->value();
view_choice[10]->clear();
view_choice[10]->add("Self");
for(int i = 0; i < List_Nbr(CTX.post.list); i++) {
sprintf(str, "View [%d]", i);
view_choice[10]->add(str, 0, NULL);
}
// warning: Fl_Choice::size() returns number of items+1
if(select < view_choice[10]->size() - 1)
view_choice[10]->value(select);
if(view_number >= 0)
opt_view_external_view(view_number, GMSH_GUI, 0);
}
void GUI::check_rotation_center_button()
......@@ -1509,7 +1509,11 @@ void GUI::create_option_window()
opt_browser = new Fl_Hold_Browser(WB, WB, L - WB, height - 3 * WB - BH);
opt_browser->has_scrollbar(Fl_Browser_::VERTICAL);
reset_option_browser();
opt_browser->add("General");
opt_browser->add("Geometry");
opt_browser->add("Mesh");
opt_browser->add("Solver");
opt_browser->add("Post-processing");
opt_browser->callback(options_browser_cb);
opt_browser->value(1);
opt_window->label("Options - General");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment