Lines Matching +full:button +full:- +full:down
1 // SPDX-License-Identifier: GPL-2.0+
3 * menubox.c -- implements the menu box
12 * [ 1998-06-13 ]
14 * *) A bugfix for the Page-Down problem
16 * *) Formerly when I used Page Down and Page Up, the cursor would be set
22 * lxdialog is re-invoked by the Menuconfig shell script, can't
27 * one, but it would be nice if Menuconfig could make another "rm -f"
28 * just to be sure. Just try it out - you will recognise a difference!
30 * [ 1998-06-14 ]
32 * *) Now lxdialog is crash-safe against broken "lxdialog.scrltmp" files
42 * would leave mis-synchronized lxdialog.scrltmp files lying around,
59 strncpy(menu_item, item, menu_width - item_x); in do_print_item()
60 menu_item[menu_width - item_x] = '\0'; in do_print_item()
110 waddstr(win, "(-)"); in print_arrows()
144 int x = width / 2 - 28; in print_buttons()
145 int y = height - 2; in print_buttons()
176 int key = 0, button = 0, scroll = 0, choice = 0; in dialog_menu() local
184 return -ERRDISPLAYTOOSMALL; in dialog_menu()
186 height -= 4; in dialog_menu()
187 width -= 5; in dialog_menu()
188 menu_height = height - 10; in dialog_menu()
193 x = (getmaxx(stdscr) - width) / 2; in dialog_menu()
194 y = (getmaxy(stdscr) - height) / 2; in dialog_menu()
204 mvwaddch(dialog, height - 3, 0, ACS_LTEE); in dialog_menu()
205 for (i = 0; i < width - 2; i++) in dialog_menu()
214 print_autowrap(dialog, prompt, width - 2, 1, 3); in dialog_menu()
216 menu_width = width - 6; in dialog_menu()
217 box_y = height - menu_height - 5; in dialog_menu()
218 box_x = (width - menu_width) / 2 - 1; in dialog_menu()
230 item_x = (menu_width - 70) / 2; in dialog_menu()
243 choice = choice - scroll; in dialog_menu()
248 if (choice >= item_count() - max_choice / 2) in dialog_menu()
249 scroll = first_item = item_count() - max_choice; in dialog_menu()
251 scroll = first_item = choice - max_choice / 2; in dialog_menu()
252 choice = choice - scroll; in dialog_menu()
296 key == '-' || key == '+' || in dialog_menu()
301 if (key == KEY_UP || key == '-') { in dialog_menu()
303 /* Scroll menu down */ in dialog_menu()
304 do_scroll(menu, &scroll, -1); in dialog_menu()
308 choice = MAX(choice - 1, 0); in dialog_menu()
313 if ((choice > max_choice - 3) && in dialog_menu()
318 print_item(scroll+max_choice - 1, in dialog_menu()
319 max_choice - 1, FALSE); in dialog_menu()
321 choice = MIN(choice + 1, max_choice - 1); in dialog_menu()
327 do_scroll(menu, &scroll, -1); in dialog_menu()
331 choice--; in dialog_menu()
339 print_item(scroll+max_choice-1, in dialog_menu()
340 max_choice - 1, FALSE); in dialog_menu()
364 button = ((key == KEY_LEFT ? --button : ++button) < 0) in dialog_menu()
365 ? 4 : (button > 4 ? 0 : button); in dialog_menu()
367 print_buttons(dialog, height, width, button); in dialog_menu()
404 return button; in dialog_menu()