Lines Matching +full:5 +full:- +full:button
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()
187 box_y, box_x + check_x + 5, list_height); 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()
223 scroll, box_y, box_x + check_x + 5, list_height); in dialog_checklist()
230 i = choice - 1; 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()
251 scroll, box_y, box_x + check_x + 5, list_height); in dialog_checklist()
261 /* De-highlight current item */ in dialog_checklist()
277 button = 1; in dialog_checklist()
278 /* fall-through */ in dialog_checklist()
289 return button; in dialog_checklist()
293 button = ((key == KEY_LEFT ? --button : ++button) < 0) in dialog_checklist()
294 ? 1 : (button > 1 ? 0 : button); in dialog_checklist()
296 print_buttons(dialog, height, width, button); in dialog_checklist()