Lines Matching +full:data +full:- +full:width
2 * textbox.c -- implements the text box
7 * SPDX-License-Identifier: GPL-2.0+
13 static void print_page(WINDOW *win, int height, int width, update_text_fn
14 update_text, void *data);
15 static void print_line(WINDOW *win, int row, int width);
29 void *data) in refresh_text_box() argument
31 print_page(box, boxh, boxw, update_text, data); in refresh_text_box()
41 * keys is a null-terminated array
46 update_text_fn update_text, void *data) in dialog_textbox() argument
49 int height, width, boxh, boxw; in dialog_textbox() local
70 getmaxyx(stdscr, height, width); in dialog_textbox()
71 if (height < TEXTBOX_HEIGTH_MIN || width < TEXTBOX_WIDTH_MIN) in dialog_textbox()
72 return -ERRDISPLAYTOOSMALL; in dialog_textbox()
77 height -= 4; in dialog_textbox()
81 width = initial_width; in dialog_textbox()
83 if (width > 5) in dialog_textbox()
84 width -= 5; in dialog_textbox()
86 width = 0; in dialog_textbox()
89 x = (getmaxx(stdscr) - width) / 2; in dialog_textbox()
90 y = (getmaxy(stdscr) - height) / 2; in dialog_textbox()
92 draw_shadow(stdscr, y, x, height, width); in dialog_textbox()
94 dialog = newwin(height, width, y, x); in dialog_textbox()
98 boxh = height - 4; in dialog_textbox()
99 boxw = width - 2; in dialog_textbox()
107 draw_box(dialog, 0, 0, height, width, in dialog_textbox()
111 mvwaddch(dialog, height - 3, 0, ACS_LTEE); in dialog_textbox()
112 for (i = 0; i < width - 2; i++) in dialog_textbox()
118 print_title(dialog, title, width); in dialog_textbox()
120 print_button(dialog, gettext(" Exit "), height - 2, width / 2 - 4, TRUE); in dialog_textbox()
127 data); in dialog_textbox()
147 data); in dialog_textbox()
158 cur_x, update_text, data); in dialog_textbox()
168 cur_x, update_text, data); in dialog_textbox()
178 cur_x, update_text, data); in dialog_textbox()
186 back_lines(page_length - 1); in dialog_textbox()
188 cur_x, update_text, data); in dialog_textbox()
198 cur_x, update_text, data); in dialog_textbox()
210 hscroll--; in dialog_textbox()
214 cur_x, update_text, data); in dialog_textbox()
225 cur_x, update_text, data); in dialog_textbox()
285 page--; in back_lines()
291 page--; in back_lines()
300 static void print_page(WINDOW *win, int height, int width, update_text_fn in print_page() argument
301 update_text, void *data) in print_page() argument
312 update_text(buf, page - buf, end - buf, data); in print_page()
317 print_line(win, i, width); in print_page()
329 static void print_line(WINDOW * win, int row, int width) in print_line() argument
337 waddnstr(win, line, MIN(strlen(line), width - 2)); in print_line()
344 for (i = 0; i < width - x; i++) in print_line()
393 percent = (page - buf) * 100 / strlen(buf); in print_position()
394 wmove(win, getmaxy(win) - 3, getmaxx(win) - 9); in print_position()