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()
194 while (key != KEY_ESC) { in dialog_checklist()
195 key = wgetch(dialog); in dialog_checklist()
199 if (toupper(key) == toupper(item_str()[0])) in dialog_checklist()
203 if (i < max_choice || key == KEY_UP || key == KEY_DOWN || in dialog_checklist()
204 key == '+' || key == '-') { in dialog_checklist()
205 if (key == KEY_UP || key == '-') { in dialog_checklist()
211 /* De-highlight current first item */ in dialog_checklist()
215 wscrl(list, -1); in dialog_checklist()
218 scroll--; in dialog_checklist()
227 continue; /* wait for another key press */ in dialog_checklist()
229 i = choice - 1; in dialog_checklist()
230 } else if (key == KEY_DOWN || key == '+') { in dialog_checklist()
231 if (choice == max_choice - 1) { in dialog_checklist()
232 if (scroll + choice >= item_count() - 1) in dialog_checklist()
236 /* De-highlight current last item before scrolling up */ in dialog_checklist()
237 item_set(scroll + max_choice - 1); in dialog_checklist()
239 max_choice - 1, in dialog_checklist()
246 item_set(scroll + max_choice - 1); in dialog_checklist()
247 print_item(list, max_choice - 1, TRUE); in dialog_checklist()
255 continue; /* wait for another key press */ in dialog_checklist()
260 /* De-highlight current item */ in dialog_checklist()
270 continue; /* wait for another key press */ in dialog_checklist()
272 switch (key) { in dialog_checklist()
277 /* fall-through */ in dialog_checklist()
292 button = ((key == KEY_LEFT ? --button : ++button) < 0) in dialog_checklist()
300 key = KEY_ESC; in dialog_checklist()
303 key = on_key_esc(dialog); in dialog_checklist()
317 return key; /* ESC pressed */ in dialog_checklist()