Lines Matching +full:key +full:- +full:press

1 // SPDX-License-Identifier: GPL-2.0+
3 * checklist.c -- implements the checklist box
6 * Stuart Herbert - S.Herbert@sheffield.ac.uk: radiolist extension
7 * Alessandro Rubini - rubini@ipvvis.unipv.it: merged the two
23 strncpy(list_item, item_str(), list_width - item_x); in print_item()
24 list_item[list_width - item_x] = '\0'; in print_item()
60 waddstr(win, "(-)"); in print_arrows()
72 if ((height < item_no) && (scroll + choice < item_no - 1)) { in print_arrows()
90 int x = width / 2 - 11; in print_buttons()
91 int y = height - 2; in print_buttons()
108 int key = 0, button = 0, choice = 0, scroll = 0, max_choice; in dialog_checklist() local
123 return -ERRDISPLAYTOOSMALL; in dialog_checklist()
125 return -ERRDISPLAYTOOSMALL; in dialog_checklist()
130 x = (getmaxx(stdscr) - width) / 2; in dialog_checklist()
131 y = (getmaxy(stdscr) - height) / 2; in dialog_checklist()
141 mvwaddch(dialog, height - 3, 0, ACS_LTEE); in dialog_checklist()
142 for (i = 0; i < width - 2; i++) in dialog_checklist()
150 print_autowrap(dialog, prompt, width - 2, 1, 3); in dialog_checklist()
152 list_width = width - 6; in dialog_checklist()
153 box_y = height - list_height - 5; in dialog_checklist()
154 box_x = (width - list_width) / 2 - 1; in dialog_checklist()
172 check_x = (list_width - check_x) / 2; in dialog_checklist()
176 scroll = choice - list_height + 1; in dialog_checklist()
177 choice -= scroll; in dialog_checklist()
195 while (key != KEY_ESC) { in dialog_checklist()
196 key = wgetch(dialog); in dialog_checklist()
200 if (toupper(key) == toupper(item_str()[0])) in dialog_checklist()
204 if (i < max_choice || key == KEY_UP || key == KEY_DOWN || in dialog_checklist()
205 key == '+' || key == '-') { in dialog_checklist()
206 if (key == KEY_UP || key == '-') { in dialog_checklist()
212 /* De-highlight current first item */ in dialog_checklist()
216 wscrl(list, -1); in dialog_checklist()
219 scroll--; in dialog_checklist()
228 continue; /* wait for another key press */ in dialog_checklist()
230 i = choice - 1; in dialog_checklist()
231 } else if (key == KEY_DOWN || key == '+') { in dialog_checklist()
232 if (choice == max_choice - 1) { in dialog_checklist()
233 if (scroll + choice >= item_count() - 1) in dialog_checklist()
237 /* De-highlight current last item before scrolling up */ in dialog_checklist()
238 item_set(scroll + max_choice - 1); in dialog_checklist()
240 max_choice - 1, in dialog_checklist()
247 item_set(scroll + max_choice - 1); in dialog_checklist()
248 print_item(list, max_choice - 1, TRUE); in dialog_checklist()
256 continue; /* wait for another key press */ in dialog_checklist()
261 /* De-highlight current item */ in dialog_checklist()
271 continue; /* wait for another key press */ in dialog_checklist()
273 switch (key) { in dialog_checklist()
278 /* fall-through */ in dialog_checklist()
293 button = ((key == KEY_LEFT ? --button : ++button) < 0) in dialog_checklist()
301 key = KEY_ESC; in dialog_checklist()
304 key = on_key_esc(dialog); in dialog_checklist()
318 return key; /* ESC pressed */ in dialog_checklist()