Lines Matching +full:data +full:- +full:width
4 * treeview.c -- implements the treeview dialog
6 * Copyright 2012-2019,2020 Thomas E. Dickey
31 /* the outer-window */
40 /* the inner-window */
53 print_item(ALL_DATA * data, in print_item() argument
60 WINDOW *win = data->list; in print_item()
64 int climit = (getmaxx(win) - data->check_x + 1); in print_item()
66 ? item->name in print_item()
67 : item->text); in print_item()
72 for (i = 0; i < data->use_width; i++) in print_item()
75 (void) wmove(win, choice, data->check_x); in print_item()
78 data->is_check ? "[%c]" : "(%c)", in print_item()
79 states[item->state]); in print_item()
85 (void) wmove(win, choice, data->item_x + INDENT * i); in print_item()
87 for (j = INDENT - 1; j > 0; --j) in print_item()
90 (void) wmove(win, choice, data->item_x + INDENT * depths); in print_item()
95 dlg_item_help(item->help); in print_item()
101 print_list(ALL_DATA * data, in print_list() argument
109 getyx(data->dialog, cur_y, cur_x); in print_list()
112 print_item(data, in print_list()
113 &data->items[scrollamt + i], in print_list()
114 data->states, in print_list()
115 data->depths[scrollamt + i], in print_list()
118 (void) wnoutrefresh(data->list); in print_list()
120 dlg_draw_scrollbar(data->dialog, in print_list()
124 (long) (data->item_no), in print_list()
125 data->box_x + data->check_x, in print_list()
126 data->box_x + data->use_width, in print_list()
127 data->box_y, in print_list()
128 data->box_y + data->use_height + 1, in print_list()
132 (void) wmove(data->dialog, cur_y, cur_x); in print_list()
158 int width, in dlg_treeview() argument
167 /* *INDENT-OFF* */ in dlg_treeview()
181 DLG_KEYS_DATA( DLGK_ITEM_PREV, '-' ), in dlg_treeview()
191 /* *INDENT-ON* */ in dlg_treeview()
195 int old_width = width; in dlg_treeview()
200 int button = dialog_state.visit_items ? -1 : dlg_default_button(); in dlg_treeview()
259 dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, use_width); in dlg_treeview()
262 dlg_auto_size(title, prompt, &height, &width, MIN_HIGH + use_height, use_width); in dlg_treeview()
264 dlg_button_layout(buttons, &width); in dlg_treeview()
265 dlg_print_size(height, width); in dlg_treeview()
266 dlg_ctl_size(height, width); in dlg_treeview()
268 x = dlg_box_x_ordinate(width); in dlg_treeview()
271 dialog = dlg_new_window(height, width, y, x); in dlg_treeview()
277 dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr); in dlg_treeview()
282 dlg_print_autowrap(dialog, prompt, height, width); in dlg_treeview()
284 all.use_width = width - 4; in dlg_treeview()
287 box_x = (width - all.use_width) / 2 - 1; in dlg_treeview()
291 * Limit the list to avoid overwriting the ok-button. in dlg_treeview()
293 use_height = height - MIN_HIGH - cur_y; in dlg_treeview()
326 use_width = (all.use_width - 4); in dlg_treeview()
329 all.check_x = (use_width - tree_width) / 2; in dlg_treeview()
339 scrollamt = choice - max_choice + 1; in dlg_treeview()
340 choice = max_choice - 1; in dlg_treeview()
355 dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width); in dlg_treeview()
362 if (button < 0) /* --visit-items */ in dlg_treeview()
373 key -= M_EVENT; in dlg_treeview()
376 i = (key - KEY_MAX); in dlg_treeview()
378 choice = (key - KEY_MAX); in dlg_treeview()
430 i = j - scrollamt; in dlg_treeview()
438 i = j - scrollamt; in dlg_treeview()
453 * A single digit (1-9) positions the selection to that line in the in dlg_treeview()
459 && (key - '1' < max_choice)) { in dlg_treeview()
461 i = key - '1'; in dlg_treeview()
469 i = -scrollamt; in dlg_treeview()
472 i = item_no - 1 - scrollamt; in dlg_treeview()
478 i = -MIN(scrollamt, max_choice); in dlg_treeview()
483 i = MIN(choice + max_choice, item_no - scrollamt - 1); in dlg_treeview()
486 i = choice - 1; in dlg_treeview()
492 if (scrollamt + choice >= item_no - 1) in dlg_treeview()
509 choice = max_choice - 1; in dlg_treeview()
510 scrollamt += (i - max_choice + 1); in dlg_treeview()
531 dlg_draw_buttons(dialog, height - 2, 0, buttons, button, in dlg_treeview()
532 FALSE, width); in dlg_treeview()
536 dlg_draw_buttons(dialog, height - 2, 0, buttons, button, in dlg_treeview()
537 FALSE, width); in dlg_treeview()
542 /* reset data */ in dlg_treeview()
544 width = old_width; in dlg_treeview()
577 int width, in dialog_treeview() argument
595 DLG_TRACE2N("width", width); in dialog_treeview()
623 width, in dialog_treeview()