//set_title_info (-1,-1);
//set_misc_info(-1,-1,-1,-1);
+ // Register the menusystem handler
reg_handler(&msys_handler);
TESTING = add_menu(" Testing ");
+ set_menu_pos(5,60);
add_item("Memory Test","Perform extensive memory testing",OPT_RUN, "memtest",0);
add_item("Exit this menu","Go one level up",OPT_EXITMENU,"exit",0);
{
pt_menuitem opt,choice;
int numitems;
- char startopt;
+ char startopt,row,col;
startopt = 0;
if (cmenu == NULL) return NULL;
// Call recursively for submenu
// Position the submenu below the current item,
// covering half the current window (horizontally)
- choice = runmenusystem(top+opt->index+2, left+3+(cmenu->menuwidth >> 1), ms->menus[opt->itemdata.submenunum]);
+ row = ms->menus[opt->itemdata.submenunum]->row;
+ col = ms->menus[opt->itemdata.submenunum]->col;
+ if (row == 0xFF) row = top+opt->index+2;
+ if (col == 0xFF) col = left+3+(cmenu->menuwidth >> 1);
+ choice = runmenusystem(row, col, ms->menus[opt->itemdata.submenunum]);
if (choice==NULL) // User hit Esc in submenu
{
// Startover
if (m == NULL) return -1;
ms->menus[num] = m;
m->numitems = 0;
+ m->row = 0xFF;
+ m->col = 0xFF;
for (i=0; i < MAXMENUSIZE; i++) m->items[i] = NULL;
if (title)
return ms->nummenus - 1;
}
+void set_menu_pos(char row,char col) // Set the position of this menu.
+{
+pt_menu m;
+
+ m = ms->menus[ms->nummenus-1];
+ m->row = row;
+ m->col = col;
+}
pt_menuitem add_sep() // Add a separator to current menu
{
const char *title;
char numitems;
char menuwidth;
+ char row,col; // Position where this menu should be displayed
} t_menu;
typedef t_menu *pt_menu; // Pointer to type menu
// Add item to the "current" menu // pointer values are stored internally
pt_menuitem add_item(const char *item, const char *status, t_action action, const char *data, char itemdata);
+void set_menu_pos(char row,char col); // Set the position of this menu.
+
// Add a separator to the "current" menu
pt_menuitem add_sep();
// unused otherwise.
TESTING = add_menu(" Testing ");
+ add_item("Self Loop","Go to testing",OPT_SUBMENU,NULL,TESTING);
add_item("Memory Test","Perform extensive memory testing",OPT_RUN, "memtest",0);
add_item("Exit this menu","Go one level up",OPT_EXITMENU,"exit",0);
}
return 0;
}
-