diff options
Diffstat (limited to 'scripts/kconfig/lxdialog/inputbox.c')
-rw-r--r-- | scripts/kconfig/lxdialog/inputbox.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c index 779503726b0a..f75b51f8e636 100644 --- a/scripts/kconfig/lxdialog/inputbox.c +++ b/scripts/kconfig/lxdialog/inputbox.c | |||
@@ -58,17 +58,18 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width | |||
58 | dialog = newwin(height, width, y, x); | 58 | dialog = newwin(height, width, y, x); |
59 | keypad(dialog, TRUE); | 59 | keypad(dialog, TRUE); |
60 | 60 | ||
61 | draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); | 61 | draw_box(dialog, 0, 0, height, width, |
62 | wattrset(dialog, border_attr); | 62 | dlg.dialog.atr, dlg.border.atr); |
63 | wattrset(dialog, dlg.border.atr); | ||
63 | mvwaddch(dialog, height - 3, 0, ACS_LTEE); | 64 | mvwaddch(dialog, height - 3, 0, ACS_LTEE); |
64 | for (i = 0; i < width - 2; i++) | 65 | for (i = 0; i < width - 2; i++) |
65 | waddch(dialog, ACS_HLINE); | 66 | waddch(dialog, ACS_HLINE); |
66 | wattrset(dialog, dialog_attr); | 67 | wattrset(dialog, dlg.dialog.atr); |
67 | waddch(dialog, ACS_RTEE); | 68 | waddch(dialog, ACS_RTEE); |
68 | 69 | ||
69 | print_title(dialog, title, width); | 70 | print_title(dialog, title, width); |
70 | 71 | ||
71 | wattrset(dialog, dialog_attr); | 72 | wattrset(dialog, dlg.dialog.atr); |
72 | print_autowrap(dialog, prompt, width - 2, 1, 3); | 73 | print_autowrap(dialog, prompt, width - 2, 1, 3); |
73 | 74 | ||
74 | /* Draw the input field box */ | 75 | /* Draw the input field box */ |
@@ -76,13 +77,14 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width | |||
76 | getyx(dialog, y, x); | 77 | getyx(dialog, y, x); |
77 | box_y = y + 2; | 78 | box_y = y + 2; |
78 | box_x = (width - box_width) / 2; | 79 | box_x = (width - box_width) / 2; |
79 | draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2, border_attr, dialog_attr); | 80 | draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2, |
81 | dlg.border.atr, dlg.dialog.atr); | ||
80 | 82 | ||
81 | print_buttons(dialog, height, width, 0); | 83 | print_buttons(dialog, height, width, 0); |
82 | 84 | ||
83 | /* Set up the initial value */ | 85 | /* Set up the initial value */ |
84 | wmove(dialog, box_y, box_x); | 86 | wmove(dialog, box_y, box_x); |
85 | wattrset(dialog, inputbox_attr); | 87 | wattrset(dialog, dlg.inputbox.atr); |
86 | 88 | ||
87 | if (!init) | 89 | if (!init) |
88 | instr[0] = '\0'; | 90 | instr[0] = '\0'; |
@@ -120,7 +122,7 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width | |||
120 | case KEY_BACKSPACE: | 122 | case KEY_BACKSPACE: |
121 | case 127: | 123 | case 127: |
122 | if (input_x || scroll) { | 124 | if (input_x || scroll) { |
123 | wattrset(dialog, inputbox_attr); | 125 | wattrset(dialog, dlg.inputbox.atr); |
124 | if (!input_x) { | 126 | if (!input_x) { |
125 | scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1); | 127 | scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1); |
126 | wmove(dialog, box_y, box_x); | 128 | wmove(dialog, box_y, box_x); |
@@ -140,7 +142,7 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width | |||
140 | default: | 142 | default: |
141 | if (key < 0x100 && isprint(key)) { | 143 | if (key < 0x100 && isprint(key)) { |
142 | if (scroll + input_x < MAX_LEN) { | 144 | if (scroll + input_x < MAX_LEN) { |
143 | wattrset(dialog, inputbox_attr); | 145 | wattrset(dialog, dlg.inputbox.atr); |
144 | instr[scroll + input_x] = key; | 146 | instr[scroll + input_x] = key; |
145 | instr[scroll + input_x + 1] = '\0'; | 147 | instr[scroll + input_x + 1] = '\0'; |
146 | if (input_x == box_width - 1) { | 148 | if (input_x == box_width - 1) { |