dialog: import dialog 1.3-20210117

This commit is contained in:
Baptiste Daroussin 2021-02-26 10:16:49 +01:00
commit a96ef45019
233 changed files with 14165 additions and 10027 deletions

View File

@ -1,9 +1,222 @@
-- $Id: CHANGES,v 1.619 2018/06/21 09:19:45 tom Exp $
-- $Id: CHANGES,v 1.723 2021/01/17 20:21:41 tom Exp $
-- Thomas E. Dickey <dickey@invisible-island.net>
This version of dialog was originally from a Debian snapshot. I've done this
to it:
2021/01/17
+ updated dialog.pot
+ add option --no-hot-list, to allow suppressing the hotkey feature
from lists.
+ increase minimum height of inputbox to avoid input field overlapping
with the button-box (report by Victor Ananjevsky).
+ modify options-parsing to permit a "no" on any boolean option and
deprecating the "no" options without a "-" , e.g., generalizing on
"--nook" equivalence to "--no-ok".
2021/01/12
+ minor spelling fixes, per codespell
+ update configure macros, for quoting/escaping fixes per shellcheck
+ update config.guess, config.sub
2020/11/26
+ modify configure script's compiler check to work around Xcode's
useless aliases for standard C.
+ enable keep-tite feature for NetBSD 8 and up; earlier releases would
dump core.
> new features/fixes (Glenn Herteg)
+ add option "--cursor-off-label"
+ add option "--erase-on-exit"
+ fix errata in manpage.
+ fix logic: dlg_button_to_char() would return wrong value if no
uppercase was found
2020/11/25
+ add DIALOG_TIMEOUT to sample scripts, and use report-button more
consistently to handle unexpected exit-status values.
2020/11/24
+ add dlg_getenv_num() and dlg_getenv_str().
+ add DLG_EXIT_TIMEOUT to allow scripts to exit on an expired timeout
with an exit-status different from DLG_EXIT_ERROR or DLG_EXIT_ESC
(patch by Norbert Koch).
2020/11/23
+ modify dlg_ok_label() and dlg_ok_labels() to ignore --no-ok if all
buttons would be omitted.
+ add/use dlg_der_window() to account for derived windows just like
subwindows, to fix regression in dlg_getc() in fselect/dselect
widget.
+ modify several widgets to make their handling of --no-ok consistent
with the majority of the widgets: editbox.c, menubox.c, msgbox.c,
rangebox.c, textbox.c, timebox.c
+ add ^D as binding for new virtual key DLGK_LEAVE, which will close
the current dialog by activating the currently-selected button.
+ improve manual-page description of --no-ok option (reports by
Hans Mueller, Gil Delescluse).
+ modify configure script to make Solaris -R rpath feature work
2020/11/21
+ fix regression in dlg_getc() caused by not taking into account
subwindows used for input (report by Michael Wihl).
2020/11/20
+ add validity-checks for window pointer (report/testcase by Michael
Wihl).
+ improve configure macros:
CF_CLANG_COMPILER: apply compiler-flags needed for test.
CF_WITH_SCREEN_PDCURSES: use this to reduce X11-checks.
2020/11/17
+ amend initialization for dlg_getc to fix regression in pause widget
from 2020/03/27 changes (reports by Aidan Tessier, Norbert Koch,
Josmar Pierri).
+ improve configure macros:
CF_CLANG_COMPILER: split-out check for -Qunused-arguments to ensure
that clang supports it. IBM xlclang does not.
CF_MIXEDCASE_FILENAMES: when cross-compiling to darwin (macOS),
assume the filesystem doesn't support mixed-case
2020/09/21
+ modify init_dialog's initialization of tab_len and aspect_ratio to
avoid overwriting initialization done in process_common_options
(report/patch by Rainer Weikusat, Debian #970508).
2020/09/13
+ fix out-of-order description for --tailbox vs --rangebox in manpage
(report by Glenn Herteg).
+ updated configure-macros: compiler-warnings and shared-library
options. Changed configure --with-warnings to --enable-warnings for
consistency.
+ update config.guess
2020/04/01
+ updated sq.po from
http://translationproject.org/latest/dialog/
2020/03/27
+ add clarification in manual page to show when the single/double
quotes may be needed (prompted by discussion with Danilo G Baio).
+ fix an extra ".exe" in makefile.in which prevented Cygwin build.
+ fix most cppcheck warnings
+ tailbox/tailboxbg's exit-button now works with mouse-clicks
+ fix repainting while resizing for the editbox widget.
+ add configure-check for curses_exit() from ncurses 6.2
+ fix a few memory leaks in fselect.c, mixedgauge.c when resizing.
+ fix inconsistency in dlg_string_to_argv() which made the checklist9
example not work.
+ add empty-string check in dlg_print_listitem() to avoid indexing past
the end of the array of character-offsets.
+ improve handling of KEY_RESIZE by repainting the backtitle after
clearing the screen (integrated patch by Rainer Weikusat, Debian
#954185).
+ improve logic for wtimeout() calls which are used to set temporary
non-blocking reads (prompted by patch by Rainer Weikusat, Debian
#954220).
+ add "make check" rule.
+ updated configure-macros.
2020/02/28
+ updated configure-macros, to work around ncurses vs xcode's c99 -W
+ update config.guess
2019/12/31
+ updated configure-macros.
+ update config.guess
2019/12/10
+ correct rc-file lookup of "default" color (report by Grady Martin,
cf: 2019/09/24).
+ fix several issues in the sample scripts reported by shellcheck.
+ fix a few spelling errors reported by codespell (report by Jens
Schleusener).
+ correct check for return-value of isblank(), which is not necessarily
0/1 (report/patch by Paul Cercueil, Peter Korsgaard, cf: 2018/05/31).
2019/12/09
+ amend change for parsing command-options before calling init_dialog,
to handle --no-shadow, etc., which are initialized in init_dialog
(report by Paul Cercueil, cf: 2018/06/21).
+ add dlg_trace_va_msg to manpage, symbol files.
2019/11/10
+ improve layout of several widgets' data area when maximizing.
+ modify dselect/fselect to work with autosizing (Debian #915949).
+ add error messages from dlg_exiterr() to trace file.
+ improve manual page description of escaping in key-bindings.
+ modify inputmenu to recognize the "Cancel" button and keys bound to
that feature while editing a renamed menu item.
+ revert one change, in form.c to the --last-key feature (Debian
#942025).
+ correct ordering of libraries in configure-script, which appended
in a case where it should have prepended.
+ update config.guess, config.sub
2019/09/26
+ improve dialog-config script's filtering of -L options using the
linker default directories.
+ improve dialog-config script, adding a -L option corresponding to
the configure --libdir option if it would be a duplicate (report by
Andrew Kosteltsev).
+ build-fix for configure --disable-trace
+ updated pt.po from
http://translationproject.org/latest/dialog/
2019/09/24
+ allow for underline- and reverse-video flags in the ".rc" file
(integrated patch by Richard Robbins).
2019/08/08
+ amend change to --last-key feature to eliminate an unnecessary
separator (report by Gabriele Balducci).
2019/08/06
+ extend --last-key feature to the remaining widgets which have
ok/cancel buttons, and add logic to map keys which happen to be
bound to ok/extra/cancel/help to simulate a button-press on the
corresponding button (report by "sgewrk").
2019/08/01
+ further fixes for dialog-config.in (report by Andrew Kosteltsev).
2019/07/28
+ modify dialog-config.in so that setting prefix or exec-prefix to
a given value with --prefix=VALUE or --exec-prefix=VALUE has the
expected result of changing bindir, etc.
+ correct substitution for $LIBS value in dialog-config.in (report by
Andrew Kosteltsev).
2019/07/24
+ modify dlg_will_resize() and dlg_result_key() functions to reduce
the chance that dialog exits on a SIGWINCH (Debian #930775).
+ make test-package for the development headers/library
+ add --libs-only-L, etc., to dialog-config script (prompted by
discussion with Andrew Kosteltsev).
+ fix a memory leak in gauge widget (Andrew Kosteltsev).
+ minor fix for CF_GCC_WARNINGS
+ update config.guess, config.sub
2019/02/11
+ modify to work with ncurses' threaded-library, which does not allow
assignment to LINES/COLS (report by Marcus Roeckrath).
+ correct clearing after text in progressbox from 2018/06/21 changes
for resizing (reports by David Boyd, Alan Somers).
+ improved configure macros CF_GNU_SOURCE, CF_POSIX_C_SOURCE,
CF_XOPEN_SOURCE
+ update config.guess, config.sub
2018/11/07
+ convert ja.po to UTF-8 for consistency (suggested by Stanislav
Brabec).
+ repair mis-encoded hi.po (report/analysis by Stanislav Brabec).
2018/10/22
+ improved configure macros CF_CC_ENV_FLAGS, CF_LD_RPATH_OPT,
CF_LIBRARY_PATH, CF_SHARED_OPTS, CF_WITH_MAN2HTML,
CF_WITH_VERSIONED_SYMS from ncurses
+ add ast.po, from
http://translationproject.org/latest/dialog/
2018/06/21
+ improve file-offset computation in textbox.c (Werner Fink).
+ fix an overlooked case with real_auto_size() to maximize when
@ -370,7 +583,7 @@ to it:
2012/12/30 - release 1.2
+ improve some older changelog entries to help with HTML'izing content.
+ various fixes/improvments for scrollbar appearance.
+ various fixes/improvements for scrollbar appearance.
+ add mappings for some equivalent options provided by whiptail;
add configure option --disable-whiptail to allow suppressing these.
+ add configure option --disable-Xdialog2 to allow suppressing the

View File

@ -38,11 +38,11 @@ For the future, if any volunteer want, the way to evolve cdialog is to
multithreading.
2) add an option that could permit to read commands (--options) from a
file, like as in a normal programming language, but maintaining
compatiblity with older version of dialog.
compatibility with older version of dialog.
I no longer could maintain cdialog...
Executable and library name of cdialog are the same of dialog, for
compatiblity.
compatibility.
I think that only one directive should be follow: don't use a resource
like stdin, stdout when you'll write new options for cdialog; these

View File

@ -1 +1 @@
15:0:0 1.3 20180621
15:0:0 1.3 20210117

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
/*
* $Id: argv.c,v 1.12 2018/06/12 22:47:23 tom Exp $
* $Id: argv.c,v 1.13 2020/03/26 02:55:37 tom Exp $
*
* argv - Reusable functions for argv-parsing.
*
* Copyright 2011-2017,2018 Thomas E. Dickey
* Copyright 2011-2018,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -60,37 +60,38 @@ dlg_string_to_argv(char *blob)
for (pass = 0; pass < 2; ++pass) {
bool inparm = FALSE;
bool quoted = FALSE;
bool escape = FALSE;
char *param = blob;
size_t count = 0;
for (n = 0; n < length; ++n) {
if (escape) {
;
} else if (quoted && blob[n] == '"') {
if (quoted && blob[n] == '"') {
quoted = FALSE;
} else if (blob[n] == '"') {
quoted = TRUE;
if (!inparm) {
if (pass)
if (pass) {
result[count] = param;
}
++count;
inparm = TRUE;
}
} else if (!quoted && isspace(UCH(blob[n]))) {
if (inparm) {
if (pass) {
*param++ = '\0';
*param = '\0';
}
++param;
inparm = FALSE;
}
} else {
if (blob[n] == '\\') {
if (n + 1 == length) {
size_t n1 = (n + 1);
bool ignore = FALSE;
if (n1 == length) {
break; /* The string is terminated by a backslash */
} else if ((blob[n + 1] == '\\') ||
(blob[n + 1] == '"') ||
(!quoted && blob[n + 1] == '\n')) {
} else if ((blob[n1] == '\\') ||
(blob[n1] == '"') ||
(ignore = (blob[n1] == '\n'))) {
/* eat the backslash */
if (pass) {
--length;
@ -98,33 +99,35 @@ dlg_string_to_argv(char *blob)
blob[k] = blob[k + 1];
blob[length] = '\0';
} else {
escape = TRUE;
continue;
++param; /* pretend I ate it */
}
if (ignore)
continue;
}
}
if (!inparm) {
if (pass)
if (pass) {
result[count] = param;
}
++count;
inparm = TRUE;
}
if (pass) {
*param++ = blob[n];
*param = blob[n];
}
++param;
}
escape = FALSE;
}
if (!pass) {
if (pass) {
*param = '\0';
} else {
if (count) {
result = dlg_calloc(char *, count + 1);
assert_ptr(result, "string_to_argv");
} else {
break; /* no tokens found */
}
} else {
*param = '\0';
}
}
#ifdef HAVE_DLG_TRACE

View File

@ -1,9 +1,9 @@
/*
* $Id: arrows.c,v 1.52 2018/06/18 22:10:54 tom Exp $
* $Id: arrows.c,v 1.53 2019/07/24 23:04:14 tom Exp $
*
* arrows.c -- draw arrows to indicate end-of-range for lists
*
* Copyright 2000-2013,2018 Thomas E. Dickey
* Copyright 2000-2018,2019 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -70,7 +70,6 @@ merge_colors(chtype foreground, chtype background)
void
dlg_draw_helpline(WINDOW *win, bool decorations)
{
int cur_x, cur_y;
int bottom;
if (dialog_vars.help_line != 0
@ -83,6 +82,8 @@ dlg_draw_helpline(WINDOW *win, bool decorations)
int limit = dlg_count_real_columns(dialog_vars.help_line) + 2;
if (limit < avail) {
int cur_x, cur_y;
getyx(win, cur_y, cur_x);
other = decorations ? ON_LEFT : 0;
(void) wmove(win, bottom, other + (avail - limit) / 2);
@ -165,9 +166,6 @@ dlg_draw_scrollbar(WINDOW *win,
chtype attr,
chtype borderattr)
{
char buffer[80];
int percent;
int len;
int oldy, oldx;
chtype save = dlg_get_attrs(win);
@ -178,6 +176,10 @@ dlg_draw_scrollbar(WINDOW *win,
dlg_draw_helpline(win, TRUE);
if (bottom_arrow || top_arrow || dialog_state.use_scrollbar) {
char buffer[80];
int percent;
int len;
percent = (!total_data
? 100
: (int) ((next_data * 100)
@ -209,7 +211,6 @@ dlg_draw_scrollbar(WINDOW *win,
int all_diff = (int) (total_data + 1);
int bar_diff = (int) (next_data + 1 - this_data);
int bar_high;
int bar_y;
bar_high = ORDSIZE(bar_diff);
if (bar_high <= 0)
@ -217,6 +218,7 @@ dlg_draw_scrollbar(WINDOW *win,
if (bar_high < all_high) {
int bar_last = BARSIZE(next_data);
int bar_y;
wmove(win, top + 1, right);

View File

@ -1,9 +1,9 @@
/*
* $Id: buildlist.c,v 1.83 2018/06/19 22:57:01 tom Exp $
* $Id: buildlist.c,v 1.94 2020/11/23 00:37:17 tom Exp $
*
* buildlist.c -- implements the buildlist dialog
*
* Copyright 2012-2017,2018 Thomas E. Dickey
* Copyright 2012-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -21,7 +21,7 @@
* Boston, MA 02110, USA.
*/
#include <dialog.h>
#include <dlg_internals.h>
#include <dlg_keys.h>
/*
@ -77,9 +77,10 @@ index2row(ALL_DATA * all, int choice, int selected)
{
MY_DATA *data = all->list + selected;
int result = -1;
int row;
if (okIndex(all, choice)) {
int row;
for (row = 0; row < all->item_no; ++row) {
TRACE(("!... choice %d: %p vs row %d: %p\n",
choice, all->items + choice,
@ -270,9 +271,10 @@ first_item(ALL_DATA * all, int selected)
{
MY_DATA *data = all->list + selected;
int result = -1;
int n;
if (myItem(data, 0) != 0) {
int n;
for (n = 0; n < all->item_no; ++n) {
if (myItem(data, 0) == &all->items[n]) {
result = n;
@ -309,9 +311,10 @@ skip_rows(ALL_DATA * all, int row, int skip, int selected)
{
MY_DATA *data = all->list + selected;
int result = row;
int n;
if (skip > 0) {
int n;
for (n = row + 1; (n < all->item_no) && (n <= row + skip); ++n) {
if (myItem(data, n) == 0)
break;
@ -550,11 +553,10 @@ dlg_buildlist(const char *title,
ALL_DATA all;
MY_DATA *data = all.list;
int i, j, k, key2, found, x, y, cur_x, cur_y;
int key = 0, fkey;
int key, fkey;
bool save_visit = dialog_state.visit_items;
int button;
int cur_item;
int was_mouse;
int name_width, text_width, full_width, list_width;
int result = DLG_EXIT_UNKNOWN;
int num_states;
@ -650,8 +652,7 @@ dlg_buildlist(const char *title,
* After displaying the prompt, we know how much space we really have.
* Limit the list to avoid overwriting the ok-button.
*/
if (all.use_height + MIN_HIGH > height - cur_y)
all.use_height = height - MIN_HIGH - cur_y;
all.use_height = height - MIN_HIGH - cur_y;
if (all.use_height <= 0)
all.use_height = 1;
@ -742,6 +743,7 @@ dlg_buildlist(const char *title,
int at_top = index2row(&all, moi->top_index, which);
int at_end = index2row(&all, -1, which);
int at_bot = skip_rows(&all, at_top, all.use_height, which);
int was_mouse;
DLG_TRACE(("# ** state %d:%d top %d (%d:%d:%d) %s\n",
cur_item, item_no - 1,
@ -769,8 +771,10 @@ dlg_buildlist(const char *title,
}
key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result))
break;
if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
was_mouse = (fkey && is_DLGK_MOUSE(key));
if (was_mouse)
@ -1090,6 +1094,9 @@ dlg_buildlist(const char *title,
case DLGK_ENTER:
result = dlg_enter_buttoncode(button);
break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button);
break;
#ifdef KEY_RESIZE
case KEY_RESIZE:
dlg_will_resize(dialog);
@ -1097,9 +1104,7 @@ dlg_buildlist(const char *title,
height = old_height;
width = old_width;
free(prompt);
dlg_clear();
dlg_del_window(dialog);
dlg_mouse_free_regions();
_dlg_resize_cleanup(dialog);
/* repaint */
first = TRUE;
goto retry;
@ -1113,7 +1118,7 @@ dlg_buildlist(const char *title,
beep();
}
}
} else {
} else if (key > 0) {
beep();
}
}
@ -1232,7 +1237,6 @@ dialog_buildlist(const char *title,
if ((show_status = dialog_vars.help_status)) {
if (separate_output) {
dlg_add_string(help_result);
dlg_add_separator();
} else {
dlg_add_quoted(help_result);
}
@ -1245,17 +1249,16 @@ dialog_buildlist(const char *title,
if (show_status) {
for (i = 0; i < item_no; i++) {
if (listitems[i].state) {
if (dlg_need_separator())
dlg_add_separator();
if (separate_output) {
dlg_add_string(listitems[i].name);
dlg_add_separator();
} else {
if (dlg_need_separator())
dlg_add_separator();
dlg_add_quoted(listitems[i].name);
}
}
}
dlg_add_last_key(-1);
AddLastKey();
}
dlg_free_columns(&listitems[0].text, (int) sizeof(DIALOG_LISTITEM), item_no);

View File

@ -1,9 +1,9 @@
/*
* $Id: buttons.c,v 1.99 2018/06/18 22:11:16 tom Exp $
* $Id: buttons.c,v 1.106 2021/01/17 17:03:16 tom Exp $
*
* buttons.c -- draw buttons, e.g., OK/Cancel
*
* Copyright 2000-2017,2018 Thomas E. Dickey
* Copyright 2000-2020,2021 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -35,11 +35,11 @@ static void
center_label(char *buffer, int longest, const char *label)
{
int len = dlg_count_columns(label);
int left = 0, right = 0;
int right = 0;
*buffer = 0;
if (len < longest) {
left = (longest - len) / 2;
int left = (longest - len) / 2;
right = (longest - len - left);
if (left > 0)
sprintf(buffer, "%*s", left, " ");
@ -60,14 +60,16 @@ string_to_char(const char **stringp)
#ifdef USE_WIDE_CURSES
const char *string = *stringp;
size_t have = strlen(string);
size_t check;
size_t len;
wchar_t cmp2[2];
mbstate_t state;
memset(&state, 0, sizeof(state));
len = mbrlen(string, have, &state);
if ((int) len > 0 && len <= have) {
size_t check;
memset(&state, 0, sizeof(state));
memset(cmp2, 0, sizeof(cmp2));
check = mbrtowc(cmp2, string, len, &state);
@ -132,9 +134,10 @@ get_hotkeys(const char **labels)
{
int *result = 0;
size_t count = count_labels(labels);
size_t n;
if ((result = dlg_calloc(int, count + 1)) != 0) {
size_t n;
for (n = 0; n < count; ++n) {
const char *label = labels[n];
const int *indx = dlg_index_wchars(label);
@ -222,7 +225,9 @@ print_button(WINDOW *win, char *label, int hotkey, int y, int x, int selected)
? button_active_attr
: button_inactive_attr);
(void) waddstr(win, ">");
(void) wmove(win, y, x + ((int) (strspn) (label, " ")) + 1);
if (!dialog_vars.cursor_off_label) {
(void) wmove(win, y, x + ((int) (strspn) (label, " ")) + 1);
}
}
/*
@ -281,12 +286,13 @@ dlg_button_x_step(const char **labels, int limit, int *gap, int *margin, int *st
int count = dlg_button_count(labels);
int longest;
int length;
int unused;
int used;
int result;
*margin = 0;
if (count != 0) {
int unused;
int used;
dlg_button_sizes(labels, FALSE, &longest, &length);
used = (length + (count * 2));
unused = limit - used;
@ -312,10 +318,11 @@ dlg_button_x_step(const char **labels, int limit, int *gap, int *margin, int *st
void
dlg_button_layout(const char **labels, int *limit)
{
int width = 1;
int gap, margin, step;
if (labels != 0 && dlg_button_count(labels)) {
int width = 1;
while (!dlg_button_x_step(labels, width, &gap, &margin, &step))
++width;
width += (4 * MARGIN);
@ -338,7 +345,6 @@ dlg_draw_buttons(WINDOW *win,
int limit)
{
chtype save = dlg_get_attrs(win);
int n;
int step = 0;
int length;
int longest;
@ -347,7 +353,6 @@ dlg_draw_buttons(WINDOW *win,
int gap;
int margin;
size_t need;
char *buffer;
dlg_mouse_setbase(getbegx(win), getbegy(win));
@ -368,7 +373,10 @@ dlg_draw_buttons(WINDOW *win,
*/
need = (size_t) longest;
if (need != 0) {
char *buffer;
int n;
int *hotkeys = get_hotkeys(labels);
assert_ptr(hotkeys, "dlg_draw_buttons");
for (n = 0; labels[n] != 0; ++n) {
@ -414,19 +422,21 @@ dlg_draw_buttons(WINDOW *win,
int
dlg_match_char(int ch, const char *string)
{
if (string != 0) {
int cmp2 = string_to_char(&string);
if (!dialog_vars.no_hot_list) {
if (string != 0) {
int cmp2 = string_to_char(&string);
#ifdef USE_WIDE_CURSES
wint_t cmp1 = dlg_toupper(ch);
if (cmp2 != 0 && (wchar_t) cmp1 == (wchar_t) dlg_toupper(cmp2)) {
return TRUE;
}
#else
if (ch > 0 && ch < 256) {
if (dlg_toupper(ch) == dlg_toupper(cmp2))
wint_t cmp1 = dlg_toupper(ch);
if (cmp2 != 0 && (wchar_t) cmp1 == (wchar_t) dlg_toupper(cmp2)) {
return TRUE;
}
}
#else
if (ch > 0 && ch < 256) {
if (dlg_toupper(ch) == dlg_toupper(cmp2))
return TRUE;
}
#endif
}
}
return FALSE;
}
@ -441,8 +451,9 @@ dlg_button_to_char(const char *label)
int cmp = -1;
while (*label != 0) {
cmp = string_to_char(&label);
if (dlg_isupper(cmp)) {
int ch = string_to_char(&label);
if (dlg_isupper(ch)) {
cmp = ch;
break;
}
}
@ -461,11 +472,12 @@ dlg_char_to_button(int ch, const char **labels)
if (labels != 0) {
int *hotkeys = get_hotkeys(labels);
int j;
ch = (int) dlg_toupper(dlg_last_getc());
if (hotkeys != 0) {
int j;
for (j = 0; labels[j] != 0; ++j) {
if (ch == hotkeys[j]) {
dlg_flush_getc();
@ -586,23 +598,42 @@ dlg_exit_buttoncode(int button)
return result;
}
static const char **
finish_ok_label(const char **labels, int n)
{
if (n == 0) {
labels[n++] = my_ok_label();
dialog_vars.nook = FALSE;
dlg_trace_msg("# ignore --nook, since at least one button is needed\n");
}
labels[n] = NULL;
return labels;
}
/*
* Return a list of button labels for the OK (no Cancel) group, used in msgbox
* and progressbox.
*/
const char **
dlg_ok_label(void)
{
static const char *labels[4];
int n = 0;
labels[n++] = my_ok_label();
if (!dialog_vars.nook)
labels[n++] = my_ok_label();
if (dialog_vars.extra_button)
labels[n++] = my_extra_label();
if (dialog_vars.help_button)
labels[n++] = my_help_label();
labels[n] = 0;
return labels;
return finish_ok_label(labels, n);
}
/*
* Return a list of button labels for the OK/Cancel group.
* Return a list of button labels for the OK/Cancel group, used in most widgets
* that select an option or data.
*/
const char **
dlg_ok_labels(void)
@ -618,8 +649,8 @@ dlg_ok_labels(void)
labels[n++] = my_cancel_label();
if (dialog_vars.help_button)
labels[n++] = my_help_label();
labels[n] = 0;
return labels;
return finish_ok_label(labels, n);
}
/*
@ -640,7 +671,8 @@ dlg_ok_buttoncode(int button)
} else if (dialog_vars.help_button && (button == n)) {
result = DLG_EXIT_HELP;
}
DLG_TRACE(("# dlg_ok_buttoncode(%d) = %d\n", button, result));
DLG_TRACE(("# dlg_ok_buttoncode(%d) = %d:%s\n",
button, result, dlg_exitcode2s(result)));
return result;
}
@ -702,10 +734,11 @@ dlg_defaultno_button(void)
int
dlg_default_button(void)
{
int i, n;
int result = 0;
if (dialog_vars.default_button >= 0) {
int i, n;
for (i = 0; (n = dlg_ok_buttoncode(i)) >= 0; i++) {
if (n == dialog_vars.default_button) {
result = i;

View File

@ -1,9 +1,9 @@
/*
* $Id: calendar.c,v 1.97 2018/06/19 22:57:01 tom Exp $
* $Id: calendar.c,v 1.106 2020/11/23 09:03:49 tom Exp $
*
* calendar.c -- implements the calendar box
*
* Copyright 2001-2017,2018 Thomas E. Dickey
* Copyright 2001-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -21,7 +21,7 @@
* Boston, MA 02110, USA.
*/
#include <dialog.h>
#include <dlg_internals.h>
#include <dlg_keys.h>
#include <time.h>
@ -75,16 +75,6 @@ static const char *
nameOfDayOfWeek(int n)
{
static bool shown[MAX_DAYS];
static const char *posix_days[MAX_DAYS] =
{
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
};
while (n < 0) {
n += MAX_DAYS;
@ -101,7 +91,17 @@ nameOfDayOfWeek(int n)
}
#endif
if (cached_days[n] == 0) {
size_t len, limit = MON_WIDE - 1;
static const char *posix_days[MAX_DAYS] =
{
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
};
size_t limit = MON_WIDE - 1;
char *value = dlg_strclone(posix_days[n]);
/*
@ -111,7 +111,7 @@ nameOfDayOfWeek(int n)
* double-width cell. For now (2016/01/26), handle too-long names only
* for POSIX values.
*/
if ((len = strlen(value)) > limit)
if (strlen(value) > limit)
value[limit] = '\0';
cached_days[n] = value;
}
@ -126,21 +126,6 @@ static const char *
nameOfMonth(int n)
{
static bool shown[MAX_MONTHS];
static const char *posix_mons[MAX_MONTHS] =
{
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
while (n < 0) {
n += MAX_MONTHS;
@ -158,6 +143,21 @@ nameOfMonth(int n)
}
#endif
if (cached_months[n] == 0) {
static const char *posix_mons[MAX_MONTHS] =
{
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
cached_months[n] = dlg_strclone(posix_mons[n]);
}
if (!shown[n]) {
@ -301,7 +301,6 @@ iso_week(int year, int month, int day)
if (365 + isleap(year) - diy < MAX_DAYS
&& new_years_eve_dow >= dow
&& new_years_eve_dow < thursday) {
++year;
week = 1;
}
return week;
@ -371,7 +370,7 @@ static int
draw_day(BOX * data, struct tm *current)
{
int cell_wide = MON_WIDE;
int y, x, this_x = 0;
int y, x, this_x;
int save_y = 0, save_x = 0;
int day = current->tm_mday;
int mday;
@ -513,12 +512,11 @@ init_object(BOX * data,
data->box_draw = box_draw;
data->week_start = key_offset;
data->window = derwin(data->parent,
data->height, data->width,
data->y, data->x);
data->window = dlg_der_window(data->parent,
data->height, data->width,
data->y, data->x);
if (data->window == 0)
return -1;
(void) keypad(data->window, TRUE);
dlg_mouse_setbase(getbegx(parent), getbegy(parent));
if (code == 'D') {
@ -715,14 +713,13 @@ dialog_calendar(const char *title,
#endif
BOX dy_box, mn_box, yr_box;
int fkey;
int key = 0;
int key2;
int key;
int step;
int button;
int result = DLG_EXIT_UNKNOWN;
int week_start;
WINDOW *dialog;
time_t now_time = time((time_t *) 0);
time_t now_time;
struct tm current;
int state = dlg_default_button();
const char **buttons = dlg_ok_labels();
@ -746,7 +743,7 @@ dialog_calendar(const char *title,
dlg_does_output();
/*
* Unless overrridden, the current time/date is our starting point.
* Unless overridden, the current time/date is our starting point.
*/
now_time = time((time_t *) 0);
current = *localtime(&now_time);
@ -871,6 +868,7 @@ dialog_calendar(const char *title,
dlg_trace_win(dialog);
while (result == DLG_EXIT_UNKNOWN) {
int key2;
BOX *obj = (state == sDAY ? &dy_box
: (state == sMONTH ? &mn_box :
(state == sYEAR ? &yr_box : 0)));
@ -881,9 +879,10 @@ dialog_calendar(const char *title,
dlg_set_focus(dialog, obj->window);
key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result))
break;
if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
#define Mouse2Key(key) (key - M_EVENT)
if (fkey && (key >= DLGK_MOUSE(KEY_MIN) && key <= DLGK_MOUSE(KEY_MAX))) {
key = dlg_lookup_key(dialog, Mouse2Key(key), &fkey);
@ -907,6 +906,9 @@ dialog_calendar(const char *title,
case DLGK_ENTER:
result = dlg_enter_buttoncode(button);
break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button);
break;
case DLGK_FIELD_PREV:
state = dlg_prev_ok_buttonindex(state, sMONTH);
break;
@ -920,9 +922,7 @@ dialog_calendar(const char *title,
height = old_height;
width = old_width;
free(prompt);
dlg_clear();
dlg_del_window(dialog);
dlg_mouse_free_regions();
_dlg_resize_cleanup(dialog);
/* repaint */
goto retry;
#endif
@ -1010,8 +1010,7 @@ dialog_calendar(const char *title,
DefaultFormat(buffer, current);
dlg_add_result(buffer);
dlg_add_separator();
dlg_add_last_key(-1);
AddLastKey();
return CleanupResult(result, dialog, prompt, &save_vars);
}

View File

@ -1,9 +1,9 @@
/*
* $Id: checklist.c,v 1.160 2018/06/19 22:57:01 tom Exp $
* $Id: checklist.c,v 1.167 2020/11/23 00:37:47 tom Exp $
*
* checklist.c -- implements the checklist box
*
* Copyright 2000-2016,2018 Thomas E. Dickey
* Copyright 2000-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -192,12 +192,11 @@ dlg_checklist(const char *title,
#endif
ALL_DATA all;
int i, j, key2, found, x, y, cur_x, cur_y;
int key = 0, fkey;
int key, fkey;
int button = dialog_state.visit_items ? -1 : dlg_default_button();
int choice = dlg_default_listitem(items);
int scrollamt = 0;
int max_choice;
int was_mouse;
int use_width, list_width, name_width, text_width;
int result = DLG_EXIT_UNKNOWN;
int num_states;
@ -304,8 +303,7 @@ dlg_checklist(const char *title,
* After displaying the prompt, we know how much space we really have.
* Limit the list to avoid overwriting the ok-button.
*/
if (all.use_height + MIN_HIGH > height - cur_y)
all.use_height = height - MIN_HIGH - cur_y;
all.use_height = height - MIN_HIGH - cur_y;
if (all.use_height <= 0)
all.use_height = 1;
@ -379,13 +377,18 @@ dlg_checklist(const char *title,
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
dlg_trace_win(dialog);
while (result == DLG_EXIT_UNKNOWN) {
int was_mouse;
if (button < 0) /* --visit-items */
wmove(dialog, all.box_y + choice + 1, all.box_x + all.check_x + 2);
key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result))
break;
if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
was_mouse = (fkey && is_DLGK_MOUSE(key));
if (was_mouse)
@ -560,6 +563,9 @@ dlg_checklist(const char *title,
case DLGK_ENTER:
result = dlg_enter_buttoncode(button);
break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button);
break;
case DLGK_FIELD_PREV:
button = dlg_prev_button(buttons, button);
dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
@ -577,9 +583,7 @@ dlg_checklist(const char *title,
height = old_height;
width = old_width;
free(prompt);
dlg_clear();
dlg_del_window(dialog);
dlg_mouse_free_regions();
_dlg_resize_cleanup(dialog);
/* repaint */
goto retry;
#endif
@ -592,7 +596,7 @@ dlg_checklist(const char *title,
beep();
}
}
} else {
} else if (key > 0) {
beep();
}
}

View File

@ -1,9 +1,9 @@
/*
* $Id: columns.c,v 1.10 2011/10/20 20:53:55 tom Exp $
* $Id: columns.c,v 1.11 2019/07/25 00:06:38 tom Exp $
*
* columns.c -- implements column-alignment
*
* Copyright 2008-2010,2011 Thomas E. Dickey
* Copyright 2008-2011,2019 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -93,8 +93,6 @@ split_row(char *source, unsigned *offsets, unsigned *widths)
void
dlg_align_columns(char **target, int per_row, int num_rows)
{
int row;
if (column_separator()) {
char **value;
unsigned numcols = 1;
@ -104,6 +102,7 @@ dlg_align_columns(char **target, int per_row, int num_rows)
unsigned *maxwidth;
unsigned realwidth;
unsigned n;
int row;
/* first allocate arrays for workspace */
for (each(row, value)) {
@ -164,10 +163,10 @@ dlg_align_columns(char **target, int per_row, int num_rows)
void
dlg_free_columns(char **target, int per_row, int num_rows)
{
int row;
char **value;
if (column_separator()) {
int row;
char **value;
for (each(row, value)) {
free(*value);
}

View File

@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2018 Free Software Foundation, Inc.
# Copyright 1992-2020 Free Software Foundation, Inc.
timestamp='2018-05-19'
timestamp='2020-08-17'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2018 Free Software Foundation, Inc.
Copyright 1992-2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -84,8 +84,6 @@ if test $# != 0; then
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
@ -96,34 +94,40 @@ trap 'exit 1' 1 2 15
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c" ;
for c in cc gcc c89 c99 ; do
if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
tmp=
# shellcheck disable=SC2172
trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
set_cc_for_build() {
# prevent multiple calls if $tmp is already set
test "$tmp" && return 0
: "${TMPDIR=/tmp}"
# shellcheck disable=SC2039
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
dummy=$tmp/dummy
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c"
for driver in cc gcc c89 c99 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD="$driver"
break
fi
done
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac
}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
@ -138,7 +142,7 @@ Linux|GNU|GNU/*)
# We could probably try harder.
LIBC=gnu
eval "$set_cc_for_build"
set_cc_for_build
cat <<-EOF > "$dummy.c"
#include <features.h>
#if defined(__UCLIBC__)
@ -199,7 +203,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
os=netbsdelf
;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval "$set_cc_for_build"
set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
@ -260,6 +264,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:SolidBSD:*:*)
echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
exit ;;
*:OS108:*:*)
echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
@ -269,12 +276,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:Sortix:*:*)
echo "$UNAME_MACHINE"-unknown-sortix
exit ;;
*:Twizzler:*:*)
echo "$UNAME_MACHINE"-unknown-twizzler
exit ;;
*:Redox:*:*)
echo "$UNAME_MACHINE"-unknown-redox
exit ;;
mips:OSF1:*.*)
echo mips-dec-osf1
exit ;;
echo mips-dec-osf1
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
@ -389,12 +399,12 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
echo i386-pc-auroraux"$UNAME_RELEASE"
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval "$set_cc_for_build"
set_cc_for_build
SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
@ -482,7 +492,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
echo clipper-intergraph-clix"$UNAME_RELEASE"
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval "$set_cc_for_build"
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
@ -534,10 +544,10 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
[ "$TARGET_BINARY_INTERFACE"x = x ]
if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
test "$TARGET_BINARY_INTERFACE"x = x
then
echo m88k-dg-dgux"$UNAME_RELEASE"
else
@ -570,7 +580,7 @@ EOF
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
if test -x /usr/bin/oslevel ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
@ -579,7 +589,7 @@ EOF
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval "$set_cc_for_build"
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h>
@ -610,7 +620,7 @@ EOF
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/lslpp ] ; then
if test -x /usr/bin/lslpp ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
@ -645,7 +655,7 @@ EOF
9000/31?) HP_ARCH=m68000 ;;
9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "$sc_cpu_version" in
@ -659,8 +669,8 @@ EOF
esac ;;
esac
fi
if [ "$HP_ARCH" = "" ]; then
eval "$set_cc_for_build"
if test "$HP_ARCH" = ""; then
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
@ -698,9 +708,9 @@ EOF
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ "$HP_ARCH" = hppa2.0w ]
if test "$HP_ARCH" = hppa2.0w
then
eval "$set_cc_for_build"
set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@ -726,7 +736,7 @@ EOF
echo ia64-hp-hpux"$HPUX_REV"
exit ;;
3050*:HI-UX:*:*)
eval "$set_cc_for_build"
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#include <unistd.h>
int
@ -772,7 +782,7 @@ EOF
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
if test -x /usr/sbin/sysversion ; then
echo "$UNAME_MACHINE"-unknown-osf1mk
else
echo "$UNAME_MACHINE"-unknown-osf1
@ -840,6 +850,17 @@ EOF
*:BSD/OS:*:*)
echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
exit ;;
arm:FreeBSD:*:*)
UNAME_PROCESSOR=`uname -p`
set_cc_for_build
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
else
echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
fi
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case "$UNAME_PROCESSOR" in
@ -881,7 +902,7 @@ EOF
echo "$UNAME_MACHINE"-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
echo x86_64-pc-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
@ -894,8 +915,8 @@ EOF
# other systems with GNU libc and userland
echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
exit ;;
i*86:Minix:*:*)
echo "$UNAME_MACHINE"-pc-minix
*:Minix:*:*)
echo "$UNAME_MACHINE"-unknown-minix
exit ;;
aarch64:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@ -905,7 +926,7 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
@ -922,7 +943,7 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arm*:Linux:*:*)
eval "$set_cc_for_build"
set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
@ -971,23 +992,51 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval "$set_cc_for_build"
set_cc_for_build
IS_GLIBC=0
test x"${LIBC}" = xgnu && IS_GLIBC=1
sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
#undef ${UNAME_MACHINE}
#undef ${UNAME_MACHINE}el
#undef mips
#undef mipsel
#undef mips64
#undef mips64el
#if ${IS_GLIBC} && defined(_ABI64)
LIBCABI=gnuabi64
#else
#if ${IS_GLIBC} && defined(_ABIN32)
LIBCABI=gnuabin32
#else
LIBCABI=${LIBC}
#endif
#endif
#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
CPU=mipsisa64r6
#else
#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
CPU=mipsisa32r6
#else
#if defined(__mips64)
CPU=mips64
#else
CPU=mips
#endif
#endif
#endif
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=${UNAME_MACHINE}el
MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=${UNAME_MACHINE}
MIPS_ENDIAN=
#else
CPU=
MIPS_ENDIAN=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
mips64el:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@ -1046,7 +1095,17 @@ EOF
echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
exit ;;
x86_64:Linux:*:*)
echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
set_cc_for_build
LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_X32 >/dev/null
then
LIBCABI="$LIBC"x32
fi
fi
echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
exit ;;
xtensa*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@ -1100,7 +1159,7 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
@ -1235,7 +1294,7 @@ EOF
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
if test -d /usr/nec; then
echo mips-nec-sysv"$UNAME_RELEASE"
else
echo mips-unknown-sysv"$UNAME_RELEASE"
@ -1283,39 +1342,43 @@ EOF
*:Rhapsody:*:*)
echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;;
arm64:Darwin:*:*)
echo aarch64-apple-darwin"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
eval "$set_cc_for_build"
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
if command -v xcode-select > /dev/null 2> /dev/null && \
! xcode-select --print-path > /dev/null 2> /dev/null ; then
# Avoid executing cc if there is no toolchain installed as
# cc will be a stub that puts up a graphical alert
# prompting the user to install developer tools.
CC_FOR_BUILD=no_compiler_found
else
set_cc_for_build
fi
if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_PPC >/dev/null
then
UNAME_PROCESSOR=powerpc
fi
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_PPC >/dev/null
then
UNAME_PROCESSOR=powerpc
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
# that puts up a graphical alert prompting to install
# developer tools. Any system running Mac OS X 10.7 or
# later (Darwin 11 and later) is required to have a 64-bit
# processor. This is not true of the ARM version of Darwin
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
# uname -m returns i386 or x86_64
UNAME_PROCESSOR=$UNAME_MACHINE
fi
echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;;
@ -1358,6 +1421,7 @@ EOF
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
# shellcheck disable=SC2154
if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
@ -1414,8 +1478,148 @@ EOF
amd64:Isilon\ OneFS:*:*)
echo x86_64-unknown-onefs
exit ;;
*:Unleashed:*:*)
echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
exit ;;
esac
# No uname command or uname output not recognized.
set_cc_for_build
cat > "$dummy.c" <<EOF
#ifdef _SEQUENT_
#include <sys/types.h>
#include <sys/utsname.h>
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#include <signal.h>
#if defined(_SIZE_T_) || defined(SIGLOST)
#include <sys/utsname.h>
#endif
#endif
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
#include <sys/param.h>
#if defined (BSD)
#if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
#else
#if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#endif
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#else
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname un;
uname (&un);
printf ("vax-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname *un;
uname (&un);
printf ("mips-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("mips-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
echo "$0: unable to guess system type" >&2
case "$UNAME_MACHINE:$UNAME_SYSTEM" in
@ -1438,6 +1642,12 @@ copies of config.guess and config.sub with the latest versions from:
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
EOF
year=`echo $timestamp | sed 's,-.*,,'`
# shellcheck disable=SC2003
if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
cat >&2 <<EOF
If $0 has already been updated, send the following data and any
information you think might be pertinent to config-patches@gnu.org to
@ -1465,6 +1675,7 @@ UNAME_RELEASE = "$UNAME_RELEASE"
UNAME_SYSTEM = "$UNAME_SYSTEM"
UNAME_VERSION = "$UNAME_VERSION"
EOF
fi
exit 1

File diff suppressed because it is too large Load Diff

13788
contrib/dialog/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
dnl $Id: configure.in,v 1.92 2018/06/18 08:59:49 tom Exp $
dnl $Id: configure.in,v 1.101 2020/11/26 16:21:27 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl ---------------------------------------------------------------------------
dnl Copyright 1999-2016,2018 -- Thomas E. Dickey
dnl Copyright 1999-2019,2020 -- Thomas E. Dickey
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the
@ -27,7 +27,7 @@ dnl holders shall not be used in advertising or otherwise to promote the
dnl sale, use or other dealings in this Software without prior written
dnl authorization.
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.52.20170501)
AC_PREREQ(2.52.20200802)
AC_INIT(dialog.h)
AC_CONFIG_HEADER(dlg_config.h:config.hin)
@ -63,7 +63,8 @@ CF_XOPEN_SOURCE
CF_LARGEFILE
CF_WITH_INSTALL_PREFIX
CF_WITH_WARNINGS
CF_WITH_SCREEN_PDCURSES
CF_ENABLE_WARNINGS(,yes)
CF_PKG_CONFIG
dnl
@ -113,13 +114,12 @@ CF_ARG_MSG_ENABLE([if you want --trace option],
[EXTRAOBJS="$EXTRAOBJS trace\$o"
AC_DEFINE(HAVE_DLG_TRACE,1,[Define to 1 to support --trace option])],,yes)
CF_ENABLE_RPATH
CF_LD_RPATH_OPT
CF_WITH_SHARED_OR_LIBTOOL(DIALOG,${VERSION_MAJOR}.${VERSION_MINOR},`echo "$VERSION" |sed -e 's/:/./g'`)
CF_WITH_CURSES_DIR
CF_ENABLE_RPATH
CF_WITH_NCURSES_ETC
CF_WIDEC_CURSES
@ -129,11 +129,20 @@ CF_ARG_MSG_ENABLE([if you want extra dialogs],
[ --disable-extras do not include extra dialogs],
[cf_all_widgets=yes],[cf_all_widgets=no],yes)
cf_use_dialogrc=yes
CF_ARG_MSG_ENABLE([if you want config-file support],
rc-file,
[ --disable-rc-file do not include config-file support],
[EXTRAOBJS="$EXTRAOBJS rc\$o"
AC_DEFINE(HAVE_RC_FILE,1,[Define to 1 to include config-file support])],,$cf_all_widgets)
AC_DEFINE(HAVE_RC_FILE,1,[Define to 1 to include config-file support])],cf_use_dialogrc=no,$cf_all_widgets)
cf_use_dialogrc2=yes
if test "$cf_use_dialogrc" = yes; then
CF_ARG_MSG_ENABLE([if you want extra attributes in config-file],
rc-file2,
[ --disable-rc-file2 do not use extra attributes in config-file],
[AC_DEFINE(HAVE_RC_FILE2,1,[Define to 1 to use extra attributes in config-file])],cf_use_dialogrc2=no,$cf_all_widgets)
fi
CF_ARG_MSG_ENABLE([if you want Xdialog-style dialogs],
Xdialog,
@ -195,7 +204,7 @@ dnl
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_CHECK_HEADERS(search.h stdint.h unistd.h)
AC_CHECK_HEADERS(search.h stdint.h sys/param.h unistd.h)
CF_CURSES_TERM_H
dnl
@ -203,7 +212,6 @@ dnl Checks for library functions.
dnl
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(\
_nc_free_and_exit \
btowc \
mblen \
mbrlen \
@ -241,6 +249,8 @@ wget_wch \
wsyncup \
)
CF_CURSES_EXIT
AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR,1,[Define to 1 if (n)curses has start_color function])])
CF_CURSES_CHTYPE
CF_CURSES_WACS_SYMBOLS
@ -254,9 +264,11 @@ CF_HEADERS_SH(DLG,dlg_config.h)
AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE,1,[Define to 1 if locale feature can be enabled])])
CF_NL_LANGINFO_1STDAY
CF_MERGE_EXTRA_CFLAGS
CF_DISABLE_RPATH_HACK
CF__DEFINE_SHLIB_VARS
CF_LD_SEARCHPATH
AC_OUTPUT(
dialog-config

View File

@ -1,7 +1,7 @@
#!@SHELL@
# $Id: dialog-config.in,v 1.6 2012/10/06 14:29:45 tom Exp $
# $Id: dialog-config.in,v 1.13 2019/09/26 00:50:46 tom Exp $
##############################################################################
# Copyright (c) 2007-2011,2012 Thomas E. Dickey #
# Copyright (c) 2007-2012,2019 Thomas E. Dickey #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -32,16 +32,79 @@ prefix="@prefix@"
exec_prefix="@exec_prefix@"
datarootdir="@datarootdir@"
bindir="@bindir@"
libdir="@libdir@"
datadir="@datadir@"
mandir="@mandir@"
same_prefix=yes
same_exec_prefix=yes
THIS="@PACKAGE@"
test $# = 0 && exec @SHELL@ $0 --error
test $# = 0 && exec @SHELL@ "$0" --error
while test $# -gt 0; do
# (re)evaluate symbols that may depend upon $prefix
if [ "x$same_prefix" != "xyes" ]
then
eval exec_prefix='@exec_prefix@'
eval datarootdir='@datarootdir@'
elif [ "x$same_exec_prefix" != "xyes" ]
then
eval datarootdir='@datarootdir@'
fi
eval bindir='"@bindir@"'
eval includedir='"@includedir@"'
eval libdir='"@libdir@"'
eval datadir='"@datadir@"'
eval mandir='"@mandir@"'
[ -z "$includedir" ] && includedir="${prefix}/include"
eval LDFLAGS='"@LDFLAGS@"'
eval LIBS='"@LIBS@"'
LIBS="-l${THIS} $LIBS"
# If the directory given by --libdir is not in the LDFLAGS+LIBS set,
# prepend it to LDFLAGS to help link this application's library.
found=no
for opt in $LDFLAGS $LIBS
do
if [ "x$-L${libdir}" = "x$opt" ]
then
found=yes
break
fi
done
if [ $found = no ]
then
[ -n "$LFLAGS" ] && LDFLAGS=" $LFDLAGS"
LDFLAGS="-L${libdir}$LDFLAGS"
fi
[ -z "$LDFLAGS" ] && LDFLAGS="-L${exec_prefix}/lib"
# Ignore -L options which do not correspond to an actual directory,
# or which are standard library directories (i.e., the linker is
# supposed to search those directories).
#
# There is no portable way to find the list of standard library
# directories. Require a POSIX shell anyway, to keep this simple.
lib_flags=
for opt in $LDFLAGS $LIBS
do
case $opt in
-L*)
[ -d ${opt##-L} ] || continue
case ${opt##-L} in
@LD_SEARCHPATH@) # skip standard libdir
continue
;;
*)
;;
esac
;;
esac
lib_flags="$lib_flags $opt"
done
case "$1" in
-*=*)
ARG=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
@ -56,30 +119,81 @@ while test $# -gt 0; do
--prefix=*)
prefix="$ARG"
test -z "$exec_prefix" && exec_prefix="$ARG"
same_prefix=no
;;
--prefix)
echo "$prefix"
;;
--exec-prefix=*)
exec_prefix="$ARG"
same_exec_prefix=no
;;
--exec-prefix)
echo "$exec_prefix"
;;
# compile/link
--cflags)
--cflags|--cflags-only-I)
INCS=
if test "${prefix}/include" != /usr/include ; then
INCS="-I${prefix}/include"
if test "$includedir" != /usr/include ; then
INCS="-I$includedir"
fi
sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
$INCS
ENDECHO
;;
--cflags-only-other)
# no -D/-U options should be needed
echo
;;
--libs)
sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
-L${exec_prefix}/lib -l${THIS} @LIBS@
ENDECHO
OPTS=
for opt in $lib_flags
do
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
done
printf "%s\n" "$OPTS"
;;
--libs-only-L)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-L*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf "%s\n" "$OPTS"
;;
--libs-only-l)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-l*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf "%s\n" "$OPTS"
;;
--libs-only-other)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-[lL]*)
;;
*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf "%s\n" "$OPTS"
;;
# identification
--version)
@ -115,19 +229,23 @@ Options:
--cflags echos the C compiler flags needed to compile with ${THIS}
--libs echos the libraries needed to link with ${THIS}
--libs-only-L echos -L linker options (search path) for ${THIS}
--libs-only-l echos -l linker options (libraries) for ${THIS}
--libs-only-other echos linker options other than -L/-l
--version echos the release+patchdate version of ${THIS}
--abi-version echos the ABI version of ${THIS}
--bindir echos the directory containing ${THIS} programs
--datadir echos the directory containing ${THIS} data
--libdir echos the directory containing ${THIS} libraries
--mandir echos the directory containing ${THIS} manpages
--mandir echos the directory containing ${THIS} manual pages
--help prints this message
ENDHELP
;;
--error|*)
@SHELL@ $0 --help 1>&2
@SHELL@ "$0" --help 1>&2
exit 1
;;
esac

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
/*
* $Id: dialog.h,v 1.283 2018/06/19 22:52:11 tom Exp $
* $Id: dialog.h,v 1.304 2021/01/17 16:58:22 tom Exp $
*
* dialog.h -- common declarations for all dialog modules
*
* Copyright 2000-2017,2018 Thomas E. Dickey
* Copyright 2000-2020,2021 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -126,14 +126,27 @@
#define USE_SHADOW TRUE
#define USE_COLORS TRUE
/*
* These allow using the print-formatting code before curses is initialized.
*/
#define DLG_COLS (COLS ? COLS : dialog_state.screen_width)
#define DLG_LINES (LINES ? LINES : dialog_state.screen_height)
/*
* Define the usable size of a window, discounting the area needed for shadow.
*/
#ifdef HAVE_COLOR
#define SCOLS (COLS - (dialog_state.use_shadow ? SHADOW_COLS : 0))
#define SLINES (LINES - (dialog_state.use_shadow ? SHADOW_ROWS : 0))
#define SCOLS (DLG_COLS - (dialog_state.use_shadow ? SHADOW_COLS : 0))
#define SLINES (DLG_LINES - (dialog_state.use_shadow ? SHADOW_ROWS : 0))
#else
#define SCOLS COLS
#define SLINES LINES
#endif
/*
* These are the default values for exit-codes, which can be overridden by
* environment variables, e.g., $DIALOG_CANCEL for DLG_EXIT_CANCEL.
*/
#define DLG_EXIT_ESC 255
#define DLG_EXIT_UNKNOWN -2 /* never return this (internal use) */
#define DLG_EXIT_ERROR -1 /* the shell sees this as 255 */
@ -142,19 +155,21 @@
#define DLG_EXIT_HELP 2
#define DLG_EXIT_EXTRA 3
#define DLG_EXIT_ITEM_HELP 4 /* actually DLG_EXIT_HELP */
#define DLG_EXIT_TIMEOUT 5
#define DLG_CTRL(n) ((n) & 0x1f) /* CTRL is preferred, but conflicts */
#define CHR_LEAVE DLG_CTRL('D')
#define CHR_HELP DLG_CTRL('E')
#define CHR_BACKSPACE DLG_CTRL('H')
#define CHR_REPAINT DLG_CTRL('L')
#define CHR_KILL DLG_CTRL('U')
#define CHR_LITERAL DLG_CTRL('V')
#define CHR_DELETE 127
#define CHR_NEXT DLG_CTRL('N')
#define CHR_PREVIOUS DLG_CTRL('P')
#define CHR_KILL DLG_CTRL('U')
#define CHR_TRACE DLG_CTRL('T')
#define CHR_LITERAL DLG_CTRL('V')
#define CHR_SPACE ' '
#define CHR_DELETE 127
#define ESC 27
#define TAB DLG_CTRL('I')
@ -179,6 +194,7 @@
/* how many spaces is a tab long (default)? */
#define TAB_LEN 8
#define WTIMEOUT_VAL 10 /* minimum amount of time needed for curses */
#define WTIMEOUT_OFF -1 /* value to disable timeout */
#ifndef A_CHARTEXT
#define A_CHARTEXT 0xff
@ -429,6 +445,7 @@ typedef struct _dlg_windows {
struct _dlg_windows *next;
WINDOW *normal;
WINDOW *shadow;
int getc_timeout;
} DIALOG_WINDOWS;
/*
@ -467,6 +484,13 @@ typedef struct {
bool text_only; /* option "--print-text-only", etc. */
int text_height;
int text_width;
/* 1.3-20190211 */
int screen_height;
int screen_width;
#ifdef KEY_RESIZE
/* 1.3-20190724 */
bool had_resize; /* ERR may follow KEY_RESIZE when polling */
#endif
} DIALOG_STATE;
extern DIALOG_STATE dialog_state;
@ -552,6 +576,13 @@ typedef struct {
bool iso_week; /* option "--iso-week" */
/* 1.3-20170131 */
bool reorder; /* option "--reorder" */
/* 1.3-20201117 */
int pause_secs; /* used by pause widget */
/* 1.3-20201126 */
bool erase_on_exit; /* option "--erase-on-exit" */
bool cursor_off_label; /* option "--cursor-off-label" */
/* 1.3-20210117 */
bool no_hot_list; /* option "--no-hot-list" */
} DIALOG_VARS;
#define USE_ITEM_HELP(s) (dialog_vars.item_help && (s) != 0)
@ -595,12 +626,16 @@ extern DIALOG_VARS dialog_vars;
* Table for attribute- and color-values.
*/
typedef struct {
chtype atr;
chtype atr; /* attribute corresponding to fg, bg, etc */
#ifdef HAVE_COLOR
int fg;
int bg;
int hilite;
#endif
int fg; /* foreground color-number */
int bg; /* background color-number */
int hilite; /* true if bold */
#ifdef HAVE_RC_FILE2
int ul; /* true if underline */
int rv; /* true if reverse */
#endif /* HAVE_RC_FILE2 */
#endif /* HAVE_COLOR */
#ifdef HAVE_RC_FILE
const char *name;
const char *comment;
@ -768,16 +803,20 @@ extern void dlg_remove_callback(DIALOG_CALLBACK * /*p*/);
extern void dlg_killall_bg(int *retval);
/* util.c */
extern DIALOG_WINDOWS * _dlg_find_window(WINDOW * /* win */);
extern WINDOW * dlg_der_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
extern WINDOW * dlg_new_modal_window(WINDOW * /*parent*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
extern WINDOW * dlg_new_window(int /*height*/, int /*width*/, int /*y*/, int /*x*/);
extern WINDOW * dlg_sub_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
extern bool dlg_need_separator(void);
extern char * dlg_getenv_str(const char * /*name*/);
extern char * dlg_set_result(const char * /*string*/);
extern char * dlg_strclone(const char * /*cprompt*/);
extern char * dlg_strempty(void);
extern chtype dlg_asciibox(chtype /*ch*/);
extern chtype dlg_boxchar(chtype /*ch*/);
extern chtype dlg_get_attrs(WINDOW * /*win*/);
extern const char * dlg_exitcode2s(int /*code*/);
extern const char * dlg_print_line(WINDOW * /*win*/, chtype * /*attr*/, const char * /*prompt*/, int /*lm*/, int /*rm*/, int * /*x*/);
extern int dlg_box_x_ordinate(int /*width*/);
extern int dlg_box_y_ordinate(int /*height*/);
@ -789,8 +828,11 @@ extern int dlg_default_item(char ** /*items*/, int /*llen*/);
extern int dlg_default_listitem(DIALOG_LISTITEM * /*items*/);
extern int dlg_defaultno_button(void);
extern int dlg_default_button(void);
extern int dlg_exitname2n(const char * /*name*/);
extern int dlg_getenv_num(const char * /*name*/, int * /* value */);
extern int dlg_max_input(int /*max_len*/);
extern int dlg_print_scrolled(WINDOW * /* win */, const char * /* prompt */, int /* offset */, int /* height */, int /* width */, int /* pauseopt */);
extern int dlg_set_timeout(WINDOW * /* win */, bool /* will_getc */);
extern void dlg_add_help_formitem(int * /* result */, char ** /* tag */, DIALOG_FORMITEM * /* item */);
extern void dlg_add_help_listitem(int * /* result */, char ** /* tag */, DIALOG_LISTITEM * /* item */);
extern void dlg_add_quoted(char * /*string*/);
@ -814,11 +856,13 @@ extern void dlg_draw_box2(WINDOW * /*win*/, int /*y*/, int /*x*/, int /*height*/
extern void dlg_draw_title(WINDOW *win, const char *title);
extern void dlg_exit(int /*code*/) GCC_NORETURN;
extern void dlg_item_help(const char * /*txt*/);
extern void dlg_keep_tite(FILE * /*output */);
extern void dlg_print_autowrap(WINDOW * /*win*/, const char * /*prompt*/, int /*height*/, int /*width*/);
extern void dlg_print_listitem(WINDOW * /*win*/, const char * /*text*/, int /*climit*/, bool /*first*/, int /*selected*/);
extern void dlg_print_size(int /*height*/, int /*width*/);
extern void dlg_print_text(WINDOW * /*win*/, const char * /*txt*/, int /*len*/, chtype * /*attr*/);
extern void dlg_put_backtitle(void);
extern void dlg_reset_timeout(WINDOW * /* win */);
extern void dlg_restore_vars(DIALOG_VARS * /* save */);
extern void dlg_save_vars(DIALOG_VARS * /* save */);
extern void dlg_set_focus(WINDOW * /*parent*/, WINDOW * /*win*/);
@ -845,6 +889,7 @@ extern int dlg_strcmp(const char * /*a*/, const char * /*b*/);
#ifdef HAVE_DLG_TRACE
#define DLG_TRACE(params) dlg_trace_msg params
extern void dlg_trace_msg(const char *fmt, ...) GCC_PRINTFLIKE(1,2);
extern void dlg_trace_va_msg(const char *fmt, va_list ap);
#define DLG_TRACE2S(name,value) dlg_trace_2s (name,value)
#define DLG_TRACE2N(name,value) dlg_trace_2n (name,value)
extern void dlg_trace_2s(const char * /*name*/, const char * /*value*/);
@ -856,12 +901,14 @@ extern void dlg_trace(const char * /*fname*/);
#define DLG_TRACE(params) /* nothing */
#define DLG_TRACE2S(name,value) /* nothing */
#define DLG_TRACE2N(name,value) /* nothing */
#define dlg_trace_va_msg(fmt, ap) /* nothing */
#define dlg_trace_win(win) /* nothing */
#define dlg_trace_chr(ch,fkey) /* nothing */
#define dlg_trace(fname) /* nothing */
#endif
#ifdef KEY_RESIZE
extern void _dlg_resize_cleanup(WINDOW * /*win*/);
extern void dlg_move_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
extern void dlg_will_resize(WINDOW * /*win*/);
#endif
@ -937,10 +984,15 @@ extern int dlg_mouse_wgetch_nowait (WINDOW * /*win*/, int * /*fkey*/);
*/
#ifdef NO_LEAKS
extern void _dlg_inputstr_leaks(void);
#if defined(NCURSES_VERSION) && defined(HAVE__NC_FREE_AND_EXIT)
#if defined(NCURSES_VERSION)
#if defined(HAVE_CURSES_EXIT)
/* just use curses_exit() */
#elif defined(HAVE__NC_FREE_AND_EXIT)
extern void _nc_free_and_exit(int); /* nc_alloc.h normally not installed */
#define curses_exit(code) _nc_free_and_exit(code)
#endif
#endif
#endif /* NCURSES_VERSION */
#endif /* NO_LEAKS */
#ifdef __cplusplus
}

View File

@ -1,9 +1,9 @@
/*
* $Id: dlg_colors.h,v 1.17 2011/10/14 21:19:59 tom Exp $
* $Id: dlg_colors.h,v 1.18 2019/09/23 09:14:30 tom Exp $
*
* colors.h -- color attribute definitions
*
* Copyright 2000-2007,2011 Thomas E. Dickey
* Copyright 2000-2011,2019 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -35,158 +35,236 @@
* DLGC_FG_xxx = foreground for "xxx"
* DLGC_BG_xxx = background for "xxx"
* DLGC_HL_xxx = highlight for "xxx"
* DLGC_UL_xxx = underline for "xxx"
* DLGC_RV_xxx = reverse for "xxx"
*/
#define DLGC_FG_SCREEN COLOR_CYAN
#define DLGC_BG_SCREEN COLOR_BLUE
#define DLGC_HL_SCREEN TRUE
#define DLGC_UL_SCREEN FALSE
#define DLGC_RV_SCREEN FALSE
#define DLGC_FG_SHADOW COLOR_BLACK
#define DLGC_BG_SHADOW COLOR_BLACK
#define DLGC_HL_SHADOW TRUE
#define DLGC_UL_SHADOW FALSE
#define DLGC_RV_SHADOW FALSE
#define DLGC_FG_DIALOG COLOR_BLACK
#define DLGC_BG_DIALOG COLOR_WHITE
#define DLGC_HL_DIALOG FALSE
#define DLGC_UL_DIALOG FALSE
#define DLGC_RV_DIALOG FALSE
#define DLGC_FG_TITLE COLOR_BLUE
#define DLGC_BG_TITLE COLOR_WHITE
#define DLGC_HL_TITLE TRUE
#define DLGC_UL_TITLE FALSE
#define DLGC_RV_TITLE FALSE
#define DLGC_FG_BORDER COLOR_WHITE
#define DLGC_BG_BORDER COLOR_WHITE
#define DLGC_HL_BORDER TRUE
#define DLGC_UL_BORDER FALSE
#define DLGC_RV_BORDER FALSE
#define DLGC_FG_BORDER2 DLGC_FG_DIALOG
#define DLGC_BG_BORDER2 DLGC_BG_DIALOG
#define DLGC_HL_BORDER2 DLGC_HL_DIALOG
#define DLGC_UL_BORDER2 FALSE
#define DLGC_RV_BORDER2 FALSE
#define DLGC_FG_BUTTON_ACTIVE COLOR_WHITE
#define DLGC_BG_BUTTON_ACTIVE COLOR_BLUE
#define DLGC_HL_BUTTON_ACTIVE TRUE
#define DLGC_UL_BUTTON_ACTIVE FALSE
#define DLGC_RV_BUTTON_ACTIVE FALSE
#define DLGC_FG_BUTTON_INACTIVE COLOR_BLACK
#define DLGC_BG_BUTTON_INACTIVE COLOR_WHITE
#define DLGC_HL_BUTTON_INACTIVE FALSE
#define DLGC_UL_BUTTON_INACTIVE FALSE
#define DLGC_RV_BUTTON_INACTIVE FALSE
#define DLGC_FG_BUTTON_KEY_ACTIVE COLOR_WHITE
#define DLGC_BG_BUTTON_KEY_ACTIVE COLOR_BLUE
#define DLGC_HL_BUTTON_KEY_ACTIVE TRUE
#define DLGC_UL_BUTTON_KEY_ACTIVE FALSE
#define DLGC_RV_BUTTON_KEY_ACTIVE FALSE
#define DLGC_FG_BUTTON_KEY_INACTIVE COLOR_RED
#define DLGC_BG_BUTTON_KEY_INACTIVE COLOR_WHITE
#define DLGC_HL_BUTTON_KEY_INACTIVE FALSE
#define DLGC_UL_BUTTON_KEY_INACTIVE FALSE
#define DLGC_RV_BUTTON_KEY_INACTIVE FALSE
#define DLGC_FG_BUTTON_LABEL_ACTIVE COLOR_YELLOW
#define DLGC_BG_BUTTON_LABEL_ACTIVE COLOR_BLUE
#define DLGC_HL_BUTTON_LABEL_ACTIVE TRUE
#define DLGC_UL_BUTTON_LABEL_ACTIVE FALSE
#define DLGC_RV_BUTTON_LABEL_ACTIVE FALSE
#define DLGC_FG_BUTTON_LABEL_INACTIVE COLOR_BLACK
#define DLGC_BG_BUTTON_LABEL_INACTIVE COLOR_WHITE
#define DLGC_HL_BUTTON_LABEL_INACTIVE TRUE
#define DLGC_UL_BUTTON_LABEL_INACTIVE FALSE
#define DLGC_RV_BUTTON_LABEL_INACTIVE FALSE
#define DLGC_FG_FORM_ITEM_READONLY COLOR_CYAN
#define DLGC_BG_FORM_ITEM_READONLY COLOR_WHITE
#define DLGC_HL_FORM_ITEM_READONLY TRUE
#define DLGC_UL_FORM_ITEM_READONLY FALSE
#define DLGC_RV_FORM_ITEM_READONLY FALSE
#define DLGC_FG_INPUTBOX COLOR_BLACK
#define DLGC_BG_INPUTBOX COLOR_WHITE
#define DLGC_HL_INPUTBOX FALSE
#define DLGC_UL_INPUTBOX FALSE
#define DLGC_RV_INPUTBOX FALSE
#define DLGC_FG_INPUTBOX_BORDER COLOR_BLACK
#define DLGC_BG_INPUTBOX_BORDER COLOR_WHITE
#define DLGC_HL_INPUTBOX_BORDER FALSE
#define DLGC_UL_INPUTBOX_BORDER FALSE
#define DLGC_RV_INPUTBOX_BORDER FALSE
#define DLGC_FG_INPUTBOX_BORDER2 DLGC_FG_INPUTBOX
#define DLGC_BG_INPUTBOX_BORDER2 DLGC_BG_INPUTBOX
#define DLGC_HL_INPUTBOX_BORDER2 DLGC_HL_INPUTBOX
#define DLGC_UL_INPUTBOX_BORDER2 FALSE
#define DLGC_RV_INPUTBOX_BORDER2 FALSE
#define DLGC_FG_SEARCHBOX COLOR_BLACK
#define DLGC_BG_SEARCHBOX COLOR_WHITE
#define DLGC_HL_SEARCHBOX FALSE
#define DLGC_UL_SEARCHBOX FALSE
#define DLGC_RV_SEARCHBOX FALSE
#define DLGC_FG_SEARCHBOX_TITLE COLOR_BLUE
#define DLGC_BG_SEARCHBOX_TITLE COLOR_WHITE
#define DLGC_HL_SEARCHBOX_TITLE TRUE
#define DLGC_UL_SEARCHBOX_TITLE FALSE
#define DLGC_RV_SEARCHBOX_TITLE FALSE
#define DLGC_FG_SEARCHBOX_BORDER COLOR_WHITE
#define DLGC_BG_SEARCHBOX_BORDER COLOR_WHITE
#define DLGC_HL_SEARCHBOX_BORDER TRUE
#define DLGC_UL_SEARCHBOX_BORDER FALSE
#define DLGC_RV_SEARCHBOX_BORDER FALSE
#define DLGC_FG_SEARCHBOX_BORDER2 DLGC_FG_SEARCHBOX
#define DLGC_BG_SEARCHBOX_BORDER2 DLGC_BG_SEARCHBOX
#define DLGC_HL_SEARCHBOX_BORDER2 DLGC_HL_SEARCHBOX
#define DLGC_UL_SEARCHBOX_BORDER2 FALSE
#define DLGC_RV_SEARCHBOX_BORDER2 FALSE
#define DLGC_FG_POSITION_INDICATOR COLOR_BLUE
#define DLGC_BG_POSITION_INDICATOR COLOR_WHITE
#define DLGC_HL_POSITION_INDICATOR TRUE
#define DLGC_UL_POSITION_INDICATOR FALSE
#define DLGC_RV_POSITION_INDICATOR FALSE
#define DLGC_FG_MENUBOX COLOR_BLACK
#define DLGC_BG_MENUBOX COLOR_WHITE
#define DLGC_HL_MENUBOX FALSE
#define DLGC_UL_MENUBOX FALSE
#define DLGC_RV_MENUBOX FALSE
#define DLGC_FG_MENUBOX_BORDER COLOR_WHITE
#define DLGC_BG_MENUBOX_BORDER COLOR_WHITE
#define DLGC_HL_MENUBOX_BORDER TRUE
#define DLGC_UL_MENUBOX_BORDER FALSE
#define DLGC_RV_MENUBOX_BORDER FALSE
#define DLGC_FG_MENUBOX_BORDER2 DLGC_FG_MENUBOX
#define DLGC_BG_MENUBOX_BORDER2 DLGC_BG_MENUBOX
#define DLGC_HL_MENUBOX_BORDER2 DLGC_HL_MENUBOX
#define DLGC_UL_MENUBOX_BORDER2 FALSE
#define DLGC_RV_MENUBOX_BORDER2 FALSE
#define DLGC_FG_ITEM COLOR_BLACK
#define DLGC_BG_ITEM COLOR_WHITE
#define DLGC_HL_ITEM FALSE
#define DLGC_UL_ITEM FALSE
#define DLGC_RV_ITEM FALSE
#define DLGC_FG_ITEM_SELECTED COLOR_WHITE
#define DLGC_BG_ITEM_SELECTED COLOR_BLUE
#define DLGC_HL_ITEM_SELECTED TRUE
#define DLGC_UL_ITEM_SELECTED FALSE
#define DLGC_RV_ITEM_SELECTED FALSE
#define DLGC_FG_TAG COLOR_BLUE
#define DLGC_BG_TAG COLOR_WHITE
#define DLGC_HL_TAG TRUE
#define DLGC_UL_TAG FALSE
#define DLGC_RV_TAG FALSE
#define DLGC_FG_TAG_SELECTED COLOR_YELLOW
#define DLGC_BG_TAG_SELECTED COLOR_BLUE
#define DLGC_HL_TAG_SELECTED TRUE
#define DLGC_UL_TAG_SELECTED FALSE
#define DLGC_RV_TAG_SELECTED FALSE
#define DLGC_FG_TAG_KEY COLOR_RED
#define DLGC_BG_TAG_KEY COLOR_WHITE
#define DLGC_HL_TAG_KEY FALSE
#define DLGC_UL_TAG_KEY FALSE
#define DLGC_RV_TAG_KEY FALSE
#define DLGC_FG_TAG_KEY_SELECTED COLOR_RED
#define DLGC_BG_TAG_KEY_SELECTED COLOR_BLUE
#define DLGC_HL_TAG_KEY_SELECTED TRUE
#define DLGC_UL_TAG_KEY_SELECTED FALSE
#define DLGC_RV_TAG_KEY_SELECTED FALSE
#define DLGC_FG_CHECK COLOR_BLACK
#define DLGC_BG_CHECK COLOR_WHITE
#define DLGC_HL_CHECK FALSE
#define DLGC_UL_CHECK FALSE
#define DLGC_RV_CHECK FALSE
#define DLGC_FG_CHECK_SELECTED COLOR_WHITE
#define DLGC_BG_CHECK_SELECTED COLOR_BLUE
#define DLGC_HL_CHECK_SELECTED TRUE
#define DLGC_UL_CHECK_SELECTED FALSE
#define DLGC_RV_CHECK_SELECTED FALSE
#define DLGC_FG_UARROW COLOR_GREEN
#define DLGC_BG_UARROW COLOR_WHITE
#define DLGC_HL_UARROW TRUE
#define DLGC_UL_UARROW FALSE
#define DLGC_RV_UARROW FALSE
#define DLGC_FG_DARROW COLOR_GREEN
#define DLGC_BG_DARROW COLOR_WHITE
#define DLGC_HL_DARROW TRUE
#define DLGC_UL_DARROW FALSE
#define DLGC_RV_DARROW FALSE
#define DLGC_FG_ITEMHELP COLOR_WHITE
#define DLGC_BG_ITEMHELP COLOR_BLACK
#define DLGC_HL_ITEMHELP FALSE
#define DLGC_UL_ITEMHELP FALSE
#define DLGC_RV_ITEMHELP FALSE
#define DLGC_FG_FORM_ACTIVE_TEXT COLOR_WHITE
#define DLGC_BG_FORM_ACTIVE_TEXT COLOR_BLUE
#define DLGC_HL_FORM_ACTIVE_TEXT TRUE
#define DLGC_UL_FORM_ACTIVE_TEXT FALSE
#define DLGC_RV_FORM_ACTIVE_TEXT FALSE
#define DLGC_FG_FORM_TEXT COLOR_WHITE
#define DLGC_BG_FORM_TEXT COLOR_CYAN
#define DLGC_HL_FORM_TEXT TRUE
#define DLGC_UL_FORM_TEXT FALSE
#define DLGC_RV_FORM_TEXT FALSE
#define DLGC_FG_GAUGE COLOR_BLUE
#define DLGC_BG_GAUGE COLOR_WHITE
#define DLGC_HL_GAUGE TRUE
#define DLGC_UL_GAUGE FALSE
#define DLGC_RV_GAUGE FALSE
/* End of default color definitions */

View File

@ -0,0 +1,47 @@
/*
* $Id: dlg_internals.h,v 1.3 2019/08/08 21:29:41 tom Exp $
*
* dlg_internals.h -- runtime binding support for dialog
*
* Copyright 2019 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to
* Free Software Foundation, Inc.
* 51 Franklin St., Fifth Floor
* Boston, MA 02110, USA.
*/
#ifndef DLG_INTERNALS_H_included
#define DLG_INTERNALS_H_included 1
#include <dialog.h>
#define TableSize(name) (sizeof(name)/sizeof((name)[0]))
/* *INDENT-OFF* */
#define resizeit(name, NAME) \
name = ((NAME >= old_##NAME) \
? (NAME - (old_##NAME - old_##name)) \
: old_##name)
#define AddLastKey() \
if (dialog_vars.last_key) { \
if (dlg_need_separator()) \
dlg_add_separator(); \
dlg_add_last_key(-1); \
}
/* *INDENT-ON* */
#endif /* DLG_INTERNALS_H_included */

View File

@ -1,9 +1,9 @@
/*
* $Id: dlg_keys.c,v 1.45 2018/05/28 17:27:10 tom Exp $
* $Id: dlg_keys.c,v 1.58 2020/11/26 17:11:56 Glenn.Herteg Exp $
*
* dlg_keys.c -- runtime binding support for dialog
*
* Copyright 2006-2017,2018 Thomas E. Dickey
* Copyright 2006-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -23,12 +23,12 @@
#include <dialog.h>
#include <dlg_keys.h>
#include <dlg_internals.h>
#define LIST_BINDINGS struct _list_bindings
#define CHR_BACKSLASH '\\'
#define IsOctal(ch) ((ch) >= '0' && (ch) <= '7')
#define TableSize(name) (sizeof(name)/sizeof(name[0]))
LIST_BINDINGS {
LIST_BINDINGS *link;
@ -129,6 +129,10 @@ dlg_register_buttons(WINDOW *win, const char *name, const char **buttons)
for (n = 0; buttons[n] != 0; ++n) {
int curses_key = dlg_button_to_char(buttons[n]);
/* ignore binding if there is no key to bind */
if (curses_key < 0)
continue;
/* ignore multibyte characters */
if (curses_key >= KEY_MIN)
continue;
@ -274,12 +278,26 @@ dlg_result_key(int dialog_key, int fkey GCC_UNUSED, int *resultp)
{
int done = FALSE;
DLG_TRACE(("# dlg_result_key(dialog_key=%d, fkey=%d)\n", dialog_key, fkey));
#ifdef KEY_RESIZE
if (dialog_state.had_resize) {
if (dialog_key == ERR) {
dialog_key = 0;
} else {
dialog_state.had_resize = FALSE;
}
} else if (fkey && dialog_key == KEY_RESIZE) {
dialog_state.had_resize = TRUE;
}
#endif
#ifdef HAVE_RC_FILE
if (fkey) {
switch ((DLG_KEYS_ENUM) dialog_key) {
case DLGK_OK:
*resultp = DLG_EXIT_OK;
done = TRUE;
if (!dialog_vars.nook) {
*resultp = DLG_EXIT_OK;
done = TRUE;
}
break;
case DLGK_CANCEL:
if (!dialog_vars.nocancel) {
@ -319,6 +337,70 @@ dlg_result_key(int dialog_key, int fkey GCC_UNUSED, int *resultp)
return done;
}
/*
* If a key was bound to one of the button-codes in dlg_result_key(), fake
* a button-value and an "Enter" key to cause the calling widget to return
* the corresponding status.
*
* See dlg_ok_buttoncode(), which maps settings for ok/extra/help and button
* number into exit-code.
*/
int
dlg_button_key(int exit_code, int *button, int *dialog_key, int *fkey)
{
int changed = FALSE;
switch (exit_code) {
case DLG_EXIT_OK:
if (!dialog_vars.nook) {
*button = 0;
changed = TRUE;
}
break;
case DLG_EXIT_EXTRA:
if (dialog_vars.extra_button) {
*button = dialog_vars.nook ? 0 : 1;
changed = TRUE;
}
break;
case DLG_EXIT_CANCEL:
if (!dialog_vars.nocancel) {
*button = dialog_vars.nook ? 1 : 2;
changed = TRUE;
}
break;
case DLG_EXIT_HELP:
if (dialog_vars.help_button) {
int cancel = dialog_vars.nocancel ? 0 : 1;
int extra = dialog_vars.extra_button ? 1 : 0;
int okay = dialog_vars.nook ? 0 : 1;
*button = okay + extra + cancel;
changed = TRUE;
}
break;
}
if (changed) {
DLG_TRACE(("# dlg_button_key(%d:%s) button %d\n",
exit_code, dlg_exitcode2s(exit_code), *button));
*dialog_key = *fkey = DLGK_ENTER;
}
return changed;
}
int
dlg_ok_button_key(int exit_code, int *button, int *dialog_key, int *fkey)
{
int result;
DIALOG_VARS save;
dlg_save_vars(&save);
dialog_vars.nocancel = TRUE;
result = dlg_button_key(exit_code, button, dialog_key, fkey);
dlg_restore_vars(&save);
return result;
}
#ifdef HAVE_RC_FILE
typedef struct {
const char *name;
@ -463,7 +545,8 @@ static const CODENAME dialog_names[] =
DIALOG_NAME(SELECT),
DIALOG_NAME(HELPFILE),
DIALOG_NAME(TRACE),
DIALOG_NAME(TOGGLE)
DIALOG_NAME(TOGGLE),
DIALOG_NAME(LEAVE)
};
#define MAP2(letter,actual) { letter, actual }
@ -563,13 +646,13 @@ make_binding(char *widget, int curses_key, int is_function, int dialog_key)
LIST_BINDINGS *entry = 0;
DLG_KEYS_BINDING *data = 0;
char *name;
LIST_BINDINGS *p, *q;
DLG_KEYS_BINDING *result = find_binding(widget, curses_key);
if (result == 0
&& (entry = dlg_calloc(LIST_BINDINGS, 1)) != 0
&& (data = dlg_calloc(DLG_KEYS_BINDING, 2)) != 0
&& (name = dlg_strclone(widget)) != 0) {
LIST_BINDINGS *p, *q;
entry->name = name;
entry->binding = data;
@ -606,7 +689,6 @@ make_binding(char *widget, int curses_key, int is_function, int dialog_key)
static int
decode_escaped(char **string)
{
unsigned n;
int result = 0;
if (IsOctal(**string)) {
@ -617,6 +699,8 @@ decode_escaped(char **string)
result = (result << 3) | (ch - '0');
}
} else {
unsigned n;
for (n = 0; n < TableSize(escaped_letters); ++n) {
if (**string == escaped_letters[n].letter) {
*string += 1;
@ -663,13 +747,8 @@ int
dlg_parse_bindkey(char *params)
{
char *p = skip_white(params);
char *q;
bool escaped = FALSE;
int modified = 0;
int result = FALSE;
unsigned xx;
char *widget;
int is_function = FALSE;
int curses_key;
int dialog_key;
@ -679,6 +758,12 @@ dlg_parse_bindkey(char *params)
p = skip_black(p);
if (p != widget && *p != '\0') {
char *q;
unsigned xx;
bool escaped = FALSE;
int modified = 0;
int is_function = FALSE;
*p++ = '\0';
p = skip_white(p);
q = p;
@ -715,7 +800,7 @@ dlg_parse_bindkey(char *params)
char fprefix[2];
char check[2];
int keynumber;
if (sscanf(q, "%[Ff]%d%c", fprefix, &keynumber, check) == 2) {
if (sscanf(q, "%1[Ff]%d%c", fprefix, &keynumber, check) == 2) {
curses_key = KEY_F(keynumber);
is_function = TRUE;
} else {

View File

@ -1,9 +1,9 @@
/*
* $Id: dlg_keys.h,v 1.36 2016/08/28 21:23:17 tom Exp $
* $Id: dlg_keys.h,v 1.39 2020/11/22 23:19:24 tom Exp $
*
* dlg_keys.h -- runtime binding support for dialog
*
* Copyright 2005-2012,2016 Thomas E. Dickey
* Copyright 2005-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -97,7 +97,8 @@ typedef enum {
DLGK_SELECT,
DLGK_HELPFILE,
DLGK_TRACE,
DLGK_TOGGLE
DLGK_TOGGLE,
DLGK_LEAVE
} DLG_KEYS_ENUM;
#define is_DLGK_MOUSE(code) ((code) >= M_EVENT)
@ -111,7 +112,8 @@ typedef enum {
#define ENTERKEY_BINDINGS \
DLG_KEYS_DATA( DLGK_ENTER, '\n' ), \
DLG_KEYS_DATA( DLGK_ENTER, '\r' ), \
DLG_KEYS_DATA( DLGK_ENTER, KEY_ENTER )
DLG_KEYS_DATA( DLGK_ENTER, KEY_ENTER ), \
DLG_KEYS_DATA( DLGK_LEAVE, CHR_LEAVE )
/* ^U == 21 */
#define INPUTSTR_BINDINGS \
@ -158,7 +160,9 @@ typedef enum {
#define TOGGLEKEY_BINDINGS \
DLG_KEYS_DATA( DLGK_TOGGLE, CHR_SPACE )
extern int dlg_button_key(int /*exit_code*/, int * /*button*/, int * /*dialog_key*/, int * /*fkey*/);
extern int dlg_lookup_key(WINDOW * /*win*/, int /*curses_key*/, int * /*dialog_key*/);
extern int dlg_ok_button_key(int /*exit_code*/, int * /*button*/, int * /*dialog_key*/, int * /*fkey*/);
extern int dlg_result_key(int /*dialog_key*/, int /*fkey*/, int * /*resultp*/);
extern void dlg_register_buttons(WINDOW * /*win*/, const char * /*name*/, const char ** /*buttons*/);
extern void dlg_register_window(WINDOW * /*win*/, const char * /*name*/, DLG_KEYS_BINDING * /*binding*/);

View File

@ -1,12 +1,13 @@
/*
* $Id: editbox.c,v 1.70 2018/06/19 22:57:01 tom Exp $
* $Id: editbox.c,v 1.80 2020/11/23 00:27:21 tom Exp $
*
* editbox.c -- implements the edit box
*
* Copyright 2007-2016,2018 Thomas E. Dickey
* Copyright 2007-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@ -54,11 +55,8 @@ grow_list(char ***list, int *have, int want)
static void
load_list(const char *file, char ***list, int *rows)
{
FILE *fp;
char *blob = 0;
struct stat sb;
unsigned n, pass;
unsigned need;
size_t size;
*list = 0;
@ -72,6 +70,9 @@ load_list(const char *file, char ***list, int *rows)
if ((blob = dlg_malloc(char, size + 2)) == 0) {
fail_list();
} else {
FILE *fp;
unsigned n, pass;
blob[size] = '\0';
if ((fp = fopen(file, "r")) == 0)
@ -89,7 +90,8 @@ load_list(const char *file, char ***list, int *rows)
for (pass = 0; pass < 2; ++pass) {
int first = TRUE;
need = 0;
unsigned need = 0;
for (n = 0; n < size; ++n) {
if (first && pass) {
(*list)[need] = blob + n;
@ -273,7 +275,8 @@ col_to_chr_offset(const char *text, int col)
return result;
}
#define SCROLL_TO(target) show_all = scroll_to(pagesize, listsize, &base_row, &thisrow, target)
#define Scroll_To(target) scroll_to(pagesize, listsize, &base_row, &thisrow, target)
#define SCROLL_TO(target) show_all = Scroll_To(target)
#define PREV_ROW (*list)[thisrow - 1]
#define THIS_ROW (*list)[thisrow]
@ -285,9 +288,10 @@ static int
widest_line(char **list)
{
int result = MAX_LEN;
char *value;
if (list != 0) {
char *value;
while ((value = *list++) != 0) {
int check = (int) strlen(value);
if (check > result)
@ -355,8 +359,8 @@ dlg_editbox(const char *title,
int result = DLG_EXIT_UNKNOWN;
int state;
size_t max_len = (size_t) dlg_max_input(widest_line(*list));
char *input, *buffer;
bool show_all, show_one, was_mouse;
char *buffer;
bool show_all, show_one;
bool first_trace = TRUE;
WINDOW *dialog;
WINDOW *editing;
@ -436,7 +440,8 @@ dlg_editbox(const char *title,
pagesize = getmaxy(editing);
while (result == DLG_EXIT_UNKNOWN) {
int edit = 0;
bool was_mouse;
char *input;
if (show_all) {
display_all(editing, *list, thisrow, base_row, listsize, chr_offset);
@ -510,8 +515,10 @@ dlg_editbox(const char *title,
break;
}
if (state != sTEXT) {
if (dlg_result_key(key, fkey, &result))
break;
if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &code, &key, &fkey))
break;
}
}
was_mouse = (fkey && is_DLGK_MOUSE(key));
@ -552,6 +559,8 @@ dlg_editbox(const char *title,
}
if (state == sTEXT) { /* editing box selected */
int edit = 0;
/*
* Intercept scrolling keys that dlg_edit_string() does not
* understand.
@ -608,7 +617,7 @@ dlg_editbox(const char *title,
}
--listsize;
--thisrow;
SCROLL_TO(thisrow);
(void) Scroll_To(thisrow);
show_all = TRUE;
}
@ -687,24 +696,26 @@ dlg_editbox(const char *title,
chr_offset = 0;
col_offset = 0;
THIS_ROW = tmp;
SCROLL_TO(thisrow);
(void) Scroll_To(thisrow);
show_all = TRUE;
} else {
result = dlg_ok_buttoncode(state);
result = dlg_enter_buttoncode(state);
}
break;
case DLGK_LEAVE:
if (state >= 0)
result = dlg_ok_buttoncode(state);
break;
#ifdef KEY_RESIZE
case KEY_RESIZE:
dlg_will_resize(dialog);
/* reset data */
height = old_height;
width = old_width;
dlg_clear();
dlg_unregister_window(editing);
dlg_del_window(editing);
dlg_del_window(dialog);
dlg_mouse_free_regions();
/* repaint */
dlg_del_window(editing);
dlg_unregister_window(editing);
_dlg_resize_cleanup(dialog);
goto retry;
#endif
case DLGK_TOGGLE:
@ -718,7 +729,7 @@ dlg_editbox(const char *title,
beep();
break;
}
} else {
} else if (key > 0) {
beep();
}
}

View File

@ -1,9 +1,9 @@
/*
* $Id: formbox.c,v 1.95 2018/06/21 08:23:31 tom Exp $
* $Id: formbox.c,v 1.103 2021/01/17 22:19:05 tom Exp $
*
* formbox.c -- implements the form (i.e., some pairs label/editbox)
*
* Copyright 2003-2016,2018 Thomas E. Dickey
* Copyright 2003-2020,2021 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -151,12 +151,13 @@ static int
set_choice(DIALOG_FORMITEM item[], int choice, int item_no, bool * noneditable)
{
int result = -1;
int i;
*noneditable = FALSE;
if (!is_readonly(&item[choice])) {
result = choice;
} else {
int i;
for (i = 0; i < item_no; i++) {
if (!is_readonly(&(item[i]))) {
result = i;
@ -292,7 +293,6 @@ scroll_next(WINDOW *win, DIALOG_FORMITEM item[], int stepsize, int *choice, int
int old_scroll = *scrollamt;
int old_row = MIN(item[old_choice].text_y, item[old_choice].name_y);
int target = old_scroll + stepsize;
int n;
if (stepsize < 0) {
if (old_row != old_scroll)
@ -309,6 +309,8 @@ scroll_next(WINDOW *win, DIALOG_FORMITEM item[], int stepsize, int *choice, int
}
if (result) {
int n;
for (n = 0; item[n].name != 0; ++n) {
if (item[n].text_flen > 0) {
int new_row = MIN(item[n].text_y, item[n].name_y);
@ -392,7 +394,6 @@ make_FORM_ELTs(DIALOG_FORMITEM * item,
sprintf(item[i].text, "%.*s", item[i].text_ilen, old_text);
if (item[i].text_free) {
item[i].text_free = FALSE;
free(old_text);
}
item[i].text_free = TRUE;
@ -500,7 +501,6 @@ dlg_form(const char *title,
: sTEXT);
int x, y, cur_x, cur_y, box_x, box_y;
int code;
int key = 0;
int fkey;
int choice = dlg_default_formitem(items);
int new_choice, new_scroll;
@ -608,6 +608,7 @@ dlg_form(const char *title,
while (result == DLG_EXIT_UNKNOWN) {
int edit = FALSE;
int key;
if (scroll_changed) {
print_form(form, items, item_no, scrollamt, choice);
@ -658,8 +659,9 @@ dlg_form(const char *title,
}
key = dlg_mouse_wgetch((state == sTEXT) ? form : dialog, &fkey);
if (dlg_result_key(key, fkey, &result))
if (dlg_result_key(key, fkey, &result)) {
break;
}
/* handle non-functionkeys */
if (!fkey) {
@ -697,6 +699,10 @@ dlg_form(const char *title,
dlg_del_window(dialog);
result = (state >= 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
continue;
case DLGK_LEAVE:
if (state >= 0)
result = dlg_ok_buttoncode(state);
break;
case DLGK_GRID_LEFT:
if (state == sTEXT)
@ -780,10 +786,8 @@ dlg_form(const char *title,
height = old_height;
width = old_width;
free(prompt);
dlg_clear();
_dlg_resize_cleanup(dialog);
dlg_unregister_window(form);
dlg_del_window(dialog);
dlg_mouse_free_regions();
/* repaint */
goto retry;
#endif

View File

@ -1,9 +1,9 @@
/*
* $Id: fselect.c,v 1.102 2018/06/21 23:28:04 tom Exp $
* $Id: fselect.c,v 1.115 2021/01/16 17:19:15 tom Exp $
*
* fselect.c -- implements the file-selector box
*
* Copyright 2000-2017,2018 Thomas E. Dickey
* Copyright 2000-2020,2021 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -21,7 +21,7 @@
* Boston, MA 02110, USA.
*/
#include <dialog.h>
#include <dlg_internals.h>
#include <dlg_keys.h>
#include <sys/types.h>
@ -125,9 +125,9 @@ data_of(LIST * list)
static void
free_list(LIST * list, int reinit)
{
int n;
if (list->data != 0) {
int n;
for (n = 0; list->data[n] != 0; n++)
free(list->data[n]);
free(list->data);
@ -173,13 +173,14 @@ keep_visible(LIST * list)
static int
find_choice(char *target, LIST * list)
{
int n;
int choice = list->choice;
int len_1, len_2, cmp_1, cmp_2;
if (*target == 0) {
list->choice = 0;
} else {
int n;
int len_1, cmp_1;
/* find the match with the longest length. If more than one has the
* same length, choose the one with the closest match of the final
* character.
@ -189,6 +190,7 @@ find_choice(char *target, LIST * list)
for (n = 0; n < list->length; n++) {
char *a = target;
char *b = list->data[n];
int len_2, cmp_2;
len_2 = 0;
while ((*a != 0) && (*b != 0) && (*a == *b)) {
@ -216,13 +218,13 @@ find_choice(char *target, LIST * list)
static void
display_list(LIST * list)
{
int n;
int x;
int y;
int top;
int bottom;
if (list->win != 0) {
int n;
int x;
int y;
int top;
int bottom;
dlg_attr_clear(list->win, getmaxy(list->win), getmaxx(list->win), item_attr);
for (n = list->offset; n < list->length && list->data[n]; n++) {
y = n - list->offset;
@ -264,16 +266,17 @@ display_list(LIST * list)
* that is really required is that they're distinct, so we can put them in a
* switch statement.
*/
#if USE_MOUSE
static void
fix_arrows(LIST * list)
{
int x;
int y;
int top;
int right;
int bottom;
if (list->win != 0) {
int x;
int y;
int top;
int right;
int bottom;
getparyx(list->win, y, x);
top = y - 1;
right = getmaxx(list->win);
@ -290,6 +293,10 @@ fix_arrows(LIST * list)
}
}
#else
#define fix_arrows(list) /* nothing */
#endif
static bool
show_list(char *target, LIST * list, bool keep)
{
@ -356,18 +363,29 @@ match(char *name, LIST * d_list, LIST * f_list, MATCH * match_list)
size_t test_len = strlen(test);
char **matches = dlg_malloc(char *, (size_t) (d_list->length + f_list->length));
size_t data_len = 0;
int i;
for (i = 2; i < d_list->length; i++) {
if (strncmp(test, d_list->data[i], test_len) == 0) {
matches[data_len++] = d_list->data[i];
if (matches != 0) {
int i;
char **new_ptr;
for (i = 2; i < d_list->length; i++) {
if (strncmp(test, d_list->data[i], test_len) == 0) {
matches[data_len++] = d_list->data[i];
}
}
for (i = 0; i < f_list->length; i++) {
if (strncmp(test, f_list->data[i], test_len) == 0) {
matches[data_len++] = f_list->data[i];
}
}
if ((new_ptr = dlg_realloc(char *, data_len + 1, matches)) != 0) {
matches = new_ptr;
} else {
free(matches);
matches = 0;
data_len = 0;
}
}
for (i = 0; i < f_list->length; i++) {
if (strncmp(test, f_list->data[i], test_len) == 0) {
matches[data_len++] = f_list->data[i];
}
}
matches = dlg_realloc(char *, data_len + 1, matches);
match_list->data = matches;
match_list->length = (int) data_len;
}
@ -386,11 +404,11 @@ complete(char *name, LIST * d_list, LIST * f_list, char **buff_ptr)
char *test;
size_t test_len;
size_t i;
int j;
char *buff;
match(name, d_list, f_list, &match_list);
if (match_list.length == 0) {
free(match_list.data);
*buff_ptr = NULL;
return 0;
}
@ -406,6 +424,8 @@ complete(char *name, LIST * d_list, LIST * f_list, char **buff_ptr)
i++;
}
} else {
int j;
for (i = 0; i < test_len; i++) {
char test_char = test[i];
if (test_char == '\0')
@ -433,12 +453,9 @@ fill_lists(char *current, char *input, LIST * d_list, LIST * f_list, bool keep)
{
bool result = TRUE;
bool rescan = FALSE;
DIR *dp;
DIRENT *de;
struct stat sb;
int n;
char path[MAX_LEN + 1];
char *leaf;
/* check if we've updated the lists */
for (n = 0; current[n] && input[n]; n++) {
@ -457,7 +474,9 @@ fill_lists(char *current, char *input, LIST * d_list, LIST * f_list, bool keep)
}
if (rescan) {
DIR *dp;
size_t have = strlen(input);
char *leaf;
if (have > MAX_LEN)
have = MAX_LEN;
@ -477,6 +496,8 @@ fill_lists(char *current, char *input, LIST * d_list, LIST * f_list, bool keep)
}
DLG_TRACE(("opendir '%s'\n", path));
if ((dp = opendir(path)) != 0) {
DIRENT *de;
while ((de = readdir(dp)) != 0) {
size_t len = NAMLEN(de);
if (len == 0 || (len + have + 2) >= MAX_LEN)
@ -624,10 +645,8 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
#ifdef KEY_RESIZE
retry:
#endif
dlg_auto_size(title, (char *) 0, &height, &width, 6, 25);
height += MIN_HIGH + min_items;
if (width < min_wide)
width = min_wide;
dlg_auto_size(title, "", &height, &width, MIN_HIGH + min_items, min_wide);
dlg_print_size(height, width);
dlg_ctl_size(height, width);
@ -651,13 +670,12 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
tbox_y = height - (BTN_HIGH * 2) + MARGIN;
tbox_x = (width - tbox_width) / 2;
w_text = derwin(dialog, tbox_height, tbox_width, tbox_y, tbox_x);
w_text = dlg_der_window(dialog, tbox_height, tbox_width, tbox_y, tbox_x);
if (w_text == 0) {
result = DLG_EXIT_ERROR;
goto finish;
}
(void) keypad(w_text, TRUE);
dlg_draw_box(dialog, tbox_y - MARGIN, tbox_x - MARGIN,
(2 * MARGIN + 1), tbox_width + (MARGIN + EXT_WIDE),
menubox_border_attr, menubox_border2_attr);
@ -678,13 +696,12 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
dbox_y = (2 * MARGIN + 1);
dbox_x = tbox_x;
w_work = derwin(dialog, dbox_height, dbox_width, dbox_y, dbox_x);
w_work = dlg_der_window(dialog, dbox_height, dbox_width, dbox_y, dbox_x);
if (w_work == 0) {
result = DLG_EXIT_ERROR;
goto finish;
}
(void) keypad(w_work, TRUE);
(void) mvwaddstr(dialog, dbox_y - (MARGIN + 1), dbox_x - MARGIN, d_label);
dlg_draw_box(dialog,
dbox_y - MARGIN, dbox_x - MARGIN,
@ -699,13 +716,12 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
fbox_y = dbox_y;
fbox_x = tbox_x + dbox_width + (2 * MARGIN);
w_work = derwin(dialog, fbox_height, fbox_width, fbox_y, fbox_x);
w_work = dlg_der_window(dialog, fbox_height, fbox_width, fbox_y, fbox_x);
if (w_work == 0) {
result = DLG_EXIT_ERROR;
goto finish;
}
(void) keypad(w_work, TRUE);
(void) mvwaddstr(dialog, fbox_y - (MARGIN + 1), fbox_x - MARGIN, f_label);
dlg_draw_box(dialog,
fbox_y - MARGIN, fbox_x - MARGIN,
@ -763,8 +779,10 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
fix_arrows(&d_list);
fix_arrows(&f_list);
key = dlg_mouse_wgetch((state == sTEXT) ? w_text : dialog, &fkey);
if (dlg_result_key(key, fkey, &result))
break;
if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
}
if (key == DLGK_TOGGLE) {
@ -851,6 +869,10 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
case DLGK_ENTER:
result = (state > 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
continue;
case DLGK_LEAVE:
if (state >= 0)
result = dlg_ok_buttoncode(state);
break;
#ifdef KEY_RESIZE
case KEY_RESIZE:
dlg_will_resize(dialog);
@ -861,10 +883,9 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
*current = 0;
resized = TRUE;
/* repaint */
dlg_clear();
dlg_del_window(dialog);
refresh();
dlg_mouse_free_regions();
free_list(&d_list, FALSE);
free_list(&f_list, FALSE);
_dlg_resize_cleanup(dialog);
goto retry;
#endif
default:
@ -903,12 +924,12 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
first = FALSE;
state = sTEXT;
}
} else if (state >= 0 &&
(code = dlg_char_to_button(key, buttons)) >= 0) {
} else if ((code = dlg_char_to_button(key, buttons)) >= 0) {
result = dlg_ok_buttoncode(code);
break;
}
}
AddLastKey();
dlg_unregister_window(w_text);
dlg_del_window(dialog);

View File

@ -1,9 +1,9 @@
/*
* $Id: guage.c,v 1.76 2018/06/21 08:23:43 tom Exp $
* $Id: guage.c,v 1.83 2020/03/27 20:54:43 tom Exp $
*
* guage.c -- implements the gauge dialog
*
* Copyright 2000-2015,2018 Thomas E. Dickey
* Copyright 2000-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -119,9 +119,10 @@ static void
repaint_text(MY_OBJ * obj)
{
WINDOW *dialog = obj->obj.win;
int i, x;
if (dialog != 0) {
int i, x;
(void) werase(dialog);
dlg_draw_box2(dialog, 0, 0, obj->height, obj->width, dialog_attr,
border_attr, border2_attr);
@ -301,7 +302,7 @@ dlg_reallocate_gauge(void *objptr,
int percent)
{
char *prompt = dlg_strclone(cprompt);
MY_OBJ *obj = objptr;
MY_OBJ *obj;
bool save_finish_string = dialog_state.finish_string;
dialog_state.finish_string = TRUE;
@ -377,6 +378,10 @@ dlg_free_gauge(void *objptr)
MY_OBJ *obj = (MY_OBJ *) objptr;
if (valid(obj)) {
if (obj->title)
free(obj->title);
if (obj->prompt)
free(obj->prompt);
obj->obj.keep_win = FALSE;
dlg_remove_callback(&(obj->obj));
delink(obj);
@ -422,7 +427,6 @@ dialog_gauge(const char *title,
MY_OBJ *oldobj = obj;
dlg_will_resize(obj->obj.win);
dlg_mouse_free_regions();
obj = dlg_allocate_gauge(title,
cprompt,
@ -436,9 +440,8 @@ dialog_gauge(const char *title,
oldobj->obj.keep_win = FALSE;
/* remove the old version of the gauge */
dlg_clear();
_dlg_resize_cleanup(oldobj->obj.win);
dlg_remove_callback(&(oldobj->obj));
refresh();
dlg_add_callback_ref((DIALOG_CALLBACK **) & obj, my_cleanup);
dlg_update_gauge(obj, obj->percent);

View File

@ -1,9 +1,9 @@
/*
* $Id: inputbox.c,v 1.84 2018/06/21 23:29:35 tom Exp $
* $Id: inputbox.c,v 1.93 2021/01/17 16:36:37 tom Exp $
*
* inputbox.c -- implements the input box
*
* Copyright 2000-2016,2018 Thomas E. Dickey
* Copyright 2000-2020,2021 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -24,7 +24,7 @@
* Savio Lam (lam836@cs.cuhk.hk)
*/
#include <dialog.h>
#include <dlg_internals.h>
#include <dlg_keys.h>
#define sTEXT -1
@ -37,6 +37,11 @@
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ), \
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_UP )
#define BTN_HIGH 1
#define HDR_HIGH 1
#define MIN_HIGH (HDR_HIGH + (MARGIN * 2 + 1) + (BTN_HIGH + MARGIN * 2))
#define MIN_WIDE 26
/*
* Display a dialog box for entering a string
*/
@ -107,13 +112,13 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
key = fkey = 0;
if (init != NULL) {
dlg_auto_size(title, prompt, &height, &width, 5,
MIN(MAX(dlg_count_columns(init) + 7, 26),
dlg_auto_size(title, prompt, &height, &width, MIN_HIGH,
MIN(MAX(dlg_count_columns(init) + 7, MIN_WIDE),
SCOLS - (dialog_vars.begin_set ?
dialog_vars.begin_x : 0)));
chr_offset = (int) strlen(init);
} else {
dlg_auto_size(title, prompt, &height, &width, 5, 26);
dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MIN_WIDE);
}
dlg_button_layout(buttons, &width);
dlg_print_size(height, width);
@ -156,9 +161,8 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
wsyncup(editor);
wcursyncup(editor);
}
while (result == DLG_EXIT_UNKNOWN) {
int edit = 0;
while (result == DLG_EXIT_UNKNOWN) {
/*
* The last field drawn determines where the cursor is shown:
*/
@ -178,8 +182,10 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
wcursyncup(editor);
}
key = dlg_mouse_wgetch((state == sTEXT) ? editor : dialog, &fkey);
if (dlg_result_key(key, fkey, &result))
break;
if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &code, &key, &fkey))
break;
}
}
/*
@ -194,7 +200,7 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
}
if (state == sTEXT) { /* Input box selected */
edit = dlg_edit_string(input, &chr_offset, key, fkey, first);
int edit = dlg_edit_string(input, &chr_offset, key, fkey, first);
if (edit) {
dlg_show_string(editor, input, chr_offset, inputbox_attr,
@ -236,6 +242,10 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
dlg_del_window(dialog);
result = (state >= 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
break;
case DLGK_LEAVE:
if (state >= 0)
result = dlg_ok_buttoncode(state);
break;
#ifdef KEY_RESIZE
case KEY_RESIZE:
dlg_will_resize(dialog);
@ -243,20 +253,18 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
height = old_height;
width = old_width;
/* repaint */
dlg_clear();
dlg_del_window(dialog);
refresh();
dlg_mouse_free_regions();
_dlg_resize_cleanup(dialog);
goto retry;
#endif
default:
beep();
break;
}
} else {
} else if (key > 0) {
beep();
}
}
AddLastKey();
dlg_unregister_window(editor);
dlg_del_window(dialog);

View File

@ -1,9 +1,9 @@
/*
* $Id: inputstr.c,v 1.88 2018/06/18 22:10:54 tom Exp $
* $Id: inputstr.c,v 1.91 2021/01/17 22:19:05 tom Exp $
*
* inputstr.c -- functions for input/display of a string
*
* Copyright 2000-2017,2018 Thomas E. Dickey
* Copyright 2000-2019,2021 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -204,7 +204,6 @@ static CACHE my_cache;
static bool
same_cache2(CACHE * cache, const char *string, unsigned i_len)
{
unsigned need;
size_t s_len = strlen(string);
bool result = TRUE;
@ -212,8 +211,8 @@ same_cache2(CACHE * cache, const char *string, unsigned i_len)
|| cache->s_len < s_len
|| cache->list == 0
|| !SAME_CACHE(cache, string, (size_t) s_len)) {
unsigned need = (i_len + 1);
need = (i_len + 1);
if (cache->list == 0) {
cache->list = dlg_malloc(int, need);
} else if (cache->i_len < i_len) {
@ -322,10 +321,11 @@ dlg_count_wchars(const char *string)
mbstate_t state;
int part = dlg_count_wcbytes(cache->string, len);
char save = cache->string[part];
size_t code;
wchar_t *temp = dlg_calloc(wchar_t, len + 1);
if (temp != 0) {
size_t code;
cache->string[part] = '\0';
memset(&state, 0, sizeof(state));
code = mbsrtowcs(temp, &src, (size_t) part, &state);
@ -353,11 +353,11 @@ const int *
dlg_index_wchars(const char *string)
{
unsigned len = (unsigned) dlg_count_wchars(string);
unsigned inx;
CACHE *cache = load_cache(cInxWideChars, string);
if (!same_cache2(cache, string, len)) {
const char *current = string;
unsigned inx;
cache->list[0] = 0;
for (inx = 1; inx <= len; ++inx) {
@ -407,25 +407,27 @@ const int *
dlg_index_columns(const char *string)
{
unsigned len = (unsigned) dlg_count_wchars(string);
unsigned inx;
CACHE *cache = load_cache(cInxCols, string);
if (!same_cache2(cache, string, len)) {
cache->list[0] = 0;
#ifdef USE_WIDE_CURSES
if (have_locale()) {
unsigned inx;
size_t num_bytes = strlen(string);
const int *inx_wchars = dlg_index_wchars(string);
mbstate_t state;
for (inx = 0; inx < len; ++inx) {
wchar_t temp[2];
size_t check;
int result;
if (string[inx_wchars[inx]] == TAB) {
result = ((cache->list[inx] | 7) + 1) - cache->list[inx];
} else {
wchar_t temp[2];
size_t check;
memset(&state, 0, sizeof(state));
memset(temp, 0, sizeof(temp));
check = mbrtowc(temp,
@ -452,6 +454,8 @@ dlg_index_columns(const char *string)
} else
#endif /* USE_WIDE_CURSES */
{
unsigned inx;
for (inx = 0; inx < len; ++inx) {
chtype ch = UCH(string[inx]);

View File

@ -1,7 +1,7 @@
# $Id: makefile.in,v 1.97 2018/06/09 01:05:18 tom Exp $
# $Id: makefile.in,v 1.103 2021/01/11 09:03:36 tom Exp $
# template makefile for DIALOG
##############################################################################
# Copyright (c) 1999-2017,2018 Thomas E. Dickey #
# Copyright (c) 1999-2020,2021 Thomas E. Dickey #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -102,6 +102,7 @@ LINT_OPTS = @LINT_OPTS@
CTAGS = @CTAGS@
ETAGS = @ETAGS@
RPATH_LIST = @RPATH_LIST@
LIBTOOL = @LIBTOOL@ @ECHO_LT@
LIBTOOL_OPTS = @LIBTOOL_OPTS@
LIBTOOL_CLEAN = @LIB_CLEAN@
@ -141,7 +142,7 @@ PROG = @PACKAGE@$x
@ECHO_CC@$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c $<
@NROFF_NOTE@.1.txt :
@NROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | nroff -Tascii -man | col -bx" >$@
@NROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | nroff -rHY=0 -Tascii -man | col -bx" >$@
@MAN2HTML_NOTE@.1.html :
@MAN2HTML_NOTE@ ./@MAN2HTML_TEMP@ $* 1 man >$@
@ -203,7 +204,7 @@ all :: $(ALL)
dialog$o \
$(OBJECTS) : $(srcdir)/dialog.h $(srcdir)/dlg_keys.h dlg_config.h VERSION
$(PROG)$x : $(LIB) dialog$o @INTLDIR_MAKE@ @INTLLIBS@
$(PROG) : $(LIB) dialog$o @INTLDIR_MAKE@ @INTLLIBS@
$(LINK) -o $@ dialog$o -L. -l@PACKAGE@ $(CFLAGS) $(LDFLAGS) $(LIBS)
clean \
@ -232,6 +233,10 @@ distclean :: clean
$(RM) man2html.*
$(RM) dialog-config
check :
@echo "Verify that create-rc works"
$(SHELL) -c "DIALOG=./$(PROG) ./run_test.sh $(srcdir)/samples"
install :: install-bin install-man
@echo "made $@"

View File

@ -1,9 +1,9 @@
/*
* $Id: menubox.c,v 1.159 2018/06/21 23:28:56 tom Exp $
* $Id: menubox.c,v 1.171 2020/11/23 21:03:11 tom Exp $
*
* menubox.c -- implements the menu box
*
* Copyright 2000-2016,2018 Thomas E. Dickey
* Copyright 2000-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public Licens, version 2.1e
@ -24,7 +24,7 @@
* Savio Lam (lam836@cs.cuhk.hk)
*/
#include <dialog.h>
#include <dlg_internals.h>
#include <dlg_keys.h>
typedef enum {
@ -68,7 +68,6 @@ print_item(ALL_DATA * data,
bool is_inputmenu)
{
chtype save = dlg_get_attrs(win);
int n;
int climit = (data->item_x - data->tag_x - GUTTER);
int my_width = data->menu_width;
int my_x = data->item_x;
@ -95,6 +94,8 @@ print_item(ALL_DATA * data,
/* Clear 'residue' of last item and mark current current item */
if (is_inputmenu) {
int n;
dlg_attrset(win, (selected != Unselected) ? item_selected_attr : item_attr);
for (n = my_y - 1; n < my_y + INPUT_ROWS - 1; n++) {
wmove(win, n, 0);
@ -165,8 +166,18 @@ input_menu_edit(ALL_DATA * data,
/* taken out of inputbox.c - but somewhat modified */
for (;;) {
if (!first)
if (!first) {
int check = DLG_EXIT_UNKNOWN;
key = dlg_mouse_wgetch(data->menu, &fkey);
if (dlg_result_key(key, fkey, &check)) {
if (check == DLG_EXIT_CANCEL) {
code = FALSE;
break;
} else {
flash();
}
}
}
if (dlg_edit_string(result, &offset, key, fkey, first)) {
dlg_show_string(data->menu, result, offset, inputbox_attr,
y,
@ -203,6 +214,7 @@ handle_button(int code, DIALOG_LISTITEM * items, int choice)
dlg_add_string(help_result);
break;
}
AddLastKey();
return code;
}
@ -215,6 +227,7 @@ dlg_renamed_menutext(DIALOG_LISTITEM * items, int current, char *newtext)
dlg_add_string(items[current].name);
dlg_add_result(" ");
dlg_add_string(newtext);
AddLastKey();
return DLG_EXIT_EXTRA;
}
@ -338,13 +351,12 @@ dlg_menu(const char *title,
#endif
ALL_DATA all;
int i, j, x, y, cur_x, cur_y;
int key = 0, fkey;
int fkey;
int button = dialog_state.visit_items ? -1 : dlg_default_button();
int choice = dlg_default_listitem(items);
int result = DLG_EXIT_UNKNOWN;
int scrollamt = 0;
int max_choice;
int found;
int use_width, name_width, text_width, list_width;
WINDOW *dialog, *menu;
char *prompt = 0;
@ -360,7 +372,6 @@ dlg_menu(const char *title,
DLG_TRACE2N("lheight", menu_height);
DLG_TRACE2N("llength", item_no);
/* FIXME dump the items[][] too */
DLG_TRACE2N("current", *current_item);
DLG_TRACE2N("rename", rename_menutext != 0);
dialog_state.plain_buttons = TRUE;
@ -420,8 +431,7 @@ dlg_menu(const char *title,
* After displaying the prompt, we know how much space we really have.
* Limit the list to avoid overwriting the ok-button.
*/
if (all.menu_height + MIN_HIGH > height - cur_y)
all.menu_height = height - MIN_HIGH - cur_y;
all.menu_height = height - MIN_HIGH - cur_y;
if (all.menu_height <= 0)
all.menu_height = 1;
@ -510,15 +520,20 @@ dlg_menu(const char *title,
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
dlg_trace_win(dialog);
while (result == DLG_EXIT_UNKNOWN) {
int key, found;
if (button < 0) /* --visit-items */
wmove(dialog,
all.box_y + ItemToRow(choice) + 1,
all.box_x + all.tag_x + 1);
key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result))
break;
if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
found = FALSE;
if (fkey) {
@ -654,17 +669,19 @@ dlg_menu(const char *title,
dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
FALSE, width);
break;
case DLGK_FIELD_NEXT:
button = dlg_next_button(buttons, button);
dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
FALSE, width);
break;
case DLGK_TOGGLE:
case DLGK_ENTER:
if (is_inputmenu)
result = dlg_ok_buttoncode(button);
else
result = dlg_enter_buttoncode(button);
case DLGK_LEAVE:
result = ((key == DLGK_LEAVE)
? dlg_ok_buttoncode(button)
: dlg_enter_buttoncode(button));
/*
* If dlg_menu() is called from dialog_menu(), we want to
@ -723,16 +740,10 @@ dlg_menu(const char *title,
case KEY_RESIZE:
dlg_will_resize(dialog);
/* reset data */
#define resizeit(name, NAME) \
name = ((NAME >= old_##NAME) \
? (NAME - (old_##NAME - old_##name)) \
: old_##name)
resizeit(height, LINES);
resizeit(width, COLS);
free(prompt);
dlg_clear();
dlg_del_window(dialog);
dlg_mouse_free_regions();
_dlg_resize_cleanup(dialog);
/* repaint */
goto retry;
#endif
@ -749,6 +760,8 @@ dlg_menu(const char *title,
free(prompt);
*current_item = scrollamt + choice;
DLG_TRACE2N("current", *current_item);
return result;
}

View File

@ -1,9 +1,9 @@
/*
* $Id: mixedgauge.c,v 1.34 2018/06/18 22:09:31 tom Exp $
* $Id: mixedgauge.c,v 1.37 2021/01/16 17:19:15 tom Exp $
*
* mixedgauge.c -- implements the mixedgauge dialog
*
* Copyright 2007-2012,2018 Thomas E. Dickey
* Copyright 2007-2020,2021 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -110,7 +110,6 @@ myprint_status(DIALOG_MIXEDGAUGE * dlg)
int limit_y = dlg->height;
int limit_x = dlg->width;
int y = MARGIN;
int item;
int cells = dlg->len_text - 2;
int lm = limit_x - dlg->len_text - 1;
@ -118,21 +117,23 @@ myprint_status(DIALOG_MIXEDGAUGE * dlg)
int last_y = 0, last_x = 0;
int j, xxx;
float percent;
const char *status = "";
char *freeMe = 0;
bm -= (2 * MARGIN);
getyx(win, last_y, last_x);
for (item = 0; item < dlg->item_no; ++item) {
const char *status = "";
chtype attr = A_NORMAL;
int y = item + MARGIN + 1;
y = item + MARGIN + 1;
if (y > bm)
break;
status = status_string(dlg->list[item].text, &freeMe);
if (status == 0 || *status == 0)
if (status == 0 || *status == 0) {
free(freeMe);
continue;
}
(void) wmove(win, y, 2 * MARGIN);
dlg_attrset(win, dialog_attr);
@ -266,9 +267,11 @@ dlg_begin_mixedgauge(DIALOG_MIXEDGAUGE * dlg,
int aItemNo,
char **items)
{
int n, y, x;
int y, x;
if (!*began) {
int n;
curs_set(0);
memset(dlg, 0, sizeof(*dlg));
@ -367,6 +370,8 @@ dlg_finish_mixedgauge(DIALOG_MIXEDGAUGE * dlg, int status)
#endif
curs_set(1);
dlg_del_window(dlg->dialog);
free(dlg->prompt);
free(dlg->list);
return status;
}

View File

@ -1,9 +1,9 @@
/*
* $Id: mousewget.c,v 1.24 2017/01/31 00:27:21 tom Exp $
* $Id: mousewget.c,v 1.25 2019/07/25 00:06:38 tom Exp $
*
* mousewget.c -- mouse/wgetch support for dialog
* mousewget.c -- mouse/wgetch support for dialog
*
* Copyright 2000-2016,2017 Thomas E. Dickey
* Copyright 2000-2017,2019 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -39,9 +39,10 @@ mouse_wgetch(WINDOW *win, int *fkey, bool ignore_errs)
mouse_err = FALSE;
if (key == KEY_MOUSE) {
MEVENT event;
mseRegion *p;
if (getmouse(&event) != ERR) {
mseRegion *p;
DLG_TRACE(("# mouse-click abs %d,%d (rel %d,%d)\n",
event.y, event.x,
event.y - getbegy(win),

View File

@ -1,9 +1,9 @@
/*
* $Id: msgbox.c,v 1.81 2018/06/21 23:29:59 tom Exp $
* $Id: msgbox.c,v 1.89 2020/11/23 00:32:02 tom Exp $
*
* msgbox.c -- implements the message box and info box
*
* Copyright 2000-2012,2018 Thomas E. Dickey
* Copyright 2000-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -45,15 +45,14 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
};
/* *INDENT-ON* */
int x, y, last = 0, page;
int x, y, page;
int button;
int key = 0, fkey;
int key, fkey;
int result = DLG_EXIT_UNKNOWN;
WINDOW *dialog = 0;
char *prompt;
const char **buttons = dlg_ok_label();
int offset = 0;
int check;
bool show = TRUE;
int min_width = (pauseopt == 1 ? 12 : 0);
bool save_nocancel = dialog_vars.nocancel;
@ -91,16 +90,10 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
x = dlg_box_x_ordinate(width);
y = dlg_box_y_ordinate(height);
#ifdef KEY_RESIZE
if (dialog != 0)
dlg_move_window(dialog, height, width, y, x);
else
#endif
{
dialog = dlg_new_window(height, width, y, x);
dlg_register_window(dialog, "msgbox", binding);
dlg_register_buttons(dialog, "msgbox", buttons);
}
dialog = dlg_new_window(height, width, y, x);
dlg_register_window(dialog, "msgbox", binding);
dlg_register_buttons(dialog, "msgbox", buttons);
page = height - (1 + 3 * MARGIN);
dlg_mouse_setbase(x, y);
@ -111,12 +104,16 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
dlg_attrset(dialog, dialog_attr);
if (pauseopt) {
int last = 0;
dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr);
mouse_mkbutton(height - 2, width / 2 - 4, 6, '\n');
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
dlg_draw_helpline(dialog, FALSE);
while (result == DLG_EXIT_UNKNOWN) {
int check;
if (show) {
last = dlg_print_scrolled(dialog, prompt, offset,
page, width, pauseopt);
@ -124,9 +121,10 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
show = FALSE;
}
key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result))
break;
if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
if (!fkey && (check = dlg_char_to_button(key, buttons)) >= 0) {
result = dlg_ok_buttoncode(check);
break;
@ -137,11 +135,11 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
#ifdef KEY_RESIZE
case KEY_RESIZE:
dlg_will_resize(dialog);
dlg_clear();
free(prompt);
height = req_high;
width = req_wide;
show = TRUE;
_dlg_resize_cleanup(dialog);
goto restart;
#endif
case DLGK_FIELD_NEXT:
@ -163,6 +161,9 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
FALSE, width);
break;
case DLGK_ENTER:
result = dlg_enter_buttoncode(button);
break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button);
break;
default:
@ -180,7 +181,7 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
}
break;
}
} else {
} else if (key > 0) {
beep();
}
}
@ -191,6 +192,7 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
dlg_trace_win(dialog);
result = DLG_EXIT_OK;
}
dlg_add_last_key(-1);
dlg_del_window(dialog);
dlg_mouse_free_regions();

View File

@ -1,3 +1,111 @@
cdialog (20210117) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Wed, 13 Jan 2021 19:58:21 -0500
cdialog (20210112) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 11 Jan 2021 03:53:05 -0500
cdialog (20201126) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 26 Jul 2020 11:17:16 -0400
cdialog (20200327) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Thu, 19 Mar 2020 05:02:12 -0400
cdialog (20200228) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 28 Feb 2020 20:31:15 -0500
cdialog (20191231) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 31 Dec 2019 15:37:41 -0500
cdialog (20191210) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 10 Dec 2019 17:19:19 -0500
cdialog (20191209) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 09 Dec 2019 04:14:47 -0500
cdialog (20191110) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 10 Nov 2019 17:48:23 -0500
cdialog (20190926) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Wed, 25 Sep 2019 04:37:53 -0400
cdialog (20190924) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 23 Sep 2019 05:13:54 -0400
cdialog (20190808) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Thu, 08 Aug 2019 16:54:08 -0400
cdialog (20190806) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Thu, 01 Aug 2019 20:16:04 -0400
cdialog (20190728) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 28 Jul 2019 18:04:47 -0400
cdialog (20190724) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 22 Jul 2019 19:20:18 -0400
cdialog (20190211) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 11 Feb 2019 15:47:42 -0500
cdialog (20181107) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Wed, 07 Nov 2018 20:38:14 -0500
cdialog (20181022) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 28 Oct 2018 10:53:29 -0400
cdialog (20180621) unstable; urgency=low
* maintenance updates

View File

@ -1 +1 @@
5
10

View File

@ -22,3 +22,12 @@ Description: dialog - display dialog boxes from shell scripts
tailboxbg, textbox, timebox, treeview, and yesno (yes/no).
.
This package installs as "cdialog" to avoid conflict with other packages.
Package: cdialog-dev
Architecture: any
Depends: libc6 (>= 2.11), libncursesw5 (>= 5.3)
Description: dialog - display dialog boxes from shell scripts
Dialog is a program that will let you present a variety of questions or
display messages using dialog boxes from a shell script. These types
This package provides headers and documentation for the library used
by "cdialog".

View File

@ -4,7 +4,7 @@ Current dialog upstream maintainer: Thomas Dickey <dickey@invisible-island.net>
-------------------------------------------------------------------------------
Files: *.c *.h
Copyright 2000-2017,2018 Thomas E. Dickey
Copyright 2000-2020,2021 Thomas E. Dickey
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License, version 2.1
@ -27,7 +27,7 @@ Files: *.c *.h
Files: aclocal.m4
Licence: other-BSD
Copyright: 1999-2017,2018 by Thomas E. Dickey
Copyright: 1999-2020,2021 by Thomas E. Dickey
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
@ -88,7 +88,7 @@ Licence: other-BSD
shared with many OS's install programs.
Files: debian/*
Copyright: 2010-2012,2013 Thomas E. Dickey
Copyright: 2010-2020,2021 Thomas E. Dickey
Licence: other-BSD
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,

View File

@ -1,4 +1,5 @@
#!/usr/bin/make -f
# $Id: rules,v 1.11 2019/07/24 00:53:35 tom Exp $
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Cristoph Lameter.
@ -15,7 +16,16 @@ CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
TMP = $(CURDIR)/debian/tmp
ACTUAL_PROG = cdialog
DEV_PACKAGE = $(ACTUAL_PROG)-dev
BINDIR = /usr/bin
LIBDIR = /usr/lib
LOCALE = /usr/share/locale
MANDIR = /usr/share/man
HEADER = /usr/include
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
@ -77,7 +87,31 @@ install-stamp: build-stamp
dh_clean -k
dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian/${ACTUAL_PROG}
$(MAKE) install-full DESTDIR=$(TMP)
dh_install -p${ACTUAL_PROG} $(BINDIR)/$(ACTUAL_PROG)
dh_install -p${ACTUAL_PROG} $(LIBDIR)
dh_install -p${ACTUAL_PROG} $(LOCALE)
dh_install -p${ACTUAL_PROG} $(MANDIR)/man1
dh_install -p${DEV_PACKAGE} $(BINDIR)/$(ACTUAL_PROG)-config
dh_install -p${DEV_PACKAGE} $(MANDIR)/man3
dh_install -p${DEV_PACKAGE} $(HEADER)
echo FIXME
for P in lib${ACTUAL_PROG}.so*; \
do \
[ -L "$$P" ] || continue; \
case "$$P" in \
*.so) \
echo "DEV: $$P"; \
dh_link -p${DEV_PACKAGE} $(LIBDIR)/`readlink $$P` $(LIBDIR)/$$P ; \
;; \
*) \
echo "BIN: $$P"; \
dh_link -p${ACTUAL_PROG} $(LIBDIR)/`readlink $$P` $(LIBDIR)/$$P ; \
;; \
esac; \
done
touch install-stamp

View File

@ -1,4 +1,4 @@
# $Id: dialog.map,v 1.7 2018/06/21 00:32:55 tom Exp $
# $Id: dialog.map,v 1.13 2020/11/26 18:09:52 tom Exp $
# script for shared library symbol-versioning using ld
#
# This file was generated by ncu-mapsyms
@ -17,6 +17,18 @@
# Configure options (1.3.20180620)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20190806)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20191209)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20200326)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20201126)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
DIALOG_1.0.20040721 {
global:
@ -220,3 +232,32 @@ DIALOG_1.3.20180620 {
dlg_ttysize;
dlg_will_resize;
} DIALOG_1.3.20160126;
DIALOG_1.3.20190806 {
global:
dlg_button_key;
dlg_exitcode2s;
dlg_exitname2n;
dlg_ok_button_key;
} DIALOG_1.3.20180620;
DIALOG_1.3.20191209 {
global:
dlg_trace_va_msg;
} DIALOG_1.3.20190806;
DIALOG_1.3.20200326 {
global:
dlg_reset_timeout;
dlg_set_timeout;
} DIALOG_1.3.20191209;
DIALOG_1.3.20201126 {
global:
dlg_der_window;
dlg_getenv_num;
dlg_getenv_str;
dlg_keep_tite;
local:
_*;
} DIALOG_1.3.20200326;

View File

@ -1,9 +1,9 @@
Summary: dialog - display dialog boxes from shell scripts
%define AppProgram dialog
%define AppVersion 1.3
%define AppRelease 20180621
%define AppRelease 20210117
%define ActualProg c%{AppProgram}
# $XTermId: dialog.spec,v 1.108 2018/06/21 09:19:45 tom Exp $
# $XTermId: dialog.spec,v 1.146 2021/01/16 16:21:23 tom Exp $
Name: %{ActualProg}
Version: %{AppVersion}
Release: %{AppRelease}
@ -13,6 +13,10 @@ URL: ftp://ftp.invisible-island.net/%{AppProgram}
Source0: %{AppProgram}-%{AppVersion}-%{AppRelease}.tgz
Packager: Thomas Dickey <dickey@invisible-island.net>
%package devel
Summary: Development headers/library for the dialog package.
Requires: %{ActualProg}, ncurses-devel
%description
Dialog is a program that will let you present a variety of questions or
display messages using dialog boxes from a shell script. These types
@ -26,6 +30,10 @@ into dialog):
tailboxbg, textbox, timebox, treeview, and yesno (yes/no).
This package installs as "cdialog" to avoid conflict with other packages.
%description devel
This is the development package "cdialog", which includes the header files,
the linkage information and library documentation.
%prep
%define debug_package %{nil}
@ -38,27 +46,27 @@ cp -v package/dialog.map package/%{ActualProg}.map
INSTALL_PROGRAM='${INSTALL}' \
%configure \
--target %{_target_platform} \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--libdir=%{_libdir} \
--mandir=%{_mandir} \
--with-package=%{ActualProg} \
--enable-header-subdir \
--enable-nls \
--enable-widec \
--with-shared \
--with-ncursesw \
--with-versioned-syms \
--disable-rpath-hack
--target %{_target_platform} \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--libdir=%{_libdir} \
--mandir=%{_mandir} \
--with-package=%{ActualProg} \
--enable-header-subdir \
--enable-nls \
--enable-widec \
--with-shared \
--with-ncursesw \
--with-versioned-syms \
--disable-rpath-hack
make
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
make install-full DESTDIR=$RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
make install-full DESTDIR=$RPM_BUILD_ROOT
strip $RPM_BUILD_ROOT%{_bindir}/%{ActualProg}
chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib%{ActualProg}.so.*
@ -69,19 +77,26 @@ chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib%{ActualProg}.so.*
%files
%defattr(-,root,root)
%{_bindir}/%{ActualProg}
%{_bindir}/%{ActualProg}-config
%{_mandir}/man1/%{ActualProg}.*
%{_mandir}/man3/%{ActualProg}.*
%{_libdir}/lib%{ActualProg}.so.*
%{_datadir}/locale/*/LC_MESSAGES/%{ActualProg}.mo
%files devel
%defattr(-,root,root)
%{_bindir}/%{ActualProg}-config
%{_includedir}/%{ActualProg}.h
%{_includedir}/%{ActualProg}/dlg_colors.h
%{_includedir}/%{ActualProg}/dlg_config.h
%{_includedir}/%{ActualProg}/dlg_keys.h
%{_libdir}/lib%{ActualProg}.*
%{_datadir}/locale/*/LC_MESSAGES/%{ActualProg}.mo
%{_libdir}/lib%{ActualProg}.so
%{_mandir}/man3/%{ActualProg}.*
%changelog
# each patch should add its ChangeLog entries here
* Wed Jul 24 2019 Thomas Dickey
- split-out "-devel" package
* Sat Dec 09 2017 Thomas Dickey
- update ftp url

View File

@ -1,4 +1,4 @@
# $Id: dialog.sym,v 1.7 2018/06/21 00:32:55 tom Exp $
# $Id: dialog.sym,v 1.12 2020/11/26 18:08:18 tom Exp $
# script for shared library symbol-visibility using libtool
#
# This file was generated by ncu-mapsyms
@ -17,6 +17,18 @@
# Configure options (1.3.20180620)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20190806)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20191209)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20200326)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20201126)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
dialog_buildlist
dialog_calendar
dialog_checklist
@ -64,6 +76,7 @@ dlg_box_y_ordinate
dlg_boxchar
dlg_buildlist
dlg_button_count
dlg_button_key
dlg_button_layout
dlg_button_sizes
dlg_button_to_char
@ -92,6 +105,7 @@ dlg_default_item
dlg_default_listitem
dlg_defaultno_button
dlg_del_window
dlg_der_window
dlg_does_output
dlg_draw_arrows
dlg_draw_arrows2
@ -114,7 +128,9 @@ dlg_editbox
dlg_exit
dlg_exit_buttoncode
dlg_exit_label
dlg_exitcode2s
dlg_exiterr
dlg_exitname2n
dlg_find_index
dlg_finish_string
dlg_flush_getc
@ -125,9 +141,12 @@ dlg_free_gauge
dlg_get_attrs
dlg_getc
dlg_getc_callbacks
dlg_getenv_num
dlg_getenv_str
dlg_index_columns
dlg_index_wchars
dlg_item_help
dlg_keep_tite
dlg_killall_bg
dlg_last_getc
dlg_limit_columns
@ -150,6 +169,7 @@ dlg_new_modal_window
dlg_new_window
dlg_next_button
dlg_next_ok_buttonindex
dlg_ok_button_key
dlg_ok_buttoncode
dlg_ok_label
dlg_ok_labels
@ -172,11 +192,13 @@ dlg_register_buttons
dlg_register_window
dlg_remove_callback
dlg_renamed_menutext
dlg_reset_timeout
dlg_restore_vars
dlg_result_key
dlg_save_vars
dlg_set_focus
dlg_set_result
dlg_set_timeout
dlg_show_string
dlg_strclone
dlg_strempty
@ -188,6 +210,7 @@ dlg_trace_2n
dlg_trace_2s
dlg_trace_chr
dlg_trace_msg
dlg_trace_va_msg
dlg_trace_win
dlg_treeview
dlg_trim_string

View File

@ -7,7 +7,7 @@
#
PORTNAME= cdialog
PORTVERSION= 1.3.20180621
PORTVERSION= 1.3.20210117
PORTEPOCH= 1
CATEGORIES= devel
MASTER_SITES= ftp://ftp.invisible-island.net/${PORTNAME:S|^c||}/

View File

@ -1,9 +1,9 @@
/*
* $Id: pause.c,v 1.39 2018/06/19 22:57:01 tom Exp $
* $Id: pause.c,v 1.48 2020/11/23 00:38:19 tom Exp $
*
* pause.c -- implements the pause dialog
*
* Copyright 2004-2012,2018 Thomas E. Dickey
* Copyright 2004-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -72,7 +72,7 @@ dialog_pause(const char *title,
const char **buttons = dlg_ok_labels();
bool have_buttons = (dlg_button_count(buttons) != 0);
bool first;
int key = 0, fkey;
int key, fkey;
int result = DLG_EXIT_UNKNOWN;
int button_high = (have_buttons ? BTN_HIGH : MARGIN);
int gauge_y;
@ -88,8 +88,9 @@ dialog_pause(const char *title,
curs_set(0);
dialog_vars.timeout_secs = 0;
seconds_orig = (seconds > 0) ? seconds : 1;
dialog_vars.pause_secs = seconds_orig;
dialog_vars.timeout_secs = 0;
#ifdef KEY_RESIZE
retry:
@ -194,8 +195,8 @@ dialog_pause(const char *title,
key = dlg_mouse_wgetch_nowait(dialog, &fkey);
if (key == ERR) {
; /* ignore errors in nodelay mode */
} else {
if (dlg_result_key(key, fkey, &result))
} else if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
@ -203,12 +204,10 @@ dialog_pause(const char *title,
#ifdef KEY_RESIZE
case KEY_RESIZE:
dlg_will_resize(dialog);
dlg_clear(); /* fill the background */
dlg_del_window(dialog); /* delete this window */
height = old_height;
width = old_width;
free(prompt);
refresh(); /* get it all onto the terminal */
_dlg_resize_cleanup(dialog);
goto retry;
#endif
case DLGK_FIELD_NEXT:
@ -232,6 +231,9 @@ dialog_pause(const char *title,
case DLGK_ENTER:
result = dlg_enter_buttoncode(button);
break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button);
break;
case ERR:
break;
default:
@ -244,6 +246,7 @@ dialog_pause(const char *title,
}
}
} while ((result == DLG_EXIT_UNKNOWN) && (seconds-- > 0));
dlg_add_last_key(-1);
curs_set(1);
dlg_mouse_free_regions();

115
contrib/dialog/po/ast.po Normal file
View File

@ -0,0 +1,115 @@
# Asturian translation for dialog
# Dialog
# This file is distributed under the same license as the dialog package.
# Copyright 2003-2007,2008 # Thomas Dickey
#
# enolp <enolp@softastur.org>, 2018.
msgid ""
msgstr ""
"Project-Id-Version: dialog 1.1.20080819\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
"PO-Revision-Date: 2018-07-16 01:09+0100\n"
"Last-Translator: enolp <enolp@softastur.org>\n"
"Language-Team: Asturian <ubuntu-l10n-ast@lists.ubuntu.com>\n"
"Language: ast\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 2.0\n"
#: buttons.c:385
msgid "Yes"
msgstr "Sí"
#: buttons.c:393
msgid "No"
msgstr "Non"
#: buttons.c:401
msgid "OK"
msgstr "Aceutar"
#: buttons.c:409
msgid "Cancel"
msgstr "Encaboxar"
#: buttons.c:417
msgid "EXIT"
msgstr "COLAR"
#: buttons.c:425
msgid "Extra"
msgstr "Adicional"
#: buttons.c:433
msgid "Help"
msgstr "Ayuda"
#. Headline "Month"
#: calendar.c:273
msgid "Month"
msgstr "Mes"
#. Headline "Year"
#: calendar.c:293
msgid "Year"
msgstr "Añu"
#: dialog.c:741
msgid "Rename"
msgstr "Renomar"
#: fselect.c:550
msgid "Directories"
msgstr "Direutorios"
#: fselect.c:551
msgid "Files"
msgstr "Ficheros"
#: mixedgauge.c:58
msgid "Succeeded"
msgstr "Tuvo ésitu"
#: mixedgauge.c:61
msgid "Failed"
msgstr "Falló"
#: mixedgauge.c:64
msgid "Passed"
msgstr "Posóse"
#: mixedgauge.c:67
msgid "Completed"
msgstr "Completóse"
#: mixedgauge.c:70
msgid "Checked"
msgstr "Conseñóse"
#: mixedgauge.c:73
msgid "Done"
msgstr "Fecho"
#: mixedgauge.c:76
msgid "Skipped"
msgstr "Saltóse"
#: mixedgauge.c:79
msgid "In Progress"
msgstr "En cursu"
#: mixedgauge.c:85
msgid "N/A"
msgstr "N/D"
#: mixedgauge.c:193
msgid "Overall Progress"
msgstr "Progresu xeneral"
#: textbox.c:489
msgid "Search"
msgstr "Guetar"

View File

@ -1,12 +1,12 @@
# Dialog
# Copyright 2003-2014,2015 # Thomas Dickey
# Copyright 2003-2020,2021 # Thomas Dickey
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: dialog 1.2.20150510\n"
"Project-Id-Version: dialog 1.3.20210117\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-10 21:00-0400\n"
"POT-Creation-Date: 2021-01-17 15:18-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -15,53 +15,63 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: buttons.c:480
#: buttons.c:500
msgid "Yes"
msgstr ""
#: buttons.c:488
#: buttons.c:508
msgid "No"
msgstr ""
#: buttons.c:496
#: buttons.c:516
msgid "OK"
msgstr ""
#: buttons.c:504
#: buttons.c:524
msgid "Cancel"
msgstr ""
#: buttons.c:512
#: buttons.c:532
msgid "EXIT"
msgstr ""
#: buttons.c:520
#: buttons.c:540
msgid "Extra"
msgstr ""
#: buttons.c:528
#: buttons.c:548
msgid "Help"
msgstr ""
#. Headline "Month"
#: calendar.c:300
#: calendar.c:463
msgid "Month"
msgstr ""
#. Headline "Year"
#: calendar.c:322
#: calendar.c:485
msgid "Year"
msgstr ""
#: dialog.c:728
#: dialog.c:744
#, c-format
msgid "Expected %d arguments, found only %d"
msgstr ""
#: dialog.c:748
#, c-format
msgid "Expected %d arguments, found extra %d"
msgstr ""
#: dialog.c:907
msgid "Rename"
msgstr ""
#: fselect.c:596
#: fselect.c:623
msgid "Directories"
msgstr ""
#: fselect.c:597
#: fselect.c:624
msgid "Files"
msgstr ""
@ -101,10 +111,10 @@ msgstr ""
msgid "N/A"
msgstr ""
#: mixedgauge.c:190
#: mixedgauge.c:193
msgid "Overall Progress"
msgstr ""
#: textbox.c:502
#: textbox.c:515
msgid "Search"
msgstr ""

View File

@ -9,6 +9,7 @@ msgstr ""
"PO-Revision-Date: 2007-07-18 11:06+0200\n"
"Last-Translator: Deepika Mangla <deepika.mangla@gmail.com>\n"
"Language-Team: <elinks@knopper.net>\n"
"Language: hi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -19,94 +20,94 @@ msgstr ""
#: buttons.c:385
msgid "Yes"
msgstr "à€¹à€Ÿà€"
msgstr "हाँ"
#: buttons.c:393
msgid "No"
msgstr "à€šà€¹à¥€à€‚"
msgstr "नहीं"
#: buttons.c:401
msgid "OK"
msgstr "à€ à¥€à€•"
msgstr "ठीक"
#: buttons.c:409
msgid "Cancel"
msgstr "à€°à€Šà¥à€Š à€•à€°à¥‡à€‚"
msgstr "रद्द करें"
#: buttons.c:417
msgid "EXIT"
msgstr "à€šà€¿à€°à¥à€—à€®"
msgstr "निर्गम"
#: buttons.c:425
msgid "Extra"
msgstr "à€…à€€à€¿à€°à€¿à€•à¥à€€"
msgstr "अतिरिक्त"
#: buttons.c:433
msgid "Help"
msgstr "à€®à€Šà€Š"
msgstr "मदद"
#. Headline "Month"
#: calendar.c:273
msgid "Month"
msgstr "à€®à€¹à¥€à€šà€Ÿ"
msgstr "महीना"
#. Headline "Year"
#: calendar.c:293
msgid "Year"
msgstr "à€µà€°à¥à€·"
msgstr "वर्ष"
#: dialog.c:741
msgid "Rename"
msgstr "à€ªà¥à€šà€ƒà€šà€Ÿà€®à€•à€°à€£"
msgstr "पुनःनामकरण"
#: fselect.c:550
msgid "Directories"
msgstr "à€šà€¿à€°à¥à€Šà¥‡à€¶à€¿à€•à€Ÿ"
msgstr "निर्देशिका"
#: fselect.c:551
msgid "Files"
msgstr "à€žà€‚à€šà€¿à€•à€Ÿ"
msgstr "संचिका"
#: mixedgauge.c:58
msgid "Succeeded"
msgstr "à€žà€«à€²"
msgstr "सफल"
#: mixedgauge.c:61
msgid "Failed"
msgstr "à€žà€«à€²"
msgstr "सफल"
#: mixedgauge.c:64
msgid "Passed"
msgstr "à€ªà€Ÿà€ž"
msgstr "पास"
#: mixedgauge.c:67
msgid "Completed"
msgstr "à€žà€®à¥à€ªà¥‚à€°à€¿à€€"
msgstr "सम्पूरित"
#: mixedgauge.c:70
msgid "Checked"
msgstr "à€…à€µà€°à¥à€Šà¥à€§"
msgstr "अवरुद्ध"
#: mixedgauge.c:73
msgid "Done"
msgstr "à€žà€«à€² "
msgstr "सफल "
#: mixedgauge.c:76
msgid "Skipped"
msgstr "à€›à¥‹à€¡à€Œ à€Šà€¿à€¯à€Ÿ"
msgstr "छोड़ दिया"
#: mixedgauge.c:79
msgid "In Progress"
msgstr "à€ªà¥à€°à€—à€€à€¿ à€®à¥‡à€‚ à€¹à¥ˆ"
msgstr "प्रगति में है"
#: mixedgauge.c:85
msgid "N/A"
msgstr "à€²à€Ÿà€—à¥‚ à€šà€¹à¥€à€‚"
msgstr "लागू नहीं"
#: mixedgauge.c:193
msgid "Overall Progress"
msgstr "à€žà€®à€—à¥à€° à€ªà¥à€°à€—à€€à€¿"
msgstr "समग्र प्रगति"
#: textbox.c:489
msgid "Search"
msgstr "à€…à€šà¥à€žà€šà¥à€§à€Ÿà€š"
msgstr "अनुसन्धान"

View File

@ -14,99 +14,99 @@ msgstr ""
"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=EUC-JP\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: buttons.c:387
msgid "Yes"
msgstr "はい"
msgstr "はい"
#: buttons.c:395
msgid "No"
msgstr "いいえ"
msgstr "いいえ"
#: buttons.c:403
msgid "OK"
msgstr "了解"
msgstr "了解"
#: buttons.c:411
msgid "Cancel"
msgstr "取消"
msgstr "取消"
#: buttons.c:419
msgid "EXIT"
msgstr "終了"
msgstr "終了"
#: buttons.c:427
msgid "Extra"
msgstr "拡張"
msgstr "拡張"
#: buttons.c:435
msgid "Help"
msgstr "ヘルプ"
msgstr "ヘルプ"
#. Headline "Month"
#: calendar.c:298
msgid "Month"
msgstr "月"
msgstr "月"
#. Headline "Year"
#: calendar.c:318
msgid "Year"
msgstr "年"
msgstr "年"
#: dialog.c:756
msgid "Rename"
msgstr "名前変更"
msgstr "名前変更"
#: fselect.c:571
msgid "Directories"
msgstr "ディレクトリ"
msgstr "ディレクトリ"
#: fselect.c:572
msgid "Files"
msgstr "ファイル"
msgstr "ファイル"
#: mixedgauge.c:58
msgid "Succeeded"
msgstr "成功"
msgstr "成功"
#: mixedgauge.c:61
msgid "Failed"
msgstr "失敗"
msgstr "失敗"
#: mixedgauge.c:64
msgid "Passed"
msgstr "パス"
msgstr "パス"
#: mixedgauge.c:67
msgid "Completed"
msgstr "完了"
msgstr "完了"
#: mixedgauge.c:70
msgid "Checked"
msgstr "確認終了"
msgstr "確認終了"
#: mixedgauge.c:73
msgid "Done"
msgstr "終了"
msgstr "終了"
#: mixedgauge.c:76
msgid "Skipped"
msgstr "スキップ"
msgstr "スキップ"
#: mixedgauge.c:79
msgid "In Progress"
msgstr "処理中"
msgstr "処理中"
#: mixedgauge.c:85
msgid "N/A"
msgstr "無効"
msgstr "無効"
#: mixedgauge.c:193
msgid "Overall Progress"
msgstr "全体の進行状況"
msgstr "全体の進行状況"
#: textbox.c:468
msgid "Search"
msgstr "調査"
msgstr "調査"

View File

@ -1,18 +1,23 @@
# Portuguese translation of Dialog.
# Copyright (C) 2001 Thomas Dickey.
# Frédéric L. W. Meunier <0 @ pervalidus.net>, 2001.
# Portuguese (Portugal) Translation for the dialog Package
# This file is distributed under the same license as the dialog package.
# Copyright 2003-2007,2008 Thomas Dickey
# This file is distributed under the same license as the dialog package.
# Pedro Albuquerque <palbuquerque73@gmail.com>, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: Dialog 0.9a-20020814\n"
"Project-Id-Version: dialog 1.1.20080819\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
"PO-Revision-Date: 2002-09-04 19:12-0300\n"
"Last-Translator: Frédéric L. W. Meunier <0 @ pervalidus.net>\n"
"Language-Team: Portuguese <pt @ li.org>\n"
"PO-Revision-Date: 2019-09-25 07:33+0100\n"
"Last-Translator: Pedro Albuquerque <palbuquerque73@gmail.com>\n"
"Language-Team: Portuguese <translation-team-pt@lists.sourceforge.net>\n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: buttons.c:385
msgid "Yes"
@ -32,11 +37,11 @@ msgstr "Cancelar"
#: buttons.c:417
msgid "EXIT"
msgstr "Sair"
msgstr "SAIR"
#: buttons.c:425
msgid "Extra"
msgstr ""
msgstr "Extra"
#: buttons.c:433
msgid "Help"
@ -54,11 +59,11 @@ msgstr "Ano"
#: dialog.c:741
msgid "Rename"
msgstr ""
msgstr "Renomear"
#: fselect.c:550
msgid "Directories"
msgstr "Directorias"
msgstr "Pastas"
#: fselect.c:551
msgid "Files"
@ -66,46 +71,44 @@ msgstr "Ficheiros"
#: mixedgauge.c:58
msgid "Succeeded"
msgstr ""
msgstr "Sucesso"
#: mixedgauge.c:61
#, fuzzy
msgid "Failed"
msgstr "Ficheiros"
msgstr "Falha"
#: mixedgauge.c:64
msgid "Passed"
msgstr ""
msgstr "Passou"
#: mixedgauge.c:67
msgid "Completed"
msgstr ""
msgstr "Concluído"
#: mixedgauge.c:70
msgid "Checked"
msgstr ""
msgstr "Verificado"
#: mixedgauge.c:73
msgid "Done"
msgstr ""
msgstr "Feito"
#: mixedgauge.c:76
msgid "Skipped"
msgstr ""
msgstr "Ignorado"
#: mixedgauge.c:79
msgid "In Progress"
msgstr ""
msgstr "Em Curso"
#: mixedgauge.c:85
msgid "N/A"
msgstr ""
msgstr "N/D"
#: mixedgauge.c:193
msgid "Overall Progress"
msgstr ""
msgstr "Progresso geral"
#: textbox.c:489
#, fuzzy
msgid "Search"
msgstr "Busca"
msgstr "Procurar"

View File

@ -14,7 +14,6 @@ msgstr ""
"Last-Translator: Mihai Cristescu <mihai.cristescu@archlinux.info>\n"
"Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
"Language: ro\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

View File

@ -1,111 +1,113 @@
# Albanian translation of Dialog.
# Translation of dialog to Albanian
# This file is distributed under the same license as the dialog package.
# Copyright (C) 2005 Thomas Dickey.
# Elian Myftiu <elian@lycos.com>, 2004.
#
# Copyright 2003-2007,2008 # Thomas Dickey
# Besnik Bleta <besnik@programeshqip.org>, 2004,2008,2015, 2019, 2020.
msgid ""
msgstr ""
"Project-Id-Version: Dialog 1.0-20050116\n"
"Project-Id-Version: dialog-1.1.20080819\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
"PO-Revision-Date: 2004-11-18 02:28+0100\n"
"Last-Translator: Elian Myftiu <elian@lycos.com>\n"
"Language-Team: Albanian <gnome-albanian-perkthyesit@lists.sourceforge.net>\n"
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
"PO-Revision-Date: 2020-04-01 15:04+0300\n"
"Last-Translator: Besnik Bleta <besnik@programeshqip.org>\n"
"Language-Team: Albanian <translation-team-sq@lists.sourceforge.net>\n"
"Language: sq\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.2\n"
#: buttons.c:387
#: buttons.c:385
msgid "Yes"
msgstr "Po"
#: buttons.c:395
#: buttons.c:393
msgid "No"
msgstr "Jo"
#: buttons.c:403
#: buttons.c:401
msgid "OK"
msgstr "mirë"
msgstr "OK"
#: buttons.c:411
#: buttons.c:409
msgid "Cancel"
msgstr "Anullo"
msgstr "Anuloje"
#: buttons.c:419
#: buttons.c:417
msgid "EXIT"
msgstr "Dal"
msgstr "DALJE"
#: buttons.c:427
#: buttons.c:425
msgid "Extra"
msgstr ""
msgstr "Ekstra"
#: buttons.c:435
#: buttons.c:433
msgid "Help"
msgstr ""
msgstr "Ndihmë"
#. Headline "Month"
#: calendar.c:298
#: calendar.c:273
msgid "Month"
msgstr ""
msgstr "Muaj"
#. Headline "Year"
#: calendar.c:318
#: calendar.c:293
msgid "Year"
msgstr ""
msgstr "Vit"
#: dialog.c:756
#: dialog.c:741
msgid "Rename"
msgstr ""
msgstr "Riemërtoje"
#: fselect.c:571
#: fselect.c:550
msgid "Directories"
msgstr ""
msgstr "Drejtori"
#: fselect.c:572
#: fselect.c:551
msgid "Files"
msgstr ""
msgstr "Kartela"
#: mixedgauge.c:58
msgid "Succeeded"
msgstr ""
msgstr "Doli me sukses"
#: mixedgauge.c:61
msgid "Failed"
msgstr ""
msgstr "Dështoi"
#: mixedgauge.c:64
msgid "Passed"
msgstr ""
msgstr "Kaloi"
#: mixedgauge.c:67
msgid "Completed"
msgstr ""
msgstr "U plotësua"
#: mixedgauge.c:70
msgid "Checked"
msgstr ""
msgstr "U kontrollua"
#: mixedgauge.c:73
msgid "Done"
msgstr ""
msgstr "U bë"
#: mixedgauge.c:76
msgid "Skipped"
msgstr ""
msgstr "U anashkalua"
#: mixedgauge.c:79
msgid "In Progress"
msgstr ""
msgstr "Në ecuri e sipër"
#: mixedgauge.c:85
msgid "N/A"
msgstr ""
msgstr "N/A"
#: mixedgauge.c:193
msgid "Overall Progress"
msgstr ""
msgstr "Ecuri Gjithsej"
#: textbox.c:468
#: textbox.c:489
msgid "Search"
msgstr ""
msgstr "Kērko"

View File

@ -1,9 +1,9 @@
/*
* $Id: prgbox.c,v 1.13 2016/01/27 01:37:26 tom Exp $
* $Id: prgbox.c,v 1.14 2019/07/25 00:07:15 tom Exp $
*
* prgbox.c -- implements the prg box
*
* Copyright 2011-2014,2016 Thomas E. Dickey
* Copyright 2011-2016,2019 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -37,10 +37,10 @@ dlg_popen(const char *command, const char *type)
{
FILE *result = 0;
int fd[2];
char *blob;
char **argv;
if ((*type == 'r' || *type != 'w') && pipe(fd) == 0) {
if ((*type == 'r' || *type == 'w') && pipe(fd) == 0) {
char *blob;
switch (fork()) {
case -1: /* Error. */
(void) close(fd[0]);
@ -68,6 +68,7 @@ dlg_popen(const char *command, const char *type)
* tokens.
*/
if ((blob = malloc(10 + strlen(command))) != 0) {
char **argv;
sprintf(blob, "sh -c \"%s\"", command);
argv = dlg_string_to_argv(blob);
execvp("sh", argv);

View File

@ -1,15 +1,14 @@
/*
* $Id: progressbox.c,v 1.47 2018/06/21 09:14:47 tom Exp $
* $Id: progressbox.c,v 1.54 2020/11/22 15:48:27 tom Exp $
*
* progressbox.c -- implements the progress box
*
* Copyright 2006-2014,2018 Thomas E. Dickey
* Copyright 2006-2019,2020 Thomas E. Dickey
* Copyright 2005 Valery Reznic
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
* it under the terms of the GNU Lesser General Public License, version 2.1
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@ -69,6 +68,7 @@ free_obj(MY_OBJ * obj)
free(obj);
}
#ifdef KEY_RESIZE
static void
restart_obj(MY_OBJ * obj)
{
@ -78,12 +78,12 @@ restart_obj(MY_OBJ * obj)
dlg_clear();
dlg_del_window(obj->obj.win);
}
#endif
static void
start_obj(MY_OBJ * obj, const char *title, const char *cprompt)
{
int y, x, thigh;
int i;
obj->prompt = dlg_strclone(cprompt);
dlg_tab_correct_str(obj->prompt);
@ -108,6 +108,7 @@ start_obj(MY_OBJ * obj, const char *title, const char *cprompt)
dlg_draw_helpline(obj->obj.win, FALSE);
if (obj->prompt[0] != '\0') {
int i;
int y2, x2;
dlg_attrset(obj->obj.win, dialog_attr);
@ -145,12 +146,12 @@ get_line(MY_OBJ * obj, int *restart)
{
FILE *fp = obj->obj.input;
int col = 0;
int j, tmpint, ch;
int j, tmpint;
char *result = obj->line;
*restart = 0;
for (;;) {
ch = getc(fp);
int ch = getc(fp);
#ifdef KEY_RESIZE
/* SIGWINCH may have interrupted this - try to ignore if resizable */
if (ferror(fp)) {
@ -207,7 +208,7 @@ get_line(MY_OBJ * obj, int *restart)
}
nodelay(win, TRUE);
if ((ch = wgetch(win)) == KEY_RESIZE) {
if (wgetch(win) == KEY_RESIZE) {
*restart = 1;
}
nodelay(win, FALSE);
@ -227,7 +228,9 @@ print_line(MY_OBJ * obj, const char *line, int row)
(void) wmove(obj->text, row, 0); /* move cursor to correct line */
wprintw(obj->text, " %.*s", limit, line);
wclrtoeol(obj->text);
while (++limit < width) {
waddch(obj->text, ' ');
}
}
#ifdef KEY_RESIZE
@ -284,13 +287,15 @@ pause_for_ok(MY_OBJ * obj, const char *title, const char *cprompt)
/* *INDENT-ON* */
int button;
int key = 0, fkey;
int key, fkey;
int result = DLG_EXIT_UNKNOWN;
const char **buttons = dlg_ok_label();
int check;
bool save_nocancel = dialog_vars.nocancel;
bool redraw = TRUE;
(void) title;
(void) cprompt;
dialog_vars.nocancel = TRUE;
button = dlg_default_button();
@ -304,6 +309,8 @@ pause_for_ok(MY_OBJ * obj, const char *title, const char *cprompt)
dlg_draw_bottom_box2(obj->obj.win, border_attr, border2_attr, dialog_attr);
while (result == DLG_EXIT_UNKNOWN) {
int check;
if (redraw) {
redraw = FALSE;
if (button < 0)
@ -315,8 +322,10 @@ pause_for_ok(MY_OBJ * obj, const char *title, const char *cprompt)
}
key = dlg_mouse_wgetch(obj->obj.win, &fkey);
if (dlg_result_key(key, fkey, &result))
break;
if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
if (!fkey && (check = dlg_char_to_button(key, buttons)) >= 0) {
result = dlg_ok_buttoncode(check);
@ -356,10 +365,12 @@ pause_for_ok(MY_OBJ * obj, const char *title, const char *cprompt)
break;
}
} else {
} else if (key > 0) {
beep();
}
}
dlg_add_last_key(-1);
dlg_mouse_free_regions();
dlg_unregister_window(obj->obj.win);

View File

@ -1,9 +1,9 @@
/*
* $Id: rangebox.c,v 1.24 2018/06/19 22:57:01 tom Exp $
* $Id: rangebox.c,v 1.32 2020/11/22 23:25:09 tom Exp $
*
* rangebox.c -- implements the rangebox dialog
*
* Copyright 2012-2017,2018 Thomas E. Dickey
* Copyright 2012-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -21,7 +21,7 @@
* Boston, MA 02110, USA.
*/
#include <dialog.h>
#include <dlg_internals.h>
#include <dlg_keys.h>
#define ONE_HIGH 1
@ -29,19 +29,6 @@
#define MIN_HIGH (ONE_HIGH + 1 + (4 * MARGIN))
#define MIN_WIDE (10 + 2 + (2 * MARGIN))
struct _box;
typedef struct _box {
WINDOW *parent;
WINDOW *window;
int x;
int y;
int width;
int height;
int period;
int value;
} BOX;
typedef struct {
/* window in which the value and slider are drawn */
WINDOW *window;
@ -209,7 +196,7 @@ dialog_rangebox(const char *title,
int old_width = width;
#endif
VALUE data;
int key = 0, key2, fkey;
int key, fkey;
int button;
int result = DLG_EXIT_UNKNOWN;
WINDOW *dialog;
@ -245,11 +232,8 @@ dialog_rangebox(const char *title,
#endif
prompt = dlg_strclone(cprompt);
dlg_auto_size(title, prompt, &height, &width, 0, 0);
dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MIN_WIDE);
height += MIN_HIGH;
if (width < MIN_WIDE)
width = MIN_WIDE;
dlg_button_layout(buttons, &width);
dlg_print_size(height, width);
dlg_ctl_size(height, width);
@ -313,7 +297,10 @@ dialog_rangebox(const char *title,
dlg_print_autowrap(dialog, prompt, height, width);
dlg_trace_win(dialog);
while (result == DLG_EXIT_UNKNOWN) {
int key2;
draw_value(&data, cur_value);
button = (state < 0) ? 0 : state;
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
@ -323,8 +310,10 @@ dialog_rangebox(const char *title,
}
key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result))
break;
if (dlg_result_key(key, fkey, &result)) {
if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
if ((key2 = dlg_char_to_button(key, buttons)) >= 0) {
result = key2;
@ -334,6 +323,9 @@ dialog_rangebox(const char *title,
switch (key) {
case DLGK_TOGGLE:
case DLGK_ENTER:
result = dlg_enter_buttoncode(button);
break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button);
break;
case DLGK_FIELD_PREV:
@ -392,9 +384,7 @@ dialog_rangebox(const char *title,
width = old_width;
/* repaint */
free(prompt);
dlg_clear();
dlg_del_window(dialog);
dlg_mouse_free_regions();
_dlg_resize_cleanup(dialog);
goto retry;
#endif
case DLGK_MOUSE('i'):
@ -421,8 +411,7 @@ dialog_rangebox(const char *title,
sprintf(buffer, "%d", cur_value);
dlg_add_result(buffer);
dlg_add_separator();
dlg_add_last_key(-1);
AddLastKey();
dlg_del_window(dialog);
dlg_mouse_free_regions();

View File

@ -1,9 +1,9 @@
/*
* $Id: rc.c,v 1.53 2018/05/31 20:32:15 tom Exp $
* $Id: rc.c,v 1.60 2020/11/25 00:06:40 tom Exp $
*
* rc.c -- routines for processing the configuration file
*
* Copyright 2000-2012,2018 Thomas E. Dickey
* Copyright 2000-2019,2020 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@ -30,6 +30,19 @@
#ifdef HAVE_COLOR
#include <dlg_colors.h>
#include <dlg_internals.h>
#define L_PAREN '('
#define R_PAREN ')'
#define MIN_TOKEN 3
#ifdef HAVE_RC_FILE2
#define MAX_TOKEN 5
#else
#define MAX_TOKEN MIN_TOKEN
#endif
#define UNKNOWN_COLOR -2
/*
* For matching color names with color values
@ -48,7 +61,7 @@ static const color_names_st color_names[] =
{"CYAN", COLOR_CYAN},
{"WHITE", COLOR_WHITE},
}; /* color names */
#define COLOR_COUNT (sizeof(color_names) / sizeof(color_names[0]))
#define COLOR_COUNT TableSize(color_names)
#endif /* HAVE_COLOR */
#define GLOBALRC "/etc/dialogrc"
@ -67,7 +80,7 @@ typedef enum {
} PARSE_LINE;
/* number of configuration variables */
#define VAR_COUNT (sizeof(vars) / sizeof(vars_st))
#define VAR_COUNT TableSize(vars)
/* check if character is string quoting characters */
#define isquote(c) ((c) == '"' || (c) == '\'')
@ -140,6 +153,52 @@ skip_keyword(char *str, int n)
return n;
}
static void
trim_token(char **tok)
{
char *tmp = *tok + skip_whitespace(*tok, 0);
*tok = tmp;
while (*tmp != '\0' && !isblank(UCH(*tmp)))
tmp++;
*tmp = '\0';
}
static int
from_boolean(const char *str)
{
int code = -1;
if (str != NULL && *str != '\0') {
if (!dlg_strcmp(str, "ON")) {
code = 1;
} else if (!dlg_strcmp(str, "OFF")) {
code = 0;
}
}
return code;
}
static int
from_color_name(const char *str)
{
int code = UNKNOWN_COLOR;
if (str != NULL && *str != '\0') {
size_t i;
for (i = 0; i < COLOR_COUNT; ++i) {
if (!dlg_strcmp(str, color_names[i].name)) {
code = color_names[i].value;
break;
}
}
}
return code;
}
static int
find_vars(char *name)
{
@ -172,55 +231,58 @@ find_color(char *name)
return result;
}
/*
* Convert an attribute to a string representation like this:
*
* "(foreground,background,highlight)"
*/
static char *
attr_to_str(char *str, int fg, int bg, int hl)
static const char *
to_color_name(int code)
{
int i;
const char *result = "?";
size_t n;
for (n = 0; n < TableSize(color_names); ++n) {
if (code == color_names[n].value) {
result = color_names[n].name;
break;
}
}
return result;
}
strcpy(str, "(");
/* foreground */
for (i = 0; fg != color_names[i].value; i++) ;
strcat(str, color_names[i].name);
strcat(str, ",");
/* background */
for (i = 0; bg != color_names[i].value; i++) ;
strcat(str, color_names[i].name);
/* highlight */
strcat(str, hl ? ",ON)" : ",OFF)");
return str;
static const char *
to_boolean(int code)
{
return code ? "ON" : "OFF";
}
/*
* Extract the foreground, background and highlight values from an attribute
* represented as a string in one of two forms:
* represented as a string in one of these forms:
*
* "(foreground,background,highlight,underline,reverse)"
* "(foreground,background,highlight,underline)"
* "(foreground,background,highlight)"
" "xxxx_color"
* "xxxx_color"
*/
static int
str_to_attr(char *str, int *fg, int *bg, int *hl)
str_to_attr(char *str, DIALOG_COLORS * result)
{
int i = 0, get_fg = 1;
unsigned j;
char tempstr[MAX_LEN + 1], *part;
char *tokens[MAX_TOKEN + 1];
char tempstr[MAX_LEN + 1];
size_t have;
size_t i = 0;
size_t tok_count = 0;
if (str[0] != '(' || lastch(str) != ')') {
if ((i = find_color(str)) >= 0) {
*fg = dlg_color_table[i].fg;
*bg = dlg_color_table[i].bg;
*hl = dlg_color_table[i].hilite;
memset(result, 0, sizeof(*result));
result->fg = -1;
result->bg = -1;
result->hilite = -1;
if (str[0] != L_PAREN || lastch(str) != R_PAREN) {
int ret;
if ((ret = find_color(str)) >= 0) {
*result = dlg_color_table[ret];
return 0;
}
return -1; /* invalid representation */
/* invalid representation */
return -1;
}
/* remove the parenthesis */
@ -233,64 +295,41 @@ str_to_attr(char *str, int *fg, int *bg, int *hl)
memcpy(tempstr, str + 1, have);
tempstr[have] = '\0';
/* get foreground and background */
/* parse comma-separated tokens, allow up to
* one more than max tokens to detect extras */
while (tok_count < TableSize(tokens)) {
while (1) {
/* skip white space before fg/bg string */
i = skip_whitespace(tempstr, i);
if (tempstr[i] == '\0')
return -1; /* invalid representation */
part = tempstr + i; /* set 'part' to start of fg/bg string */
tokens[tok_count++] = &tempstr[i];
/* find end of fg/bg string */
while (!isblank(UCH(tempstr[i])) && tempstr[i] != ','
&& tempstr[i] != '\0')
while (tempstr[i] != '\0' && tempstr[i] != ',')
i++;
if (tempstr[i] == '\0')
return -1; /* invalid representation */
else if (isblank(UCH(tempstr[i]))) { /* not yet ',' */
tempstr[i++] = '\0';
/* skip white space before ',' */
i = skip_whitespace(tempstr, i);
if (tempstr[i] != ',')
return -1; /* invalid representation */
}
tempstr[i++] = '\0'; /* skip the ',' */
for (j = 0; j < COLOR_COUNT && dlg_strcmp(part, color_names[j].name);
j++) ;
if (j == COLOR_COUNT) /* invalid color name */
return -1;
if (get_fg) {
*fg = color_names[j].value;
get_fg = 0; /* next we have to get the background */
} else {
*bg = color_names[j].value;
break;
}
} /* got foreground and background */
/* get highlight */
tempstr[i++] = '\0';
}
/* skip white space before highlight string */
i = skip_whitespace(tempstr, i);
if (tempstr[i] == '\0')
return -1; /* invalid representation */
part = tempstr + i; /* set 'part' to start of highlight string */
if (tok_count < MIN_TOKEN || tok_count > MAX_TOKEN) {
/* invalid representation */
return -1;
}
/* trim trailing white space from highlight string */
i = (int) strlen(part) - 1;
while (isblank(UCH(part[i])) && i > 0)
i--;
part[i + 1] = '\0';
for (i = 0; i < tok_count; ++i)
trim_token(&tokens[i]);
if (!dlg_strcmp(part, "ON"))
*hl = TRUE;
else if (!dlg_strcmp(part, "OFF"))
*hl = FALSE;
else
return -1; /* invalid highlight value */
/* validate */
if (UNKNOWN_COLOR == (result->fg = from_color_name(tokens[0]))
|| UNKNOWN_COLOR == (result->bg = from_color_name(tokens[1]))
|| UNKNOWN_COLOR == (result->hilite = from_boolean(tokens[2]))
#ifdef HAVE_RC_FILE2
|| (tok_count >= 4 && (result->ul = from_boolean(tokens[3])) == -1)
|| (tok_count >= 5 && (result->rv = from_boolean(tokens[4])) == -1)
#endif /* HAVE_RC_FILE2 */
) {
/* invalid representation */
return -1;
}
return 0;
}
@ -410,9 +449,14 @@ dlg_create_rc(const char *filename)
# String - \"string\"\n\
# Boolean - <ON|OFF>\n"
#ifdef HAVE_COLOR
#ifdef HAVE_RC_FILE2
"\
# Attribute - (foreground,background,highlight?,underline?,reverse?)\n"
#else /* HAVE_RC_FILE2 */
"\
# Attribute - (foreground,background,highlight?)\n"
#endif
#endif /* HAVE_RC_FILE2 */
#endif /* HAVE_COLOR */
);
/* Print an entry for each configuration variable */
@ -435,7 +479,6 @@ dlg_create_rc(const char *filename)
}
#ifdef HAVE_COLOR
for (i = 0; i < (unsigned) dlg_color_count(); ++i) {
char buffer[MAX_LEN + 1];
unsigned j;
bool repeat = FALSE;
@ -453,11 +496,17 @@ dlg_create_rc(const char *filename)
}
if (!repeat) {
fprintf(rc_file, "%s = %s\n", dlg_color_table[i].name,
attr_to_str(buffer,
dlg_color_table[i].fg,
dlg_color_table[i].bg,
dlg_color_table[i].hilite));
fprintf(rc_file, "%s = %c", dlg_color_table[i].name, L_PAREN);
fprintf(rc_file, "%s", to_color_name(dlg_color_table[i].fg));
fprintf(rc_file, ",%s", to_color_name(dlg_color_table[i].bg));
fprintf(rc_file, ",%s", to_boolean(dlg_color_table[i].hilite));
#ifdef HAVE_RC_FILE2
if (dlg_color_table[i].ul || dlg_color_table[i].rv)
fprintf(rc_file, ",%s", to_boolean(dlg_color_table[i].ul));
if (dlg_color_table[i].rv)
fprintf(rc_file, ",%s", to_boolean(dlg_color_table[i].rv));
#endif /* HAVE_RC_FILE2 */
fprintf(rc_file, "%c\n", R_PAREN);
}
}
#endif /* HAVE_COLOR */
@ -466,6 +515,13 @@ dlg_create_rc(const char *filename)
(void) fclose(rc_file);
}
static void
report_error(const char *filename, int line_no, const char *msg)
{
fprintf(stderr, "%s:%d: %s\n", filename, line_no, msg);
dlg_trace_msg("%s:%d: %s\n", filename, line_no, msg);
}
/*
* Parse the configuration file and set up variables
*/
@ -478,7 +534,7 @@ dlg_parse_rc(void)
char str[MAX_LEN + 1];
char *var;
char *value;
char *tempptr;
char *filename;
int result = 0;
FILE *rc_file = 0;
char *params;
@ -499,36 +555,35 @@ dlg_parse_rc(void)
*/
/* try step (a) */
if ((tempptr = getenv("DIALOGRC")) != NULL)
rc_file = fopen(tempptr, "rt");
if ((filename = dlg_getenv_str("DIALOGRC")) != NULL)
rc_file = fopen(filename, "rt");
if (rc_file == NULL) { /* step (a) failed? */
/* try step (b) */
if ((tempptr = getenv("HOME")) != NULL
&& strlen(tempptr) < MAX_LEN - (sizeof(DIALOGRC) + 3)) {
if (tempptr[0] == '\0' || lastch(tempptr) == '/')
sprintf(str, "%s%s", tempptr, DIALOGRC);
if ((filename = dlg_getenv_str("HOME")) != NULL
&& strlen(filename) < MAX_LEN - (sizeof(DIALOGRC) + 3)) {
if (filename[0] == '\0' || lastch(filename) == '/')
sprintf(str, "%s%s", filename, DIALOGRC);
else
sprintf(str, "%s/%s", tempptr, DIALOGRC);
rc_file = fopen(tempptr = str, "rt");
sprintf(str, "%s/%s", filename, DIALOGRC);
rc_file = fopen(filename = str, "rt");
}
}
if (rc_file == NULL) { /* step (b) failed? */
/* try step (c) */
strcpy(str, GLOBALRC);
if ((rc_file = fopen(tempptr = str, "rt")) == NULL)
if ((rc_file = fopen(filename = str, "rt")) == NULL)
return 0; /* step (c) failed, use default values */
}
DLG_TRACE(("# opened rc file \"%s\"\n", tempptr));
DLG_TRACE(("# opened rc file \"%s\"\n", filename));
/* Scan each line and set variables */
while ((result == 0) && (fgets(str, MAX_LEN, rc_file) != NULL)) {
DLG_TRACE(("#\t%s", str));
if (*str == '\0' || lastch(str) != '\n') {
/* ignore rest of file if line too long */
fprintf(stderr, "\nParse error: line %d of configuration"
" file too long.\n", l);
report_error(filename, l, "line too long");
result = -1; /* parse aborted */
break;
}
@ -536,7 +591,7 @@ dlg_parse_rc(void)
lastch(str) = '\0';
if (begins_with(str, "bindkey", &params)) {
if (!dlg_parse_bindkey(params)) {
fprintf(stderr, "\nParse error: line %d of configuration\n", l);
report_error(filename, l, "invalid bindkey");
result = -1;
}
continue;
@ -556,9 +611,7 @@ dlg_parse_rc(void)
case VAL_STR:
if (!isquote(value[0]) || !isquote(lastch(value))
|| strlen(value) < 2) {
fprintf(stderr, "\nParse error: string value "
"expected at line %d of configuration "
"file.\n", l);
report_error(filename, l, "expected string value");
result = -1; /* parse aborted */
} else {
/* remove the (") quotes */
@ -573,38 +626,34 @@ dlg_parse_rc(void)
else if (!dlg_strcmp(value, "OFF"))
*((bool *) vars[i].var) = FALSE;
else {
fprintf(stderr, "\nParse error: boolean value "
"expected at line %d of configuration "
"file (found %s).\n", l, value);
report_error(filename, l, "expected boolean value");
result = -1; /* parse aborted */
}
break;
}
#ifdef HAVE_COLOR
} else if ((i = find_color(var)) >= 0) {
int fg = 0;
int bg = 0;
int hl = 0;
if (str_to_attr(value, &fg, &bg, &hl) == -1) {
fprintf(stderr, "\nParse error: attribute "
"value expected at line %d of configuration "
"file.\n", l);
DIALOG_COLORS temp;
if (str_to_attr(value, &temp) == -1) {
report_error(filename, l, "expected attribute value");
result = -1; /* parse aborted */
} else {
dlg_color_table[i].fg = fg;
dlg_color_table[i].bg = bg;
dlg_color_table[i].hilite = hl;
dlg_color_table[i].fg = temp.fg;
dlg_color_table[i].bg = temp.bg;
dlg_color_table[i].hilite = temp.hilite;
#ifdef HAVE_RC_FILE2
dlg_color_table[i].ul = temp.ul;
dlg_color_table[i].rv = temp.rv;
#endif /* HAVE_RC_FILE2 */
}
} else {
#endif /* HAVE_COLOR */
fprintf(stderr, "\nParse error: unknown variable "
"at line %d of configuration file:\n\t%s\n", l, var);
report_error(filename, l, "unknown variable");
result = -1; /* parse aborted */
}
break;
case LINE_ERROR:
fprintf(stderr, "\nParse error: syntax error at line %d of "
"configuration file.\n", l);
report_error(filename, l, "syntax error");
result = -1; /* parse aborted */
break;
}

View File

@ -1,7 +1,7 @@
#! /bin/sh
# $Id: headers.sh,v 1.3 2007/02/25 20:37:56 tom Exp $
#!/bin/sh
# $Id: run_test.sh,v 1.1 2020/03/20 12:08:00 tom Exp $
##############################################################################
# Copyright (c) 2004,2007 Thomas E. Dickey #
# Copyright (c) 2020 Thomas E. Dickey #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -27,77 +27,32 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
#
# Adjust includes for header files that reside in a subdirectory of
# /usr/include, etc.
#
# Parameters (the first case creates the sed script):
# $1 is the target directory
# $2 is the source directory
# or (the second case does the install, using the sed script):
# $1 is the script to use for installing
# $2 is the target directory
# $3 is the source directory
# $4 is the file to install, editing source/target/etc.
PACKAGE=DIALOG
PKGNAME=DLG
CONFIGH=dlg_config.h
failed() {
echo "? $*" >&2
exit 1
}
TMPSED=headers.sed
: ${DIALOG=./dialog}
CONFIG=samples
INPUTS=inputs.rc
OUTPUT=output.rc
if test $# = 2 ; then
rm -f $TMPSED
DST=$1
REF=$2
LEAF=`basename $DST`
case $DST in
/*/include/$LEAF)
END=`basename $DST`
for i in $REF/*.h
do
NAME=`basename $i`
echo "s/<$NAME>/<$END\/$NAME>/g" >> $TMPSED
done
;;
*)
echo "" >> $TMPSED
;;
esac
for name in `
egrep '^#define[ ][ ]*[_ABCDEFGHIJKLMNOPQRSTUVWXYZ]' $REF/$CONFIGH \
| sed -e 's/^#define[ ][ ]*//' \
-e 's/[ ].*//' \
| egrep -v "^${PACKAGE}_" \
| sort -u \
| egrep -v "^${PKGNAME}_"`
do
echo "s/\\<$name\\>/${PKGNAME}_$name/g" >>$TMPSED
done
else
PRG=""
while test $# != 3
do
PRG="$PRG $1"; shift
done
[ $# != 0 ] && CONFIG="$1"
DST=$1
REF=$2
SRC=$3
[ -f "$DIALOG" ] || failed "no such file: $DIALOG"
[ -d "$CONFIG" ] || failed "no such directory: $CONFIG"
SHOW=`basename $SRC`
TMPSRC=${TMPDIR-/tmp}/${SHOW}$$
for rcfile in $CONFIG/*.rc
do
echo "** $rcfile"
DIALOGRC="$rcfile" $DIALOG --create-rc $OUTPUT
sed -e '/^#/d' "$OUTPUT" >"$INPUTS"
mv -f $INPUTS $OUTPUT
sed -e '/^#/d' "$rcfile" >"$INPUTS"
diff -u $INPUTS $OUTPUT | \
sed -e "s,$INPUTS,$rcfile," \
-e "s,$OUTPUT,$rcfile-test,"
done
echo " ... $SHOW"
test -f $REF/$SRC && SRC="$REF/$SRC"
rm -f $TMPSRC
sed -f $TMPSED $SRC > $TMPSRC
NAME=`basename $SRC`
# Just in case someone gzip'd manpages, remove the conflicting copy.
test -f $DST/$NAME.gz && rm -f $DST/$NAME.gz
eval $PRG $TMPSRC $DST/$NAME
rm -f $TMPSRC
fi
rm -f $INPUTS $OUTPUT

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: buildlist,v 1.2 2012/12/04 11:45:21 tom Exp $
# $Id: buildlist,v 1.3 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -15,6 +15,6 @@ $DIALOG --title "BUILDLIST DEMO" --backtitle "A user-built list" \
"5" "Item number 5" "off" \
"6" "Item number 6" "on" 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: buildlist2,v 1.6 2012/12/23 22:28:12 tom Exp $
# $Id: buildlist2,v 1.8 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -23,10 +23,10 @@ do
esac
case "x$DIALOGOPTS" in
*--no-items*|*--noitem*)
echo $filename $state >>$input
echo "$filename $state" >>$input
;;
*)
echo $count $filename $state >>$input
echo "$count $filename $state" >>$input
;;
esac
count=`expr $count + 1`
@ -34,9 +34,9 @@ done
$DIALOG --title "BUILDLIST DEMO" --backtitle "A user-built list" \
--visit-items --scrollbar --separator "|" \
--buildlist "hello, this is a --buildlist..." 0 0 10 `cat $input` 2> $output
--buildlist "hello, this is a --buildlist..." 0 0 10 `cat "$input"` 2> $output
retval=$?
returncode=$?
tempfile=$output
. ./report-tempfile

View File

@ -0,0 +1,22 @@
#!/bin/sh
# $Id: buildlist4,v 1.2 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
. ./setup-tempfile
$DIALOG --title "BUILDLIST DEMO" --backtitle "A user-built list" \
--separator "|" \
--help-button \
--item-help \
--buildlist "hello, this is a --buildlist..." 0 0 0 \
"1" "Item number 1" "on" first \
"2" "Item number 2" "off" second \
"3" "Item number 3" "on" third \
"4" "Item number 4" "on" fourth \
"5" "Item number 5" "off" fifth \
"6" "Item number 6" "on" sixth 2> $tempfile
returncode=$?
. ./report-tempfile

View File

@ -1,11 +1,11 @@
#!/bin/sh
# $Id: calendar,v 1.9 2010/01/13 10:20:33 tom Exp $
# $Id: calendar,v 1.11 2020/11/26 00:09:12 tom Exp $
. ./setup-vars
exec 3>&1
RESULT=`$DIALOG --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981 2>&1 1>&3`
retval=$?
returntext=`$DIALOG --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981 2>&1 1>&3`
returncode=$?
exec 3>&-
. ./report-string

View File

@ -1,9 +1,9 @@
#!/bin/sh
# $Id: calendar-stdout,v 1.6 2010/01/13 10:20:03 tom Exp $
# $Id: calendar-stdout,v 1.8 2020/11/26 00:09:12 tom Exp $
. ./setup-vars
RESULT=`$DIALOG --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981`
retval=$?
returntext=`$DIALOG --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981`
returncode=$?
. ./report-string

View File

@ -1,11 +1,11 @@
#!/bin/sh
# $Id: calendar2,v 1.8 2010/01/13 10:20:03 tom Exp $
# $Id: calendar2,v 1.10 2020/11/26 00:09:12 tom Exp $
. ./setup-vars
exec 3>&1
RESULT=`$DIALOG --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 2>&1 1>&3`
retval=$?
returntext=`$DIALOG --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 2>&1 1>&3`
returncode=$?
exec 3>&-
. ./report-string

View File

@ -1,9 +1,9 @@
#!/bin/sh
# $Id: calendar2-stdout,v 1.6 2010/01/13 10:20:03 tom Exp $
# $Id: calendar2-stdout,v 1.8 2020/11/26 00:09:12 tom Exp $
. ./setup-vars
RESULT=`$DIALOG --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0`
retval=$?
returntext=`$DIALOG --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0`
returncode=$?
. ./report-string

View File

@ -1,11 +1,11 @@
#!/bin/sh
# $Id: calendar3,v 1.9 2010/01/13 10:20:03 tom Exp $
# $Id: calendar3,v 1.11 2020/11/26 00:09:12 tom Exp $
. ./setup-vars
exec 3>&1
RESULT=`$DIALOG --extra-button --extra-label "Hold" --help-button --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981 2>&1 1>&3`
retval=$?
returntext=`$DIALOG --extra-button --extra-label "Hold" --help-button --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981 2>&1 1>&3`
returncode=$?
exec 3>&-
. ./report-string

View File

@ -1,9 +1,9 @@
#!/bin/sh
# $Id: calendar3-stdout,v 1.6 2010/01/13 10:20:03 tom Exp $
# $Id: calendar3-stdout,v 1.8 2020/11/26 00:09:12 tom Exp $
. ./setup-vars
RESULT=`$DIALOG --extra-button --extra-label "Hold" --help-button --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981`
retval=$?
returntext=`$DIALOG --extra-button --extra-label "Hold" --help-button --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981`
returncode=$?
. ./report-string

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist,v 1.14 2010/01/13 10:20:03 tom Exp $
# $Id: checklist,v 1.15 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -23,6 +23,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish." On \
"Lemon" "You know how it tastes." on 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist-8bit,v 1.8 2010/01/13 10:20:03 tom Exp $
# $Id: checklist-8bit,v 1.10 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -17,14 +17,14 @@ UP/DOWN arrow keys, the first letter of the choice as a \n\
hot key, or the number keys 1-9 to choose an option. \n\
Press SPACE to toggle an option on/off. \n\n\
Which of the following are fruits?" 20 61 5 \
"`./rotated-data 0 $SAMPLE`" "It's an `./rotated-data 0 $SAMPLE`." off \
"`./rotated-data 1 $SAMPLE`" "No, that's not my `./rotated-data 1 $SAMPLE`." ON \
"`./rotated-data 2 $SAMPLE`" "Yeah, that's `./rotated-data 2 $SAMPLE`." off \
"`./rotated-data 3 $SAMPLE`" "Normally not a `./rotated-data 3 $SAMPLE`." off \
"`./rotated-data 4 $SAMPLE`" "No, never put a `./rotated-data 4 $SAMPLE` there!" oN \
"`./rotated-data 5 $SAMPLE`" "Cats like `./rotated-data 5 $SAMPLE`." On \
"`./rotated-data 6 $SAMPLE`" "You `./rotated-data 6 $SAMPLE` how it is." on 2> $tempfile
"`./rotated-data 0 "$SAMPLE"`" "It's an `./rotated-data 0 "$SAMPLE"`." off \
"`./rotated-data 1 "$SAMPLE"`" "No, that's not my `./rotated-data 1 "$SAMPLE"`." ON \
"`./rotated-data 2 "$SAMPLE"`" "Yeah, that's `./rotated-data 2 "$SAMPLE"`." off \
"`./rotated-data 3 "$SAMPLE"`" "Normally not a `./rotated-data 3 "$SAMPLE"`." off \
"`./rotated-data 4 "$SAMPLE"`" "No, never put a `./rotated-data 4 "$SAMPLE"` there!" oN \
"`./rotated-data 5 "$SAMPLE"`" "Cats like `./rotated-data 5 "$SAMPLE"`." On \
"`./rotated-data 6 "$SAMPLE"`" "You `./rotated-data 6 "$SAMPLE"` how it is." on 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist-utf8,v 1.12 2010/01/13 10:20:03 tom Exp $
# $Id: checklist-utf8,v 1.13 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -25,6 +25,6 @@ Press SPACE to toggle an option on/off. \n\n\
"" "Cats like ." On \
"" "You how it ." on 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist1,v 1.10 2010/01/13 10:20:03 tom Exp $
# $Id: checklist1,v 1.11 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -23,6 +23,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish." On \
"Lemon" "You know how it tastes." on 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist10,v 1.9 2010/01/13 10:20:03 tom Exp $
# $Id: checklist10,v 1.10 2020/11/26 00:03:58 tom Exp $
# zero-width column
. ./setup-vars
@ -25,6 +25,6 @@ Press SPACE to toggle an option on/off. \n\n\
Noninteractive "" on \
2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist11,v 1.1 2010/01/17 23:04:01 tom Exp $
# $Id: checklist11,v 1.2 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -28,6 +28,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish." On \
"Lemon" "You know how it tastes." on 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist12,v 1.3 2012/12/23 22:27:51 tom Exp $
# $Id: checklist12,v 1.5 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -23,7 +23,7 @@ $CUT >$input <<-EOF
Fish:Cats like fish.:On
Lemon:You know how it tastes.:on
EOF
cat $input | sed -e 's/^/"/' -e 's/:/" "/g' -e 's/$/"/' >$output
sed -e 's/^/"/' -e 's/:/" "/g' -e 's/$/"/' <$input >$output
cat $output >$input
$DIALOG --backtitle "No Such Organization" \
@ -38,7 +38,7 @@ Press SPACE to toggle an option on/off. \n\n\
Which of the following are fruits?" 20 61 5 \
--file $input 2> $output
retval=$?
returncode=$?
tempfile=$output
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist2,v 1.11 2010/01/13 10:20:03 tom Exp $
# $Id: checklist2,v 1.12 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -23,6 +23,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish." On "not a fruit" \
"Lemon" "You know how it tastes." on "the only one you wouldn't eat" 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist3,v 1.11 2010/01/13 10:20:03 tom Exp $
# $Id: checklist3,v 1.12 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -23,6 +23,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
"Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist4,v 1.12 2010/01/13 10:20:03 tom Exp $
# $Id: checklist4,v 1.13 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -23,6 +23,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
"Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist5,v 1.11 2010/01/13 10:20:03 tom Exp $
# $Id: checklist5,v 1.12 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -24,6 +24,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
"Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist6,v 1.11 2010/01/13 10:20:03 tom Exp $
# $Id: checklist6,v 1.12 2020/11/26 00:03:58 tom Exp $
# example showing the --colors option
. ./setup-vars
@ -25,6 +25,6 @@ Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
"Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
"Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist7,v 1.11 2010/01/13 10:20:03 tom Exp $
# $Id: checklist7,v 1.12 2020/11/26 00:03:58 tom Exp $
# "checklist6" with --separate-output
. ./setup-vars
@ -29,6 +29,6 @@ Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
"Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
"Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist8,v 1.10 2010/01/13 10:20:03 tom Exp $
# $Id: checklist8,v 1.11 2020/11/26 00:03:58 tom Exp $
# "checklist7" without --item-help
. ./setup-vars
@ -28,6 +28,6 @@ Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
"Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On \
"Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on 2> $tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: checklist9,v 1.8 2010/01/13 10:20:03 tom Exp $
# $Id: checklist9,v 1.9 2020/11/26 00:03:58 tom Exp $
# "checklist8" using --file
. ./setup-vars
@ -8,6 +8,6 @@
$DIALOG "$@" --file checklist9.txt 2>$tempfile
retval=$?
returncode=$?
. ./report-tempfile

View File

@ -17,7 +17,7 @@ packer /usr/bin/zip $F $P
# Maximum arcmail file size, will start new arcmail file if exceeds
maxfsize 65000
# Maximum packet size, ifmail/ifnews will start new packet if exeeds.
# Maximum packet size, ifmail/ifnews will start new packet if exceeds.
# .out files are NOT created if nonzero specified, you must run ifpack
# to make packets out. (unimplemented)
maxpsize 65000
@ -60,7 +60,7 @@ msgidbm /tmp/ifmsgids
# \D untranslated telephone no. (send strings only)
# ModemPort present a blank-separated list of ports with possible speed
# extention (separated by colon); if speed is prefixed with 'L', it is
# extension (separated by colon); if speed is prefixed with 'L', it is
# a "locked" port speed, otherwise it is a maximum speed to be set, while
# actual speed is taken from the nodelist. If speed is omitted (or set
# to zero), previous port speed is not changed.

View File

@ -7,13 +7,13 @@ ModemError NO\sDIAL
ModemError RING\r
ModemError ERROR
# Call options (time, address and nodelist flag dependant)
# Call options (time, address and nodelist flag dependent)
# All matching are applied in the order they are specified.
# Possible options are "[No]Call", "[No]Hold", "[No]PUA", "[No]EMSI",
# "[No]WaZOO", "[No]Freqs", "[No]Zmodem", "[No]ZedZap", "[No]Janus",
# "[No]Hydra". Here, WaZOO stands for YooHoo/2U2 handshake, not for
# the transfer scheme. FTS-0001 handshake and DietIFNA scheme cannot
# be disallowed (because they are mandatory by standart). "Hold"
# be disallowed (because they are mandatory by standard). "Hold"
# means really hold "hold" type packets and files: do not send them
# if our system initiated the session, "NoHold" means send "hold"
# packets when our system initiated the session. "NoPUA" stands for

View File

@ -1,5 +1,5 @@
#!/usr/bin/python
# $Id: dialog.py,v 1.4 2012/06/29 09:33:18 tom Exp $
# $Id: dialog.py,v 1.5 2019/12/10 22:52:52 tom Exp $
# Module: dialog.py
# Copyright (c) 2000 Robb Shecter <robb@acm.org>
# All rights reserved.
@ -252,11 +252,11 @@ def scrollbox(self, text, height=20, width=60, title=''):
def gauge_start(self, perc=0, text='', height=8, width=54, title=''):
"""
Display gauge output window.
Gauge normal usage (assuming that there is an instace of 'Dialog'
Gauge normal usage (assuming that there is an instance of 'Dialog'
class named 'd'):
d.gauge_start()
# do something
d.gauge_iterate(10) # passed throgh 10%
d.gauge_iterate(10) # passed through 10%
# ...
d.gauge_iterate(100, 'any text here') # work is done
d.stop_gauge() # clean-up actions

View File

@ -1,11 +1,11 @@
#!/bin/sh
# $Id: dselect,v 1.7 2016/01/26 22:52:53 tom Exp $
# $Id: dselect,v 1.10 2020/11/26 00:09:12 tom Exp $
. ./setup-vars
exec 3>&1
RESULT=`$DIALOG --title "Please choose a file" "$@" --dselect $HOME/ 14 48 2>&1 1>&3`
retval=$?
returntext=`$DIALOG --title "Please choose a file" "$@" --dselect "$HOME/" 14 48 2>&1 1>&3`
returncode=$?
exec 3>&-
. ./report-string

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: editbox,v 1.13 2010/01/13 10:20:03 tom Exp $
# $Id: editbox,v 1.14 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -40,6 +40,6 @@ EOF
$DIALOG --title "EDIT BOX" \
--fixed-font "$@" --editbox $input 0 0 2>$output
retval=$?
returncode=$?
. ./report-edit

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: editbox-utf8,v 1.9 2010/01/13 10:20:03 tom Exp $
# $Id: editbox-utf8,v 1.10 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -30,6 +30,6 @@ EOF
$DIALOG --title "EDIT BOX" \
--fixed-font "$@" --editbox $input 0 0 2>$output
retval=$?
returncode=$?
. ./report-edit

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: editbox2,v 1.7 2010/01/13 10:20:03 tom Exp $
# $Id: editbox2,v 1.8 2020/11/26 00:03:58 tom Exp $
# example with extra- and help-buttons
. ./setup-vars
@ -40,6 +40,6 @@ $DIALOG --title "EDIT BOX" \
--extra-button \
--help-button \
--fixed-font "$@" --editbox $input 0 0 2>$output
retval=$?
returncode=$?
. ./report-edit

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: editbox3,v 1.7 2010/01/13 10:20:03 tom Exp $
# $Id: editbox3,v 1.8 2020/11/26 00:03:58 tom Exp $
# example with extra- and help-buttons
. ./setup-vars
@ -13,6 +13,6 @@ $DIALOG --title "EDIT BOX" \
--extra-button \
--help-button \
--fixed-font "$@" --editbox $input 0 0 2>$output
retval=$?
returncode=$?
. ./report-edit

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: editbox4,v 1.1 2010/01/17 22:29:50 tom Exp $
# $Id: editbox4,v 1.2 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
@ -40,6 +40,6 @@ EOF
$DIALOG --title "EDIT BOX" \
--fixed-font "$@" --editbox $input 20 40 2>$output
retval=$?
returncode=$?
. ./report-edit

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: form1,v 1.15 2011/10/04 23:36:53 tom Exp $
# $Id: form1,v 1.18 2020/11/26 00:34:39 tom Exp $
. ./setup-vars
@ -19,7 +19,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250
do
exec 3>&1
value=`$DIALOG --ok-label "Submit" \
returntext=`$DIALOG --ok-label "Submit" \
--backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \
20 50 0 \
@ -31,7 +31,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$?
exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'`
show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in
$DIALOG_CANCEL)
@ -63,16 +63,8 @@ $show" 10 40
echo "Button 3 (Extra) pressed."
exit
;;
$DIALOG_ERROR)
echo "ERROR!$value"
exit
;;
$DIALOG_ESC)
echo "ESC pressed."
exit
;;
*)
echo "Return code was $returncode"
. ./report-button
exit
;;
esac

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: form1-both,v 1.5 2010/01/13 10:47:35 tom Exp $
# $Id: form1-both,v 1.8 2020/11/26 00:34:22 tom Exp $
. ./setup-vars
@ -16,7 +16,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250
do
exec 3>&1
value=`$DIALOG --ok-label "Submit" \
returntext=`$DIALOG --ok-label "Submit" \
--extra-button --help-button \
--backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \
@ -29,7 +29,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$?
exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'`
show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in
$DIALOG_CANCEL)
@ -53,16 +53,8 @@ show=`echo "$value" |sed -e 's/^/ /'`
--msgbox "Resulting data:\n\
$show" 10 40
;;
$DIALOG_HELP)
echo "Button 2 (Help) pressed."
exit
;;
$DIALOG_EXTRA)
echo "Button 3 (Extra) pressed."
exit
;;
*)
echo "Return code was $returncode"
. ./report-button
exit
;;
esac

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: form1-extra,v 1.5 2010/01/13 10:47:35 tom Exp $
# $Id: form1-extra,v 1.8 2020/11/26 00:34:05 tom Exp $
. ./setup-vars
@ -16,7 +16,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250
do
exec 3>&1
value=`$DIALOG --ok-label "Submit" \
returntext=`$DIALOG --ok-label "Submit" \
--extra-button \
--backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \
@ -29,7 +29,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$?
exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'`
show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in
$DIALOG_CANCEL)
@ -53,16 +53,8 @@ show=`echo "$value" |sed -e 's/^/ /'`
--msgbox "Resulting data:\n\
$show" 10 40
;;
$DIALOG_HELP)
echo "Button 2 (Help) pressed."
exit
;;
$DIALOG_EXTRA)
echo "Button 3 (Extra) pressed."
exit
;;
*)
echo "Return code was $returncode"
. ./report-button
exit
;;
esac

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: form1-help,v 1.5 2010/01/13 10:47:35 tom Exp $
# $Id: form1-help,v 1.8 2020/11/26 00:33:42 tom Exp $
. ./setup-vars
@ -16,7 +16,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250
do
exec 3>&1
value=`$DIALOG --ok-label "Submit" \
returntext=`$DIALOG --ok-label "Submit" \
--help-button \
--backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \
@ -29,7 +29,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$?
exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'`
show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in
$DIALOG_CANCEL)
@ -53,16 +53,8 @@ show=`echo "$value" |sed -e 's/^/ /'`
--msgbox "Resulting data:\n\
$show" 10 40
;;
$DIALOG_HELP)
echo "Button 2 (Help) pressed."
exit
;;
$DIALOG_EXTRA)
echo "Button 3 (Extra) pressed."
exit
;;
*)
echo "Return code was $returncode"
. ./report-button
exit
;;
esac

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: form1-utf8,v 1.7 2010/01/13 10:47:35 tom Exp $
# $Id: form1-utf8,v 1.10 2020/11/26 00:33:23 tom Exp $
. ./setup-vars
@ -18,7 +18,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250
do
exec 3>&1
value=`$DIALOG --ok-label "Submit" \
returntext=`$DIALOG --ok-label "Submit" \
--backtitle "$backtitle" \
--insecure "$@" \
--form "Here is a possible piece of a configuration program." \
@ -31,7 +31,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$?
exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'`
show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in
$DIALOG_CANCEL)
@ -55,16 +55,8 @@ show=`echo "$value" |sed -e 's/^/ /'`
--msgbox "Resulting data:\n\
$show" 10 40
;;
$DIALOG_HELP)
echo "Button 2 (Help) pressed."
exit
;;
$DIALOG_EXTRA)
echo "Button 3 (Extra) pressed."
exit
;;
*)
echo "Return code was $returncode"
. ./report-button
exit
;;
esac

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: form2,v 1.9 2010/01/13 10:53:11 tom Exp $
# $Id: form2,v 1.12 2020/11/26 00:33:02 tom Exp $
. ./setup-vars
@ -16,7 +16,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250
do
exec 3>&1
value=`$DIALOG --ok-label "Submit" \
returntext=`$DIALOG --ok-label "Submit" \
--backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \
0 0 10 \
@ -52,7 +52,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$?
exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'`
show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in
$DIALOG_CANCEL)
@ -77,7 +77,7 @@ show=`echo "$value" |sed -e 's/^/ /'`
$show" 0 0
;;
*)
echo "Return code was $returncode"
. ./report-button
exit
;;
esac

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: form3,v 1.6 2010/01/13 10:49:52 tom Exp $
# $Id: form3,v 1.9 2020/11/26 00:32:45 tom Exp $
# form1 with --help-button
. ./setup-vars
@ -17,7 +17,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250
do
exec 3>&1
value=`$DIALOG --ok-label "Submit" \
returntext=`$DIALOG --ok-label "Submit" \
--help-button \
--backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \
@ -30,7 +30,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$?
exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'`
show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in
$DIALOG_CANCEL)
@ -62,7 +62,7 @@ $show" 10 40
$show" 10 40
;;
*)
echo "Return code was $returncode"
. ./report-button
exit
;;
esac

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: form4,v 1.6 2010/01/13 10:49:52 tom Exp $
# $Id: form4,v 1.9 2020/11/26 00:32:31 tom Exp $
# form3 with --item-help
. ./setup-vars
@ -17,7 +17,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250
do
exec 3>&1
value=`$DIALOG --ok-label "Submit" \
returntext=`$DIALOG --ok-label "Submit" \
--help-button \
--item-help \
--backtitle "$backtitle" "$@" \
@ -31,7 +31,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$?
exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'`
show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in
$DIALOG_CANCEL)
@ -63,7 +63,7 @@ $show" 10 40
$show" 10 40
;;
*)
echo "Return code was $returncode"
. ./report-button
exit
;;
esac

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: form5,v 1.6 2010/01/13 10:49:52 tom Exp $
# $Id: form5,v 1.9 2020/11/26 00:32:17 tom Exp $
# form4 with --help-status
. ./setup-vars
@ -17,7 +17,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250
do
exec 3>&1
value=`$DIALOG --ok-label "Submit" \
returntext=`$DIALOG --ok-label "Submit" \
--help-status \
--help-button \
--item-help \
@ -32,7 +32,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$?
exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'`
show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in
$DIALOG_CANCEL)
@ -64,7 +64,7 @@ $show" 10 40
$show" 10 40
;;
*)
echo "Return code was $returncode"
. ./report-button
exit
;;
esac

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Id: form6,v 1.5 2010/01/13 10:49:52 tom Exp $
# $Id: form6,v 1.8 2020/11/26 00:31:55 tom Exp $
# form4 with --help-status
. ./setup-vars
@ -17,7 +17,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250
do
exec 3>&1
value=`$DIALOG --ok-label "Submit" \
returntext=`$DIALOG --ok-label "Submit" \
--help-status \
--help-button \
--item-help \
@ -32,7 +32,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$?
exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'`
show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in
$DIALOG_CANCEL)
@ -64,7 +64,7 @@ $show" 10 40
$show" 10 40
;;
*)
echo "Return code was $returncode"
. ./report-button
exit
;;
esac

Some files were not shown because too many files have changed in this diff Show More