1
0
Fork 0

Erik Hofman:

It turned out that pui required the submenu structure to be declared
backwards, which I didn't notice the first time.
This commit is contained in:
curt 2002-09-05 21:58:24 +00:00
parent 83179a5daf
commit 6bcef49afc

View file

@ -116,21 +116,22 @@ void initMenu()
SGPropertyNode *call = option[i]->getNode("call"); SGPropertyNode *call = option[i]->getNode("call");
SGPropertyNode *sep = option[i]->getNode("seperator"); SGPropertyNode *sep = option[i]->getNode("seperator");
int pos = option.size()-i-1;
if (sep) if (sep)
Menu[h].submenu[i] = strdup("----------"); Menu[h].submenu[pos] = strdup("----------");
else if (call && strcmp(call->getStringValue(), "")) else if (call && strcmp(call->getStringValue(), ""))
Menu[h].submenu[i] = strdup(name->getStringValue()); Menu[h].submenu[pos] = strdup(name->getStringValue());
else else
Menu[h].submenu[i] = strdup("not specified"); Menu[h].submenu[pos] = strdup("not specified");
Menu[h].cb[i] = NULL; Menu[h].cb[pos] = NULL;
for (unsigned int j=0; __fg_gui_fn[j].fn; j++) for (unsigned int j=0; __fg_gui_fn[j].fn; j++)
if (call && if (call &&
!strcmp(call->getStringValue(), __fg_gui_fn[j].name) ) !strcmp(call->getStringValue(), __fg_gui_fn[j].name) )
{ {
Menu[h].cb[i] = __fg_gui_fn[j].fn; Menu[h].cb[pos] = __fg_gui_fn[j].fn;
break; break;
} }
} }