Lines Matching +full:button +full:-

4  *  buttons.c -- draw buttons, e.g., OK/Cancel
6 * Copyright 2000-2020,2021 Thomas E. Dickey
31 #define MIN_BUTTON (-dialog_state.visit_cols)
42 int left = (longest - len) / 2; in center_label()
43 right = (longest - len - left); in center_label()
125 * Determine the hot-keys for a set of button-labels. Normally these are
127 * button has the same first-uppercase, then we will (attempt to) look for
152 if ((last - first) != 1) { in get_hotkeys()
174 * Print a button
205 if ((last - first) != 1) { in print_button()
222 waddnstr(win, label + first, last - first); in print_button()
246 * Compute the size of the button array in columns. Return the total number of
247 * columns in *length, and the longest button's columns in *longest
274 if (*longest < 6 - (*longest & 1)) in dlg_button_sizes()
275 *longest = 6 - (*longest & 1); in dlg_button_sizes()
281 * Compute the size of the button array.
298 unused = limit - used; in dlg_button_x_step()
307 *step = *gap + (used + count - 1) / count; in dlg_button_x_step()
395 CHR_BUTTON ? hotkeys[n] : -1, in dlg_draw_buttons()
451 int cmp = -1; in dlg_button_to_char()
464 * Given a list of button labels, and a character which may be the abbreviation
552 * Return a list of button labels.
583 * Map the given button index for dlg_exit_label() into our exit-code.
586 dlg_exit_buttoncode(int button) in dlg_exit_buttoncode() argument
594 result = dlg_ok_buttoncode(button); in dlg_exit_buttoncode()
607 dlg_trace_msg("# ignore --nook, since at least one button is needed\n"); in finish_ok_label()
615 * Return a list of button labels for the OK (no Cancel) group, used in msgbox
635 * Return a list of button labels for the OK/Cancel group, used in most widgets
657 * Map the given button index for dlg_ok_labels() into our exit-code
660 dlg_ok_buttoncode(int button) in dlg_ok_buttoncode() argument
665 if (!dialog_vars.nook && (button <= 0)) { in dlg_ok_buttoncode()
667 } else if (dialog_vars.extra_button && (button == n++)) { in dlg_ok_buttoncode()
669 } else if (!dialog_vars.nocancel && (button == n++)) { in dlg_ok_buttoncode()
671 } else if (dialog_vars.help_button && (button == n)) { in dlg_ok_buttoncode()
675 button, result, dlg_exitcode2s(result))); in dlg_ok_buttoncode()
696 * Similarly, find the previous button index.
701 int result = current - 1; in dlg_prev_ok_buttonindex()
712 * Find the button-index for the "OK" or "Cancel" button, according to
713 * whether --defaultno is given. If --nocancel was given, we always return
714 * the index for the first button (usually "OK" unless --nook was used).
730 * Find the button-index for a button named with --default-button. If the
731 * option was not specified, or if the selected button does not exist, return
732 * the index of the first button (usually "OK" unless --nook was used).
780 * Map the given button index for dlg_yes_labels() into our exit-code.
783 dlg_yes_buttoncode(int button) in dlg_yes_buttoncode() argument
788 result = dlg_ok_buttoncode(button); in dlg_yes_buttoncode()
789 } else if (button == 0) { in dlg_yes_buttoncode()
791 } else if (button == 1) { in dlg_yes_buttoncode()
793 } else if (button == 2 && dialog_vars.help_button) { in dlg_yes_buttoncode()
804 dlg_next_button(const char **labels, int button) in dlg_next_button() argument
806 if (button < -1) in dlg_next_button()
807 button = -1; in dlg_next_button()
809 if (labels[button + 1] != 0) { in dlg_next_button()
810 ++button; in dlg_next_button()
812 button = MIN_BUTTON; in dlg_next_button()
814 return button; in dlg_next_button()
821 dlg_prev_button(const char **labels, int button) in dlg_prev_button() argument
823 if (button > MIN_BUTTON) { in dlg_prev_button()
824 --button; in dlg_prev_button()
826 if (button < -1) in dlg_prev_button()
827 button = -1; in dlg_prev_button()
829 while (labels[button + 1] != 0) in dlg_prev_button()
830 ++button; in dlg_prev_button()
832 return button; in dlg_prev_button()