Lines Matching +full:button +full:-
1 // SPDX-License-Identifier: GPL-2.0+
3 * inputbox.c -- implements the input box
18 int x = width / 2 - 11; in print_buttons()
19 int y = height - 2; in print_buttons()
35 int input_x = 0, key = 0, button = -1; in dialog_inputbox() local
46 if (getmaxy(stdscr) <= (height - INPUTBOX_HEIGHT_MIN)) in dialog_inputbox()
47 return -ERRDISPLAYTOOSMALL; in dialog_inputbox()
48 if (getmaxx(stdscr) <= (width - INPUTBOX_WIDTH_MIN)) in dialog_inputbox()
49 return -ERRDISPLAYTOOSMALL; in dialog_inputbox()
52 x = (getmaxx(stdscr) - width) / 2; in dialog_inputbox()
53 y = (getmaxy(stdscr) - height) / 2; in dialog_inputbox()
63 mvwaddch(dialog, height - 3, 0, ACS_LTEE); in dialog_inputbox()
64 for (i = 0; i < width - 2; i++) in dialog_inputbox()
72 print_autowrap(dialog, prompt, width - 2, 1, 3); in dialog_inputbox()
75 box_width = width - 6; in dialog_inputbox()
78 box_x = (width - box_width) / 2; in dialog_inputbox()
79 draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2, in dialog_inputbox()
92 show_x = len - box_width + 1; in dialog_inputbox()
93 input_x = box_width - 1; in dialog_inputbox()
94 for (i = 0; i < box_width - 1; i++) in dialog_inputbox()
109 if (button == -1) { /* Input box selected */ in dialog_inputbox()
121 show_x--; in dialog_inputbox()
123 input_x--; in dialog_inputbox()
126 for (i = pos - 1; i < len; i++) { in dialog_inputbox()
131 pos--; in dialog_inputbox()
132 len--; in dialog_inputbox()
149 wmove(dialog, box_y, --input_x + box_x); in dialog_inputbox()
151 show_x--; in dialog_inputbox()
162 pos--; in dialog_inputbox()
167 if (input_x < box_width - 1) { in dialog_inputbox()
169 } else if (input_x == box_width - 1) { in dialog_inputbox()
189 for (i = len; i > pos; i--) in dialog_inputbox()
190 instr[i] = instr[i-1]; in dialog_inputbox()
199 if (input_x == box_width - 1) { in dialog_inputbox()
232 switch (button) { in dialog_inputbox()
233 case -1: in dialog_inputbox()
234 button = 1; /* Indicates "Help" button is selected */ in dialog_inputbox()
238 button = -1; /* Indicates input box is selected */ in dialog_inputbox()
244 button = 0; /* Indicates "OK" button is selected */ in dialog_inputbox()
252 switch (button) { in dialog_inputbox()
253 case -1: in dialog_inputbox()
254 button = 0; /* Indicates "OK" button is selected */ in dialog_inputbox()
258 button = 1; /* Indicates "Help" button is selected */ in dialog_inputbox()
262 button = -1; /* Indicates input box is selected */ in dialog_inputbox()
272 return (button == -1 ? 0 : button); in dialog_inputbox()