Lines Matching refs:menu
259 static struct menu *current_menu;
279 static void conf(struct menu *menu);
280 static void conf_choice(struct menu *menu);
281 static void conf_string(struct menu *menu);
284 static void show_help(struct menu *menu);
289 typedef void (*function_key_handler_t)(int *key, struct menu *menu);
290 static void handle_f1(int *key, struct menu *current_item);
291 static void handle_f2(int *key, struct menu *current_item);
292 static void handle_f3(int *key, struct menu *current_item);
293 static void handle_f4(int *key, struct menu *current_item);
294 static void handle_f5(int *key, struct menu *current_item);
295 static void handle_f6(int *key, struct menu *current_item);
296 static void handle_f7(int *key, struct menu *current_item);
297 static void handle_f8(int *key, struct menu *current_item);
298 static void handle_f9(int *key, struct menu *current_item);
388 static void handle_f1(int *key, struct menu *current_item) in handle_f1()
396 static void handle_f2(int *key, struct menu *current_item) in handle_f2()
403 static void handle_f3(int *key, struct menu *current_item) in handle_f3()
412 static void handle_f4(int *key, struct menu *current_item) in handle_f4()
428 static void handle_f5(int *key, struct menu *current_item) in handle_f5()
435 static void handle_f6(int *key, struct menu *current_item) in handle_f6()
442 static void handle_f7(int *key, struct menu *current_item) in handle_f7()
449 static void handle_f8(int *key, struct menu *current_item) in handle_f8()
456 static void handle_f9(int *key, struct menu *current_item) in handle_f9()
463 static int process_special_keys(int *key, struct menu *menu) in process_special_keys() argument
475 function_keys[i].handler(key, menu); in process_special_keys()
525 static void item_make(struct menu *menu, char tag, const char *fmt, ...) in item_make() argument
534 k_menu_items[items_num].usrptr = menu; in item_make()
535 if (menu != NULL) in item_make()
537 menu_is_visible(menu); in item_make()
736 static void build_conf(struct menu *menu) in build_conf() argument
740 struct menu *child; in build_conf()
745 if (!menu || (!show_all_items && !menu_is_visible(menu))) in build_conf()
748 sym = menu->sym; in build_conf()
749 prop = menu->prompt; in build_conf()
751 if (prop && menu != current_menu) { in build_conf()
752 const char *prompt = menu_get_prompt(menu); in build_conf()
754 ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; in build_conf()
760 item_make(menu, 'm', in build_conf()
762 menu->data ? "-->" : "++>", in build_conf()
765 item_make(menu, 'm', in build_conf()
768 menu_is_empty(menu) ? "----" : "--->"); in build_conf()
770 if (single_menu_mode && menu->data) in build_conf()
776 item_make(menu, ':', in build_conf()
785 item_make(menu, ':', "---%*c%s", in build_conf()
798 struct menu *def_menu = NULL; in build_conf()
801 for (child = menu->list; child; child = child->next) { in build_conf()
810 item_make(menu, 't', "[%c]", in build_conf()
825 item_make(menu, 't', "<%c>", ch); in build_conf()
829 item_make(menu, def_menu ? 't' : ':', " "); in build_conf()
833 ' ', menu_get_prompt(menu)); in build_conf()
848 if (menu == current_menu) { in build_conf()
849 item_make(menu, ':', in build_conf()
851 ' ', menu_get_prompt(menu)); in build_conf()
857 item_make(menu, ':', " "); in build_conf()
862 item_make(menu, 't', "[%c]", in build_conf()
865 item_make(menu, 't', "-%c-", in build_conf()
882 item_make(menu, in build_conf()
885 item_make(menu, in build_conf()
888 item_make(menu, 't', "-%c-", ch); in build_conf()
892 item_make(menu, 's', " (%s)", in build_conf()
898 menu_get_prompt(menu), in build_conf()
906 menu_get_prompt(menu), in build_conf()
909 if (menu->prompt && menu->prompt->type == P_MENU) { in build_conf()
910 item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->"); in build_conf()
917 for (child = menu->list; child; child = child->next) in build_conf()
1069 static void conf(struct menu *menu) in conf() argument
1071 struct menu *submenu = NULL; in conf()
1072 const char *prompt = menu_get_prompt(menu); in conf()
1085 current_menu = menu; in conf()
1086 build_conf(menu); in conf()
1111 (struct menu *) item_data())) in conf()
1134 show_help((struct menu *) item_data()); in conf()
1147 if (res == 27 || (menu != &rootmenu && res == KEY_LEFT)) in conf()
1157 submenu = (struct menu *) item_data(); in conf()
1219 static void show_help(struct menu *menu) in show_help() argument
1223 if (!menu) in show_help()
1227 menu_get_ext_help(menu, &help); in show_help()
1228 show_scroll_win(main_window, menu_get_prompt(menu), str_get(&help)); in show_help()
1232 static void conf_choice(struct menu *menu) in conf_choice() argument
1234 const char *prompt = menu_get_prompt(menu); in conf_choice()
1235 struct menu *child = NULL; in conf_choice()
1246 active = sym_get_choice_value(menu->sym); in conf_choice()
1251 for (i = 0, child = menu->list; child; child = child->next) { in conf_choice()
1255 if (child->sym == sym_get_choice_value(menu->sym)) in conf_choice()
1293 (struct menu *) item_data())) in conf_choice()
1316 show_help((struct menu *) item_data()); in conf_choice()
1349 static void conf_string(struct menu *menu) in conf_string() argument
1351 const char *prompt = menu_get_prompt(menu); in conf_string()
1357 switch (sym_get_type(menu->sym)) { in conf_string()
1373 sym_get_string_value(menu->sym), in conf_string()
1378 if (sym_set_string_value(menu->sym, in conf_string()
1385 show_help(menu); in conf_string()