Lines Matching +full:data +full:- +full:width
4 * checklist.c -- implements the checklist box
6 * Copyright 2000-2019,2020 Thomas E. Dickey
25 * Stuart Herbert - S.Herbert@sheffield.ac.uk: radiolist extension
26 * Alessandro Rubini - rubini@ipvvis.unipv.it: merged the two
35 /* the outer-window */
44 /* the inner-window */
56 print_item(ALL_DATA * data, in print_item() argument
67 int climit = (getmaxx(win) - data->check_x + 1); in print_item()
69 ? item->name in print_item()
70 : item->text); in print_item()
75 for (i = 0; i < data->use_width; i++) in print_item()
78 (void) wmove(win, choice, data->check_x); in print_item()
81 (data->checkflag == FLAG_CHECK) ? "[%c]" : "(%c)", in print_item()
82 states[item->state]); in print_item()
87 dlg_print_listitem(win, item->name, climit, first, selected); in print_item()
91 (void) wmove(win, choice, data->item_x); in print_item()
95 dlg_item_help(item->help); in print_item()
101 print_list(ALL_DATA * data, int choice, int scrollamt, int max_choice) in print_list() argument
106 getyx(data->dialog, cur_y, cur_x); in print_list()
108 print_item(data, in print_list()
109 data->list, in print_list()
110 &data->items[i + scrollamt], in print_list()
111 data->states, in print_list()
114 (void) wnoutrefresh(data->list); in print_list()
116 dlg_draw_scrollbar(data->dialog, in print_list()
120 (long) (data->item_no), in print_list()
121 data->box_x + data->check_x, in print_list()
122 data->box_x + data->use_width, in print_list()
123 data->box_y, in print_list()
124 data->box_y + data->use_height + 1, in print_list()
128 (void) wmove(data->dialog, cur_y, cur_x); in print_list()
155 int width, in dlg_checklist() argument
163 /* *INDENT-OFF* */ in dlg_checklist()
177 DLG_KEYS_DATA( DLGK_ITEM_PREV, '-' ), in dlg_checklist()
187 /* *INDENT-ON* */ in dlg_checklist()
191 int old_width = width; in dlg_checklist()
196 int button = dialog_state.visit_items ? -1 : dlg_default_button(); in dlg_checklist()
212 DLG_TRACE2N("width", width); in dlg_checklist()
261 dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, use_width); in dlg_checklist()
265 &height, &width, in dlg_checklist()
268 dlg_button_layout(buttons, &width); in dlg_checklist()
269 dlg_print_size(height, width); in dlg_checklist()
270 dlg_ctl_size(height, width); in dlg_checklist()
280 x = dlg_box_x_ordinate(width); in dlg_checklist()
283 dialog = dlg_new_window(height, width, y, x); in dlg_checklist()
290 dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr); in dlg_checklist()
295 dlg_print_autowrap(dialog, prompt, height, width); in dlg_checklist()
297 all.use_width = width - 6; in dlg_checklist()
300 all.box_x = (width - all.use_width) / 2 - 1; in dlg_checklist()
304 * Limit the list to avoid overwriting the ok-button. in dlg_checklist()
306 all.use_height = height - MIN_HIGH - cur_y; in dlg_checklist()
335 use_width = (all.use_width - 6); in dlg_checklist()
351 text_width = use_width - name_width; in dlg_checklist()
356 all.check_x = (use_width - list_width) / 2; in dlg_checklist()
365 scrollamt = MIN(scrollamt, max_choice + item_no - 1); in dlg_checklist()
366 if (choice >= (max_choice + scrollamt - 1)) { in dlg_checklist()
367 scrollamt = MAX(0, choice - max_choice + 1); in dlg_checklist()
368 choice = max_choice - 1; in dlg_checklist()
377 dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width); in dlg_checklist()
384 if (button < 0) /* --visit-items */ in dlg_checklist()
395 key -= M_EVENT; in dlg_checklist()
399 i = (key - KEY_MAX); in dlg_checklist()
401 choice = (key - KEY_MAX); in dlg_checklist()
469 i = j - scrollamt; in dlg_checklist()
477 i = j - scrollamt; in dlg_checklist()
492 * A single digit (1-9) positions the selection to that line in the in dlg_checklist()
498 && (key - '1' < max_choice)) { in dlg_checklist()
500 i = key - '1'; in dlg_checklist()
508 i = -scrollamt; in dlg_checklist()
511 i = item_no - 1 - scrollamt; in dlg_checklist()
517 i = -MIN(scrollamt, max_choice); in dlg_checklist()
522 i = MIN(choice + max_choice, item_no - scrollamt - 1); in dlg_checklist()
525 i = choice - 1; in dlg_checklist()
531 if (scrollamt + choice >= item_no - 1) in dlg_checklist()
549 choice = max_choice - 1; in dlg_checklist()
550 scrollamt += (i - max_choice + 1); in dlg_checklist()
571 dlg_draw_buttons(dialog, height - 2, 0, buttons, button, in dlg_checklist()
572 FALSE, width); in dlg_checklist()
576 dlg_draw_buttons(dialog, height - 2, 0, buttons, button, in dlg_checklist()
577 FALSE, width); in dlg_checklist()
582 /* reset data */ in dlg_checklist()
584 width = old_width; in dlg_checklist()
619 int width, in dialog_checklist() argument
652 width, in dialog_checklist()