Lines Matching refs:menu
26 "o Local help: To get help related to the current menu entry, use any\n"
62 "Go back to parent menu <Left> <Esc> <F5>\n"
66 "Start incremental, case-insensitive search for STRING in menu entries,\n"
72 "Exit menu search mode </> <Esc>\n"
119 "Single menu mode\n"
121 "If you prefer to have all of the menu entries listed in a single menu,\n"
128 "is already unfolded. Folded menu entries will be designated by a\n"
141 "Exit a submenu to its parent menu with <Esc> or <Left>.\n"
144 "To search for menu entries press </>.\n"
150 "For help related to the current menu entry press <?> or <h>.\n",
158 "Exit a submenu to its parent menu with <Esc> or <Left>.\n"
161 "To search for menu entries press </>.\n"
166 "For help related to the current menu entry press <?> or <h>.\n",
228 " the menu hierarchy.\n"
232 " this symbol to be visible and selectable in the menu.\n"
233 "o The 'Location:' lines tell, where in the menu structure this symbol\n"
236 " a selectable menu item, and the current value is displayed inside\n"
240 " after exiting this new menu.\n"
263 static struct menu *current_menu;
268 /* the largest size of the menu window */
284 static void selected_conf(struct menu *menu, struct menu *active_menu);
285 static void conf(struct menu *menu);
286 static void conf_choice(struct menu *menu);
287 static void conf_string(struct menu *menu);
290 static void show_help(struct menu *menu);
295 typedef void (*function_key_handler_t)(int *key, struct menu *menu);
296 static void handle_f1(int *key, struct menu *current_item);
297 static void handle_f2(int *key, struct menu *current_item);
298 static void handle_f3(int *key, struct menu *current_item);
299 static void handle_f4(int *key, struct menu *current_item);
300 static void handle_f5(int *key, struct menu *current_item);
301 static void handle_f6(int *key, struct menu *current_item);
302 static void handle_f7(int *key, struct menu *current_item);
303 static void handle_f8(int *key, struct menu *current_item);
304 static void handle_f9(int *key, struct menu *current_item);
394 static void handle_f1(int *key, struct menu *current_item)
402 static void handle_f2(int *key, struct menu *current_item)
409 static void handle_f3(int *key, struct menu *current_item)
418 static void handle_f4(int *key, struct menu *current_item)
434 static void handle_f5(int *key, struct menu *current_item)
441 static void handle_f6(int *key, struct menu *current_item)
448 static void handle_f7(int *key, struct menu *current_item)
455 static void handle_f8(int *key, struct menu *current_item)
462 static void handle_f9(int *key, struct menu *current_item)
469 static int process_special_keys(int *key, struct menu *menu)
481 function_keys[i].handler(key, menu);
507 /* Do not search if the menu is empty (i.e. items_num == 0) */
535 static void item_make(struct menu *menu, char tag, const char *fmt, ...)
544 k_menu_items[items_num].usrptr = menu;
545 if (menu != NULL)
547 menu_is_visible(menu);
696 struct menu *target;
808 static void build_conf(struct menu *menu)
812 struct menu *child;
817 if (!menu || (!show_all_items && !menu_is_visible(menu)))
820 sym = menu->sym;
821 prop = menu->prompt;
823 if (prop && menu != current_menu) {
824 const char *prompt = menu_get_prompt(menu);
826 ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN;
831 item_make(menu, 'm',
833 menu->data ? "-->" : "++>",
836 item_make(menu, 'm',
839 menu_is_empty(menu) ? "----" : "--->");
841 if (single_menu_mode && menu->data)
847 item_make(menu, ':',
856 item_make(menu, ':', "---%*c%s",
869 struct menu *def_menu = NULL;
872 for (child = menu->list; child; child = child->next) {
881 item_make(menu, 't', "[%c]",
896 item_make(menu, 't', "<%c>", ch);
900 item_make(menu, def_menu ? 't' : ':', " ");
904 ' ', menu_get_prompt(menu));
919 if (menu == current_menu) {
920 item_make(menu, ':',
922 ' ', menu_get_prompt(menu));
928 item_make(menu, ':', " ");
933 item_make(menu, 't', "[%c]",
936 item_make(menu, 't', "-%c-",
953 item_make(menu,
956 item_make(menu,
959 item_make(menu, 't', "-%c-", ch);
963 item_make(menu, 's', " (%s)",
969 menu_get_prompt(menu),
977 menu_get_prompt(menu),
980 if (menu->prompt && menu->prompt->type == P_MENU) {
981 item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
988 for (child = menu->list; child; child = child->next)
999 /* adjust the menu to show this item.
1000 * prefer not to scroll the menu if possible*/
1043 /* position the menu at the middle of the screen */
1065 /* Post the menu */
1139 static void conf(struct menu *menu)
1141 selected_conf(menu, NULL);
1144 static void selected_conf(struct menu *menu, struct menu *active_menu)
1146 struct menu *submenu = NULL;
1159 current_menu = menu;
1160 build_conf(menu);
1169 if ((struct menu *) mcur->usrptr == active_menu) {
1177 show_menu(menu_get_prompt(menu), menu_instructions,
1197 (struct menu *) item_data()))
1222 show_help((struct menu *) item_data());
1235 if (res == 27 || (menu != &rootmenu && res == KEY_LEFT))
1238 /* remember location in the menu */
1245 submenu = (struct menu *) item_data();
1307 static void show_help(struct menu *menu)
1311 if (!menu)
1315 menu_get_ext_help(menu, &help);
1316 show_scroll_win(main_window, menu_get_prompt(menu), str_get(&help));
1320 static void conf_choice(struct menu *menu)
1322 const char *prompt = menu_get_prompt(menu);
1323 struct menu *child = NULL;
1334 active = sym_get_choice_value(menu->sym);
1339 for (i = 0, child = menu->list; child; child = child->next) {
1343 if (child->sym == sym_get_choice_value(menu->sym))
1381 (struct menu *) item_data()))
1406 show_help((struct menu *) item_data());
1439 static void conf_string(struct menu *menu)
1441 const char *prompt = menu_get_prompt(menu);
1447 switch (sym_get_type(menu->sym)) {
1463 sym_get_string_value(menu->sym),
1468 if (sym_set_string_value(menu->sym,
1475 show_help(menu);
1555 /* set up the menu and menu window */
1609 /* set btns menu */