Lines Matching +full:count +full:- +full:width

4  *  formbox.c -- implements the form (i.e., some pairs label/editbox)
6 * Copyright 2003-2020,2021 Thomas E. Dickey
45 return ((item->type & 2) != 0) || (item->text_flen <= 0); in is_readonly()
51 return ((item->type & 1) != 0); in is_hidden()
57 return (y >= scrollamt && y - scrollamt < getmaxy(win)); in in_window()
64 && (wmove(win, y - scrollamt, x) != ERR); in ok_move()
71 wmove(win, y, getmaxx(win) - 1); in move_past()
80 int count = 0; in print_item() local
83 if (ok_move(win, scrollamt, item->name_y, item->name_x)) { in print_item()
84 len = item->name_len; in print_item()
85 len = MIN(len, getmaxx(win) - item->name_x); in print_item()
88 item->name, in print_item()
91 item->name_y - scrollamt, in print_item()
92 item->name_x, in print_item()
96 move_past(win, item->name_y - scrollamt, item->name_x + len); in print_item()
97 count = 1; in print_item()
100 if (item->text_len && ok_move(win, scrollamt, item->text_y, item->text_x)) { in print_item()
103 len = item->text_len; in print_item()
104 len = MIN(len, getmaxx(win) - item->text_x); in print_item()
116 item->text, in print_item()
119 item->text_y - scrollamt, in print_item()
120 item->text_x, in print_item()
124 move_past(win, item->text_y - scrollamt, item->text_x + len); in print_item()
125 count = 1; in print_item()
128 return count; in print_item()
138 int count = 0; in print_form() local
141 count += print_item(win, item + n, scrollamt, n == choice); in print_form()
143 if (count) { in print_form()
153 int result = -1; in set_choice()
176 * Find the last y-value in the form.
195 int count = 0; in is_first_field() local
198 ++count; in is_first_field()
200 --choice; in is_first_field()
203 return (count == 1); in is_first_field()
209 int count = 0; in is_last_field() local
212 ++count; in is_last_field()
217 return (count == 1); in is_last_field()
239 *choice = item_no - 1; in tab_next()
255 if (*scrollamt < lo + 1 - getmaxy(win)) in tab_next()
256 *scrollamt = lo + 1 - getmaxy(win); in tab_next()
260 * If we have to scroll to show a wrap-around, it does get in tab_next()
262 * next field in a multi-column form is a different matter. Scroll in tab_next()
272 wscrl(win, *scrollamt - old_scroll); in tab_next()
285 * in that page. Note that fields are not necessarily in top-to-bottom order,
317 if (abs(new_row - target) < abs(old_row - target)) { in scroll_next()
330 wscrl(win, *scrollamt - old_scroll); in scroll_next()
346 return (item->text_flen > 0 in real_length()
347 ? item->text_flen in real_length()
348 : (item->text_flen < 0 in real_length()
349 ? -item->text_flen in real_length()
350 : item->text_len)); in real_length()
413 int count = 0; in dlg_default_formitem() local
414 while (items->name != 0) { in dlg_default_formitem()
415 if (!strcmp(dialog_vars.default_item, items->name)) { in dlg_default_formitem()
416 result = count; in dlg_default_formitem()
420 count++; in dlg_default_formitem()
426 #define sTEXT -1
466 int width, in dlg_form() argument
472 /* *INDENT-OFF* */ in dlg_form()
488 /* *INDENT-ON* */ in dlg_form()
492 int old_width = width; in dlg_form()
510 bool was_autosize = (height == 0 || width == 0); in dlg_form()
526 DLG_TRACE2N("width", width); in dlg_form()
542 dlg_auto_size(title, prompt, &height, &width, in dlg_form()
550 form_height = MIN(SLINES - height, form_height); in dlg_form()
555 dlg_auto_size(title, prompt, &thigh, &twide, 0, width); in dlg_form()
556 thigh = SLINES - (height - (thigh + 1 + 3 * MARGIN)); in dlg_form()
560 dlg_print_size(height, width); in dlg_form()
561 dlg_ctl_size(height, width); in dlg_form()
563 x = dlg_box_x_ordinate(width); in dlg_form()
566 dialog = dlg_new_window(height, width, y, x); in dlg_form()
572 dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr); in dlg_form()
577 dlg_print_autowrap(dialog, prompt, height, width); in dlg_form()
579 form_width = width - 6; in dlg_form()
583 box_x = (width - form_width) / 2 - 1; in dlg_form()
595 dlg_mouse_mkbigregion(getbegy(form) - getbegy(dialog), in dlg_form()
596 getbegx(form) - getbegx(dialog), in dlg_form()
631 dlg_draw_buttons(dialog, height - 2, 0, buttons, in dlg_form()
635 FALSE, width); in dlg_form()
648 dialog_vars.max_input = current->text_ilen; in dlg_form()
649 dlg_item_help(current->help); in dlg_form()
650 dlg_show_string(form, current->text, chr_offset, in dlg_form()
652 current->text_y - scrollamt, in dlg_form()
653 current->text_x, in dlg_form()
654 current->text_len, in dlg_form()
666 /* handle non-functionkeys */ in dlg_form()
688 move_by = -form_height; in dlg_form()
714 move_by = -1; in dlg_form()
725 move_by = -1; in dlg_form()
732 new_choice = item_no - 1; in dlg_form()
787 width = old_width; in dlg_form()
798 int cell = key - DLGK_MOUSE(KEY_MAX); in dlg_form()
829 } else if ((code = dlg_ok_buttoncode(key - M_EVENT)) >= 0) { in dlg_form()
870 edit = dlg_edit_string(current->text, &chr_offset, key, in dlg_form()
873 dlg_show_string(form, current->text, chr_offset, in dlg_form()
875 current->text_y - scrollamt, in dlg_form()
876 current->text_x, in dlg_form()
877 current->text_len, in dlg_form()
920 --result; in dlg_ordinate()
930 int width, in dialog_form() argument
969 width, in dialog_form()
995 dlg_add_last_key(-1); in dialog_form()