Import dialog 1.1-20110707. This adds support for several features (e.g.

--hline) found in the old FreeBSD dialog.
This commit is contained in:
nwhitehorn 2011-07-14 13:57:13 +00:00
parent 9904759c67
commit 94f19e0029
43 changed files with 3764 additions and 1559 deletions

89
CHANGES
View File

@ -1,9 +1,94 @@
-- $Id: CHANGES,v 1.333 2011/03/02 10:06:37 tom Exp $ -- $Id: CHANGES,v 1.360 2011/07/07 23:35:10 tom Exp $
-- Thomas E. Dickey <dickey@invisible-island.net> -- Thomas E. Dickey <dickey@invisible-island.net>
This version of dialog was originally from a Debian snapshot. I've done this This version of dialog was originally from a Debian snapshot. I've done this
to it: to it:
2011/07/07
+ modify util.c to work better with old versions of ncurses:
+ suppress use of wchgat() before fix in 20060715 which is needed
for simple shadow manipulation used here in 2011/06/30 (report
by xDog Walker).
+ add a null-pointer check in dlg_print_scrolled()
+ fix a regression in dlg_getc() introduced by changes to intercept
F1 for help-popup (report by xDog Walker).
2011/06/30
+ correct license statement for prgbox.c (Debian #632198).
+ correct layout when "--colors" is used, by discounting characters in
the escape sequences from the column counts (report by xDog Walker).
+ modify dlg_checklist() so that only one item in the list can
initially be selected (report by xDog Walker).
+ add/use macro dlg_enter_buttoncode() to improve implementation of
"--nook" option (report by xDog Walker).
+ add option "--no-nl-expand" to suppress the conversion of "\n"
strings into newlines (request by xDog Walker).
+ modify LIB_CREATE symbol in makefile.in to include the library
dependencies such as ncurses. This is needed when dynamically
loading the library (report/analysis by xDog Walker).
+ modify dlg_exit_label() to suppress the Cancel button, for
consistency.
+ modify dlg_exit_label() to honor the --nook option, except when there
is no other button, e.g., the help-button.
+ modify dlg_exit_buttoncode() so that it returns the proper code for
help-button (report by xDog Walker).
+ correct loop limit when processing "--column-separator" (report by
xDog Walker).
+ modify handling of "--version" and "--help" to ensure that they are
processed, and exit before widgets. Separate "--print-version"
from "--version", allowing its output to be interspersed with
widget output (report by xDog Walker).
+ correct a few places where "--version" or "--help" options went
always to stdout rather than allowing redirection with the "--stderr"
option (report by xDog Walker).
+ improve repainting after erasing a widget and its shadow.
+ add "--hline" and "--hfile" options for compatibility with FreeBSD
dialog (request by Devin Teske).
+ add dialog version message when opening a trace file (request by
xDog Walker).
+ show filename of rc-file in traces.
+ add piped-in data for gauge widget to traces.
+ add entrypoints to gauge widget, for allocating, updating and freeing
the widget (adapted from patch by Stephen Hurd).
+ fix a reference to freed memory in the gauge widget.
+ fix --no-mouse option by actually closing the mouse (report by
xDog Walker).
+ add sk.po from
http://translationproject.org/latest/dialog/
+ limit Solaris xpg4 portability fix for redefinition of ERR to cover
the specific value found in <sys/regset.h>, in case an application
includes dialog.h after curses.h (FreeBSD #156601, report by Jaakko
Heinonen, Stephen Hurd).
+ updated configure macros:
+ CF_CURSES_CPPFLAGS,
+ CF_CURSES_LIBS, make checks for special libraries on hpux10 and
sunos4 optional
+ CF_CURSES_FUNCS, workaround for bug in gcc 4.2.1 (FreeBSD 8.1)
which caused part of test program to be omitted, i.e., when it saw
two return-statements in a row it omitted the _first_ one. Also
add expression to pointer check to help FreeBSD's linker decide it
should be validated. Just an assignment was not enough. Also, add
check for unctrl.h
+ CF_CURSES_HEADER, change order for curses.h / ncurses.h pairs to
put ncurses.h first, which will tend to provide the same #define's
as in CF_NCURSES_HEADER (report by Dennis Preiser).
+ CF_CURSES_TERM_H, modify to avoid spurious check for
<curses.hterm.h> if there is no ncurses version. Look for
ncurses's term.h anyway, to work around breakage by packagers who
separate ncurses' header files.
+ CF_DISABLE_RPATH_HACK, fix garbled message
+ CF_LD_RPATH_OPT, add mirbsd
+ CF_MAKEFLAGS, filter out GNU make's entering/leaving messages.
This only appeared when using the macro in a dpkg script, though it
should have in other cases.
+ CF_RPATH_HACK, add a check for libraries not found, e.g., from
suppressed functionality of gcc in linking from /usr/local/lib, and
add a -L option to help work around this.
+ CF_XOPEN_SOURCE, workaround for cygwin to get ncurses' configure
script to define _XOPEN_SOURCE_EXTENDED (cygwin's features.h
doesn't do anything, so it needs a crutch).
+ updated config.guess, config.sub
2011/03/02 2011/03/02
+ add --prgbox and --programbox (adapted from patch by David Boyd). + add --prgbox and --programbox (adapted from patch by David Boyd).
+ add sl.po from + add sl.po from
@ -649,7 +734,7 @@ to it:
colors to be the same, provided that bold attribute is set. colors to be the same, provided that bold attribute is set.
Also improved the logic for choosing a background color when the Also improved the logic for choosing a background color when the
foreground and background are the same (report by Erika Pacholleck). foreground and background are the same (report by Erika Pacholleck).
+ update configure script macro CF_XOPEN_SOURCE, ensuring that the + updated configure script macro CF_XOPEN_SOURCE, ensuring that the
_POSIX_C_SOURCE value is defined with a specific value (bug report _POSIX_C_SOURCE value is defined with a specific value (bug report
originally for lynx). originally for lynx).
+ fix configure script so that po/makefile is generated properly when + fix configure script so that po/makefile is generated properly when

View File

@ -1 +1 @@
9:0:0 1.1 20110302 10:0:0 1.1 20110707

199
aclocal.m4 vendored
View File

@ -1,5 +1,5 @@
dnl macros used for DIALOG configure script dnl macros used for DIALOG configure script
dnl $Id: aclocal.m4,v 1.80 2011/01/18 23:17:01 tom Exp $ dnl $Id: aclocal.m4,v 1.82 2011/06/28 22:48:31 tom Exp $
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Copyright 1999-2010,2011 -- Thomas E. Dickey dnl Copyright 1999-2010,2011 -- Thomas E. Dickey
dnl dnl
@ -1128,7 +1128,7 @@ CF_NCURSES_VERSION
CF_CURSES_LIBS CF_CURSES_LIBS
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_CURSES_CPPFLAGS version: 10 updated: 2009/01/06 19:34:11 dnl CF_CURSES_CPPFLAGS version: 11 updated: 2011/04/09 14:51:08
dnl ------------------ dnl ------------------
dnl Look for the curses headers. dnl Look for the curses headers.
AC_DEFUN([CF_CURSES_CPPFLAGS],[ AC_DEFUN([CF_CURSES_CPPFLAGS],[
@ -1137,13 +1137,19 @@ AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[
cf_cv_curses_incdir=no cf_cv_curses_incdir=no
case $host_os in #(vi case $host_os in #(vi
hpux10.*) #(vi hpux10.*) #(vi
test -d /usr/include/curses_colr && \ if test "x$cf_cv_screen" = "xcurses_colr"
cf_cv_curses_incdir="-I/usr/include/curses_colr" then
test -d /usr/include/curses_colr && \
cf_cv_curses_incdir="-I/usr/include/curses_colr"
fi
;; ;;
sunos3*|sunos4*) sunos3*|sunos4*)
test -d /usr/5lib && \ if test "x$cf_cv_screen" = "xcurses_5lib"
test -d /usr/5include && \ then
cf_cv_curses_incdir="-I/usr/5include" test -d /usr/5lib && \
test -d /usr/5include && \
cf_cv_curses_incdir="-I/usr/5include"
fi
;; ;;
esac esac
]) ])
@ -1153,7 +1159,7 @@ CF_CURSES_HEADER
CF_TERM_HEADER CF_TERM_HEADER
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_CURSES_FUNCS version: 15 updated: 2010/10/23 15:52:32 dnl CF_CURSES_FUNCS version: 17 updated: 2011/05/14 16:07:29
dnl --------------- dnl ---------------
dnl Curses-functions are a little complicated, since a lot of them are macros. dnl Curses-functions are a little complicated, since a lot of them are macros.
AC_DEFUN([CF_CURSES_FUNCS], AC_DEFUN([CF_CURSES_FUNCS],
@ -1161,6 +1167,7 @@ AC_DEFUN([CF_CURSES_FUNCS],
AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
AC_REQUIRE([CF_XOPEN_CURSES]) AC_REQUIRE([CF_XOPEN_CURSES])
AC_REQUIRE([CF_CURSES_TERM_H]) AC_REQUIRE([CF_CURSES_TERM_H])
AC_REQUIRE([CF_CURSES_UNCTRL_H])
for cf_func in $1 for cf_func in $1
do do
CF_UPPER(cf_tr_func,$cf_func) CF_UPPER(cf_tr_func,$cf_func)
@ -1173,7 +1180,8 @@ do
[ [
#ifndef ${cf_func} #ifndef ${cf_func}
long foo = (long)(&${cf_func}); long foo = (long)(&${cf_func});
${cf_cv_main_return:-return}(foo == 0); if (foo + 1234 > 5678)
${cf_cv_main_return:-return}(foo);
#endif #endif
], ],
[cf_result=yes], [cf_result=yes],
@ -1190,7 +1198,7 @@ ${cf_cv_main_return:-return}(foo == 0);
done done
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_CURSES_HEADER version: 2 updated: 2010/04/28 06:02:16 dnl CF_CURSES_HEADER version: 3 updated: 2011/05/01 19:47:45
dnl ---------------- dnl ----------------
dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
dnl variations of ncurses' installs. dnl variations of ncurses' installs.
@ -1200,10 +1208,10 @@ AC_DEFUN([CF_CURSES_HEADER],[
AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[ AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
cf_cv_ncurses_header=none cf_cv_ncurses_header=none
for cf_header in ifelse($1,,,[ \ for cf_header in ifelse($1,,,[ \
$1/curses.h \ $1/ncurses.h \
$1/ncurses.h]) \ $1/curses.h]) \
curses.h \ ncurses.h \
ncurses.h ifelse($1,,[ncurses/curses.h ncurses/ncurses.h]) curses.h ifelse($1,,[ncurses/ncurses.h ncurses/curses.h])
do do
AC_TRY_COMPILE([#include <${cf_header}>], AC_TRY_COMPILE([#include <${cf_header}>],
[initscr(); tgoto("?", 0,0)], [initscr(); tgoto("?", 0,0)],
@ -1219,7 +1227,7 @@ fi
AC_CHECK_HEADERS($cf_cv_ncurses_header) AC_CHECK_HEADERS($cf_cv_ncurses_header)
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_CURSES_LIBS version: 32 updated: 2011/01/16 17:43:15 dnl CF_CURSES_LIBS version: 34 updated: 2011/04/09 14:51:08
dnl -------------- dnl --------------
dnl Look for the curses libraries. Older curses implementations may require dnl Look for the curses libraries. Older curses implementations may require
dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first. dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first.
@ -1239,19 +1247,26 @@ freebsd*) #(vi
AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)]) AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)])
;; ;;
hpux10.*) #(vi hpux10.*) #(vi
AC_CHECK_LIB(cur_colr,initscr,[ # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
CF_ADD_LIBS(-lcur_colr) # next (1998), and xcurses "newer" (2000). There is no header file for
ac_cv_func_initscr=yes # Hcurses; the subdirectory curses_colr has the headers (curses.h and
],[ # term.h) for cur_colr
AC_CHECK_LIB(Hcurses,initscr,[ if test "x$cf_cv_screen" = "xcurses_colr"
# HP's header uses __HP_CURSES, but user claims _HP_CURSES. then
CF_ADD_LIBS(-lHcurses) AC_CHECK_LIB(cur_colr,initscr,[
CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES" CF_ADD_LIBS(-lcur_colr)
ac_cv_func_initscr=yes ac_cv_func_initscr=yes
])]) ],[
AC_CHECK_LIB(Hcurses,initscr,[
# HP's header uses __HP_CURSES, but user claims _HP_CURSES.
CF_ADD_LIBS(-lHcurses)
CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
ac_cv_func_initscr=yes
])])
fi
;; ;;
linux*) linux*)
case `arch` in case `arch 2>/dev/null` in
x86_64) x86_64)
if test -d /lib64 if test -d /lib64
then then
@ -1266,9 +1281,12 @@ linux*)
esac esac
;; ;;
sunos3*|sunos4*) sunos3*|sunos4*)
if test -d /usr/5lib ; then if test "x$cf_cv_screen" = "xcurses_5lib"
CF_ADD_LIBDIR(/usr/5lib) then
CF_ADD_LIBS(-lcurses -ltermcap) if test -d /usr/5lib ; then
CF_ADD_LIBDIR(/usr/5lib)
CF_ADD_LIBS(-lcurses -ltermcap)
fi
fi fi
ac_cv_func_initscr=yes ac_cv_func_initscr=yes
;; ;;
@ -1333,7 +1351,7 @@ fi
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_CURSES_TERM_H version: 8 updated: 2010/10/23 15:54:49 dnl CF_CURSES_TERM_H version: 9 updated: 2011/04/09 18:19:55
dnl ---------------- dnl ----------------
dnl SVr4 curses should have term.h as well (where it puts the definitions of dnl SVr4 curses should have term.h as well (where it puts the definitions of
dnl the low-level interface). This may not be true in old/broken implementations, dnl the low-level interface). This may not be true in old/broken implementations,
@ -1347,9 +1365,17 @@ AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
# If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
# for <term.h> if we do not find the variant. # for <term.h> if we do not find the variant.
for cf_header in \
`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \ cf_header_list="term.h ncurses/term.h ncursesw/term.h"
term.h
case ${cf_cv_ncurses_header:-curses.h} in #(vi
*/*)
cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
cf_header_list="$cf_header_item $cf_header_list"
;;
esac
for cf_header in $cf_header_list
do do
AC_TRY_COMPILE([ AC_TRY_COMPILE([
#include <${cf_cv_ncurses_header:-curses.h}> #include <${cf_cv_ncurses_header:-curses.h}>
@ -1395,6 +1421,61 @@ ncursesw/term.h)
esac esac
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_CURSES_UNCTRL_H version: 1 updated: 2011/04/09 18:19:55
dnl ------------------
dnl Any X/Open curses implementation must have unctrl.h, but ncurses packages
dnl may put it in a subdirectory (along with ncurses' other headers, of
dnl course). Packages which put the headers in inconsistent locations are
dnl broken).
AC_DEFUN([CF_CURSES_UNCTRL_H],
[
AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
AC_CACHE_CHECK(for unctrl.h, cf_cv_unctrl_header,[
# If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
# for <unctrl.h> if we do not find the variant.
cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
case ${cf_cv_ncurses_header:-curses.h} in #(vi
*/*)
cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
cf_header_list="$cf_header_item $cf_header_list"
;;
esac
for cf_header in $cf_header_list
do
AC_TRY_COMPILE([
#include <${cf_cv_ncurses_header:-curses.h}>
#include <${cf_header}>],
[WINDOW *x],
[cf_cv_unctrl_header=$cf_header
break],
[cf_cv_unctrl_header=no])
done
case $cf_cv_unctrl_header in #(vi
no)
AC_MSG_WARN(unctrl.h header not found)
;;
esac
])
case $cf_cv_unctrl_header in #(vi
unctrl.h) #(vi
AC_DEFINE(HAVE_UNCTRL_H)
;;
ncurses/unctrl.h) #(vi
AC_DEFINE(HAVE_NCURSES_UNCTRL_H)
;;
ncursesw/unctrl.h)
AC_DEFINE(HAVE_NCURSESW_UNCTRL_H)
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CURSES_WACS_MAP version: 5 updated: 2011/01/15 11:28:59 dnl CF_CURSES_WACS_MAP version: 5 updated: 2011/01/15 11:28:59
dnl ------------------ dnl ------------------
dnl Check for likely values of wacs_map[]. dnl Check for likely values of wacs_map[].
@ -1518,7 +1599,7 @@ fi
AC_SUBST(LIBTOOL_VERSION) AC_SUBST(LIBTOOL_VERSION)
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_RPATH_HACK version: 1 updated: 2010/04/11 10:54:00 dnl CF_DISABLE_RPATH_HACK version: 2 updated: 2011/02/13 13:31:33
dnl --------------------- dnl ---------------------
dnl The rpath-hack makes it simpler to build programs, particularly with the dnl The rpath-hack makes it simpler to build programs, particularly with the
dnl *BSD ports which may have essential libraries in unusual places. But it dnl *BSD ports which may have essential libraries in unusual places. But it
@ -1526,7 +1607,7 @@ dnl can interfere with building an executable for the base system. Use this
dnl option in that case. dnl option in that case.
AC_DEFUN([CF_DISABLE_RPATH_HACK], AC_DEFUN([CF_DISABLE_RPATH_HACK],
[ [
AC_MSG_CHECKING(if rpath should be not be set) AC_MSG_CHECKING(if rpath-hack should be disabled)
CF_ARG_DISABLE(rpath-hack, CF_ARG_DISABLE(rpath-hack,
[ --disable-rpath-hack don't add rpath options for additional libraries], [ --disable-rpath-hack don't add rpath options for additional libraries],
[cf_disable_rpath_hack=yes], [cf_disable_rpath_hack=yes],
@ -2256,7 +2337,7 @@ ifdef([AC_FUNC_FSEEKO],[
]) ])
]) ])
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05 dnl CF_LD_RPATH_OPT version: 4 updated: 2011/06/04 20:09:13
dnl --------------- dnl ---------------
dnl For the given system and compiler, find the compiler flags to pass to the dnl For the given system and compiler, find the compiler flags to pass to the
dnl loader to use the "rpath" feature. dnl loader to use the "rpath" feature.
@ -2277,7 +2358,7 @@ irix*) #(vi
linux*|gnu*|k*bsd*-gnu) #(vi linux*|gnu*|k*bsd*-gnu) #(vi
LD_RPATH_OPT="-Wl,-rpath," LD_RPATH_OPT="-Wl,-rpath,"
;; ;;
openbsd[[2-9]].*) #(vi openbsd[[2-9]].*|mirbsd*) #(vi
LD_RPATH_OPT="-Wl,-rpath," LD_RPATH_OPT="-Wl,-rpath,"
;; ;;
freebsd*) #(vi freebsd*) #(vi
@ -2356,7 +2437,7 @@ ifelse($1,,,[$1=$LIB_PREFIX])
AC_SUBST(LIB_PREFIX) AC_SUBST(LIB_PREFIX)
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_MAKEFLAGS version: 13 updated: 2010/10/23 15:52:32 dnl CF_MAKEFLAGS version: 14 updated: 2011/03/31 19:29:46
dnl ------------ dnl ------------
dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
dnl options to lower-levels. It's very useful for "make -n" -- if we have it. dnl options to lower-levels. It's very useful for "make -n" -- if we have it.
@ -2373,7 +2454,7 @@ SHELL = /bin/sh
all : all :
@ echo '.$cf_option' @ echo '.$cf_option'
CF_EOF CF_EOF
cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ ]]*$,,'` cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'`
case "$cf_result" in case "$cf_result" in
.*k) .*k)
cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
@ -3107,7 +3188,7 @@ $1=`echo "$2" | \
-e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'`
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_RPATH_HACK version: 8 updated: 2010/04/17 15:38:58 dnl CF_RPATH_HACK version: 9 updated: 2011/02/13 13:31:33
dnl ------------- dnl -------------
AC_DEFUN([CF_RPATH_HACK], AC_DEFUN([CF_RPATH_HACK],
[ [
@ -3120,9 +3201,36 @@ if test -n "$LD_RPATH_OPT" ; then
cf_rpath_list="/usr/lib /lib" cf_rpath_list="/usr/lib /lib"
if test "$cf_ldd_prog" != no if test "$cf_ldd_prog" != no
then then
cf_rpath_oops=
AC_TRY_LINK([#include <stdio.h>], AC_TRY_LINK([#include <stdio.h>],
[printf("Hello");], [printf("Hello");],
[cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`]) [cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`])
# If we passed the link-test, but get a "not found" on a given library,
# this could be due to inept reconfiguration of gcc to make it only
# partly honor /usr/local/lib (or whatever). Sometimes this behavior
# is intentional, e.g., installing gcc in /usr/bin and suppressing the
# /usr/local libraries.
if test -n "$cf_rpath_oops"
then
for cf_rpath_src in $cf_rpath_oops
do
for cf_rpath_dir in \
/usr/local \
/usr/pkg \
/opt/sfw
do
if test -f $cf_rpath_dir/lib/$cf_rpath_src
then
CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src)
LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
break
fi
done
done
fi
fi fi
CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS)
@ -3572,7 +3680,7 @@ if test "$with_dmalloc" = yes ; then
fi fi
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_WITH_LIBTOOL version: 26 updated: 2010/10/23 15:55:24 dnl CF_WITH_LIBTOOL version: 27 updated: 2011/06/28 18:45:38
dnl --------------- dnl ---------------
dnl Provide a configure option to incorporate libtool. Define several useful dnl Provide a configure option to incorporate libtool. Define several useful
dnl symbols for the makefile rules. dnl symbols for the makefile rules.
@ -3648,7 +3756,7 @@ ifdef([AC_PROG_LIBTOOL],[
AC_MSG_ERROR(Cannot find libtool) AC_MSG_ERROR(Cannot find libtool)
fi fi
])dnl ])dnl
LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o' LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} $(LIBS) -o'
LIB_OBJECT='${OBJECTS:.o=.lo}' LIB_OBJECT='${OBJECTS:.o=.lo}'
LIB_SUFFIX=.la LIB_SUFFIX=.la
LIB_CLEAN='${LIBTOOL} --mode=clean' LIB_CLEAN='${LIBTOOL} --mode=clean'
@ -3842,7 +3950,7 @@ AC_TRY_LINK([
test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
])dnl ])dnl
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42 dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37
dnl --------------- dnl ---------------
dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
dnl or adapt to the vendor's definitions to get equivalent functionality, dnl or adapt to the vendor's definitions to get equivalent functionality,
@ -3861,6 +3969,9 @@ case $host_os in #(vi
aix[[456]]*) #(vi aix[[456]]*) #(vi
cf_xopen_source="-D_ALL_SOURCE" cf_xopen_source="-D_ALL_SOURCE"
;; ;;
cygwin) #(vi
cf_XOPEN_SOURCE=600
;;
darwin[[0-8]].*) #(vi darwin[[0-8]].*) #(vi
cf_xopen_source="-D_APPLE_C_SOURCE" cf_xopen_source="-D_APPLE_C_SOURCE"
;; ;;

View File

@ -1,5 +1,5 @@
/* /*
* $Id: arrows.c,v 1.33 2011/01/19 00:27:53 tom Exp $ * $Id: arrows.c,v 1.36 2011/06/27 09:13:56 tom Exp $
* *
* arrows.c -- draw arrows to indicate end-of-range for lists * arrows.c -- draw arrows to indicate end-of-range for lists
* *
@ -36,6 +36,10 @@
#define add_acs(win, code) waddch(win, dlg_boxchar(code)) #define add_acs(win, code) waddch(win, dlg_boxchar(code))
#endif #endif
/* size of decorations */
#define ON_LEFT 4
#define ON_RIGHT 3
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
static chtype static chtype
merge_colors(chtype foreground, chtype background) merge_colors(chtype foreground, chtype background)
@ -59,6 +63,36 @@ merge_colors(chtype foreground, chtype background)
#define merge_colors(f,b) (f) #define merge_colors(f,b) (f)
#endif #endif
/*
* If we have help-line text, e.g., from "--hline", draw it between the other
* decorations at the bottom of the dialog window.
*/
void
dlg_draw_helpline(WINDOW *win, bool decorations)
{
int cur_x, cur_y;
int bottom;
if (dialog_vars.help_line != 0
&& (bottom = getmaxy(win) - 1) > 0) {
chtype attr = A_NORMAL;
const int *cols = dlg_index_columns(dialog_vars.help_line);
int other = decorations ? (ON_LEFT + ON_RIGHT) : 0;
int avail = (getmaxx(win) - other - 2);
int limit = dlg_limit_columns(dialog_vars.help_line, avail, 0);
if (limit > 0) {
getyx(win, cur_y, cur_x);
other = decorations ? ON_LEFT : 0;
(void) wmove(win, bottom, other + (avail - limit) / 2);
waddch(win, '[');
dlg_print_text(win, dialog_vars.help_line, cols[limit], &attr);
waddch(win, ']');
wmove(win, cur_y, cur_x);
}
}
}
void void
dlg_draw_arrows2(WINDOW *win, dlg_draw_arrows2(WINDOW *win,
int top_arrow, int top_arrow,
@ -94,7 +128,7 @@ dlg_draw_arrows2(WINDOW *win,
(void) waddstr(win, "(-)"); (void) waddstr(win, "(-)");
} else { } else {
wattrset(win, attr); wattrset(win, attr);
(void) whline(win, dlg_boxchar(ACS_HLINE), 4); (void) whline(win, dlg_boxchar(ACS_HLINE), ON_LEFT);
} }
} }
mouse_mkbutton(top, x - 1, 6, KEY_PPAGE); mouse_mkbutton(top, x - 1, 6, KEY_PPAGE);
@ -106,7 +140,7 @@ dlg_draw_arrows2(WINDOW *win,
(void) waddstr(win, "(+)"); (void) waddstr(win, "(+)");
} else { } else {
wattrset(win, borderattr); wattrset(win, borderattr);
(void) whline(win, dlg_boxchar(ACS_HLINE), 4); (void) whline(win, dlg_boxchar(ACS_HLINE), ON_LEFT);
} }
mouse_mkbutton(bottom, x - 1, 6, KEY_NPAGE); mouse_mkbutton(bottom, x - 1, 6, KEY_NPAGE);
@ -141,6 +175,7 @@ dlg_draw_scrollbar(WINDOW *win,
getyx(win, oldy, oldx); getyx(win, oldy, oldx);
getmaxyx(win, maxy, maxx); getmaxyx(win, maxy, maxx);
dlg_draw_helpline(win, TRUE);
if (bottom_arrow || top_arrow || dialog_state.use_scrollbar) { if (bottom_arrow || top_arrow || dialog_state.use_scrollbar) {
percent = (!total_data percent = (!total_data
? 100 ? 100
@ -213,6 +248,7 @@ dlg_draw_arrows(WINDOW *win,
int top, int top,
int bottom) int bottom)
{ {
dlg_draw_helpline(win, TRUE);
dlg_draw_arrows2(win, dlg_draw_arrows2(win,
top_arrow, top_arrow,
bottom_arrow, bottom_arrow,

View File

@ -1,5 +1,5 @@
/* /*
* $Id: buttons.c,v 1.84 2011/01/19 00:27:53 tom Exp $ * $Id: buttons.c,v 1.86 2011/06/28 10:46:46 tom Exp $
* *
* buttons.c -- draw buttons, e.g., OK/Cancel * buttons.c -- draw buttons, e.g., OK/Cancel
* *
@ -442,16 +442,23 @@ const char **
dlg_exit_label(void) dlg_exit_label(void)
{ {
const char **result; const char **result;
DIALOG_VARS save;
if (dialog_vars.extra_button) { if (dialog_vars.extra_button) {
dlg_save_vars(&save);
dialog_vars.nocancel = TRUE;
result = dlg_ok_labels(); result = dlg_ok_labels();
dlg_restore_vars(&save);
} else { } else {
static const char *labels[3]; static const char *labels[3];
int n = 0; int n = 0;
labels[n++] = my_exit_label(); if (!dialog_vars.nook)
labels[n++] = my_exit_label();
if (dialog_vars.help_button) if (dialog_vars.help_button)
labels[n++] = my_help_label(); labels[n++] = my_help_label();
if (n == 0)
labels[n++] = my_exit_label();
labels[n] = 0; labels[n] = 0;
result = labels; result = labels;
@ -465,7 +472,17 @@ dlg_exit_label(void)
int int
dlg_exit_buttoncode(int button) dlg_exit_buttoncode(int button)
{ {
return dlg_ok_buttoncode(button); int result;
DIALOG_VARS save;
dlg_save_vars(&save);
dialog_vars.nocancel = TRUE;
result = dlg_ok_buttoncode(button);
dlg_restore_vars(&save);
return result;
} }
const char ** const char **

View File

@ -1,5 +1,5 @@
/* /*
* $Id: calendar.c,v 1.60 2011/01/03 23:29:51 tom Exp $ * $Id: calendar.c,v 1.62 2011/06/29 09:47:06 tom Exp $
* *
* calendar.c -- implements the calendar box * calendar.c -- implements the calendar box
* *
@ -388,6 +388,7 @@ dialog_calendar(const char *title,
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
DLG_KEYS_DATA( DLGK_ENTER, ' ' ), DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ), DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
@ -571,7 +572,7 @@ dialog_calendar(const char *title,
state = sYEAR; state = sYEAR;
break; break;
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_ok_buttoncode(button); result = dlg_enter_buttoncode(button);
break; break;
case DLGK_FIELD_PREV: case DLGK_FIELD_PREV:
state = dlg_prev_ok_buttonindex(state, sMONTH); state = dlg_prev_ok_buttonindex(state, sMONTH);

View File

@ -1,5 +1,5 @@
/* /*
* $Id: checklist.c,v 1.124 2011/01/19 00:27:53 tom Exp $ * $Id: checklist.c,v 1.127 2011/06/29 23:04:09 tom Exp $
* *
* checklist.c -- implements the checklist box * checklist.c -- implements the checklist box
* *
@ -149,6 +149,7 @@ dlg_checklist(const char *title,
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ), DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ), DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
@ -193,6 +194,24 @@ dlg_checklist(const char *title,
dlg_does_output(); dlg_does_output();
dlg_tab_correct_str(prompt); dlg_tab_correct_str(prompt);
/*
* If this is a radiobutton list, ensure that no more than one item is
* selected initially. Allow none to be selected, since some users may
* wish to provide this flavor.
*/
if (flag == FLAG_RADIO) {
bool first = TRUE;
for (i = 0; i < item_no; i++) {
if (items[i].state) {
if (first) {
first = FALSE;
} else {
items[i].state = 0;
}
}
}
}
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
retry: retry:
#endif #endif
@ -291,11 +310,12 @@ dlg_checklist(const char *title,
choice = max_choice - 1; choice = max_choice - 1;
} }
/* Print the list */ /* Print the list */
for (i = 0; i < max_choice; i++) for (i = 0; i < max_choice; i++) {
print_item(list, print_item(list,
&items[i + scrollamt], &items[i + scrollamt],
states, states,
i, i == choice); i, i == choice);
}
(void) wnoutrefresh(list); (void) wnoutrefresh(list);
/* register the new window, along with its borders */ /* register the new window, along with its borders */
@ -565,7 +585,7 @@ dlg_checklist(const char *title,
if (fkey) { if (fkey) {
switch (key) { switch (key) {
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_ok_buttoncode(button); result = dlg_enter_buttoncode(button);
break; break;
case DLGK_FIELD_PREV: case DLGK_FIELD_PREV:
button = dlg_prev_button(buttons, button); button = dlg_prev_button(buttons, button);

View File

@ -1,5 +1,5 @@
/* /*
* $Id: columns.c,v 1.7 2011/01/16 21:51:44 tom Exp $ * $Id: columns.c,v 1.8 2011/06/28 09:26:23 tom Exp $
* *
* columns.c -- implements column-alignment * columns.c -- implements column-alignment
* *
@ -25,7 +25,7 @@
#define each(row, data) \ #define each(row, data) \
row = 0, data = target; \ row = 0, data = target; \
row < num_rows - 1; \ row < num_rows; \
++row, data = next_row(data, per_row) ++row, data = next_row(data, per_row)
static char * static char *

37
config.guess vendored
View File

@ -1,10 +1,10 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# Free Software Foundation, Inc. # 2911 Free Software Foundation, Inc.
timestamp='2010-09-24' timestamp='2011-01-01'
# This file is free software; you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public License as published by
@ -57,8 +57,8 @@ GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Software Foundation, Inc. Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -92,7 +92,7 @@ if test $# != 0; then
exit 1 exit 1
fi fi
trap 'exit 1' HUP INT TERM trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a # 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 # compiler to aid in system detection is discouraged as it requires
@ -106,7 +106,7 @@ trap 'exit 1' HUP INT TERM
set_cc_for_build=' set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 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" HUP INT PIPE TERM ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ; : ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$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) ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
@ -270,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel. # A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r. # 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit ;; # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*) Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem? # How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead # Should we change UNAME_MACHINE based on the output of uname instead
@ -326,8 +329,8 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sparc) echo sparc-icl-nx7; exit ;; sparc) echo sparc-icl-nx7; exit ;;
esac ;; esac ;;
s390x:SunOS:*:*) s390x:SunOS:*:*)
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;; exit ;;
sun4H:SunOS:5.*:*) sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;; exit ;;
@ -495,7 +498,7 @@ EOF
else else
echo i586-dg-dgux${UNAME_RELEASE} echo i586-dg-dgux${UNAME_RELEASE}
fi fi
exit ;; exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3) M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3 echo m88k-dolphin-sysv3
exit ;; exit ;;
@ -820,8 +823,8 @@ EOF
echo x86_64-unknown-interix${UNAME_RELEASE} echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;; exit ;;
IA64) IA64)
echo ia64-unknown-interix${UNAME_RELEASE} echo ia64-unknown-interix${UNAME_RELEASE}
exit ;; exit ;;
esac ;; esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks echo i${UNAME_MACHINE}-pc-mks
@ -934,14 +937,14 @@ EOF
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;; ;;
or32:Linux:*:*) or32:Linux:*:*)
echo or32-unknown-linux-gnu echo or32-unknown-linux-gnu
exit ;; exit ;;
padre:Linux:*:*) padre:Linux:*:*)
echo sparc-unknown-linux-gnu echo sparc-unknown-linux-gnu
exit ;; exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*) parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu echo hppa64-unknown-linux-gnu
exit ;; exit ;;
parisc:Linux:*:* | hppa:Linux:*:*) parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level # Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in

75
config.sub vendored
View File

@ -2,9 +2,9 @@
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# Free Software Foundation, Inc. # 2011 Free Software Foundation, Inc.
timestamp='2010-09-11' timestamp='2011-04-01'
# This file is (in principle) common to ALL GNU software. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software # The presence of a machine in this file suggests that SOME GNU software
@ -76,8 +76,8 @@ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Software Foundation, Inc. Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -175,10 +175,10 @@ case $os in
os=-chorusos os=-chorusos
basic_machine=$1 basic_machine=$1
;; ;;
-chorusrdb) -chorusrdb)
os=-chorusrdb os=-chorusrdb
basic_machine=$1 basic_machine=$1
;; ;;
-hiux*) -hiux*)
os=-hiuxwe2 os=-hiuxwe2
;; ;;
@ -283,12 +283,13 @@ case $basic_machine in
| moxie \ | moxie \
| mt \ | mt \
| msp430 \ | msp430 \
| nds32 | nds32le | nds32be\ | nds32 | nds32le | nds32be \
| nios | nios2 \ | nios | nios2 \
| ns16k | ns32k \ | ns16k | ns32k \
| open8 \
| or32 \ | or32 \
| pdp10 | pdp11 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \ | pyramid \
| rx \ | rx \
| score \ | score \
@ -296,12 +297,12 @@ case $basic_machine in
| sh64 | sh64le \ | sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \ | spu \
| tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \ | ubicom32 \
| v850 | v850e \ | v850 | v850e \
| we32k \ | we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | x86 | xc16x | xstormy16 | xtensa \
| z8k | z80) | z8k | z80)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
@ -324,7 +325,15 @@ case $basic_machine in
ms1) ms1)
basic_machine=mt-unknown basic_machine=mt-unknown
;; ;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown' # We use `pc' rather than `unknown'
# because (1) that's what they normally are, and # because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users. # (2) the word "unknown" tends to confuse beginning users.
@ -382,24 +391,25 @@ case $basic_machine in
| nds32-* | nds32le-* | nds32be-* \ | nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* \ | nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \ | none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \ | orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \ | pyramid-* \
| romp-* | rs6000-* | rx-* \ | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \ | sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \ | tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile-* | tilegx-* \ | tile-* | tilegx-* \
| tron-* \ | tron-* \
| ubicom32-* \ | ubicom32-* \
| v850-* | v850e-* | vax-* \ | v850-* | v850e-* | vax-* \
| we32k-* \ | we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \ | xstormy16-* | xtensa*-* \
| ymp-* \ | ymp-* \
| z8k-* | z80-*) | z8k-* | z80-*)
@ -539,7 +549,7 @@ case $basic_machine in
basic_machine=craynv-cray basic_machine=craynv-cray
os=-unicosmp os=-unicosmp
;; ;;
cr16) cr16 | cr16-*)
basic_machine=cr16-unknown basic_machine=cr16-unknown
os=-elf os=-elf
;; ;;
@ -826,10 +836,10 @@ case $basic_machine in
basic_machine=v70-nec basic_machine=v70-nec
os=-sysv os=-sysv
;; ;;
next | m*-next ) next | m*-next)
basic_machine=m68k-next basic_machine=m68k-next
case $os in case $os in
-nextstep* ) -nextstep*)
;; ;;
-ns2*) -ns2*)
os=-nextstep2 os=-nextstep2
@ -948,11 +958,14 @@ case $basic_machine in
pn) pn)
basic_machine=pn-gould basic_machine=pn-gould
;; ;;
power) basic_machine=power-ibm power)
basic_machine=power-ibm
;; ;;
ppc) basic_machine=powerpc-unknown ppc | ppcbe)
basic_machine=powerpc-unknown
;; ;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppcle | powerpclittle | ppc-le | powerpc-little) ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown basic_machine=powerpcle-unknown
@ -960,9 +973,11 @@ case $basic_machine in
ppcle-* | powerpclittle-*) ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppc64) basic_machine=powerpc64-unknown ppc64)
basic_machine=powerpc64-unknown
;; ;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ppc64-*)
basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little) ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown basic_machine=powerpc64le-unknown
@ -1046,6 +1061,9 @@ case $basic_machine in
basic_machine=i860-stratus basic_machine=i860-stratus
os=-sysv4 os=-sysv4
;; ;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2) sun2)
basic_machine=m68000-sun basic_machine=m68000-sun
;; ;;
@ -1178,6 +1196,9 @@ case $basic_machine in
xps | xps100) xps | xps100)
basic_machine=xps100-honeywell basic_machine=xps100-honeywell
;; ;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp) ymp)
basic_machine=ymp-cray basic_machine=ymp-cray
os=-unicos os=-unicos
@ -1400,7 +1421,7 @@ case $os in
-nova*) -nova*)
os=-rtmk-nova os=-rtmk-nova
;; ;;
-ns2 ) -ns2)
os=-nextstep2 os=-nextstep2
;; ;;
-nsk*) -nsk*)
@ -1597,7 +1618,7 @@ case $basic_machine in
m88k-omron*) m88k-omron*)
os=-luna os=-luna
;; ;;
*-next ) *-next)
os=-nextstep os=-nextstep
;; ;;
*-sequent) *-sequent)

2189
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
dnl $Id: configure.in,v 1.64 2011/03/01 00:59:50 tom Exp $ dnl $Id: configure.in,v 1.65 2011/06/27 10:42:27 tom Exp $
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Copyright 1999-2010,2011 -- Thomas E. Dickey dnl Copyright 1999-2010,2011 -- Thomas E. Dickey
@ -225,6 +225,7 @@ getparx \
getpary \ getpary \
getparyx \ getparyx \
use_default_colors \ use_default_colors \
wchgat \
wget_wch \ wget_wch \
) )

View File

@ -1,5 +1,5 @@
'\" t '\" t
.\" $Id: dialog.1,v 1.126 2011/03/02 01:24:21 tom Exp $ .\" $Id: dialog.1,v 1.133 2011/06/29 09:39:29 tom Exp $
.\" Copyright 2005-2010,2011 Thomas E. Dickey .\" Copyright 2005-2010,2011 Thomas E. Dickey
.\" .\"
.\" This program is free software; you can redistribute it and/or modify .\" This program is free software; you can redistribute it and/or modify
@ -36,7 +36,7 @@
.RE .RE
.. ..
. .
.TH \*D 1 "" "$Date: 2011/03/02 01:24:21 $" .TH \*D 1 "" "$Date: 2011/06/29 09:39:29 $"
.SH NAME .SH NAME
\*p \- display dialog boxes from shell scripts \*p \- display dialog boxes from shell scripts
.SH SYNOPSIS .SH SYNOPSIS
@ -285,8 +285,9 @@ Override the label used for "Extra" buttons.
Note: for inputmenu widgets, this defaults to "Rename". Note: for inputmenu widgets, this defaults to "Rename".
. .
.IP "\fB--help" .IP "\fB--help"
Prints the help message to \fB\*p\fP's output. Prints the help message to the standard output and exits.
The help message is printed if no options are given. The help message is also printed if no options are given,
or if an unrecognized option is given.
. .
.IP "\fB--help-button" .IP "\fB--help-button"
Show a help-button after "OK" and "Cancel" buttons, Show a help-button after "OK" and "Cancel" buttons,
@ -307,6 +308,12 @@ after the item-help "HELP" information.
This can be used to reconstruct the state of a checklist after processing This can be used to reconstruct the state of a checklist after processing
the help request. the help request.
. .
.IP "\fB--hfile \fIfilename"
Display the given file using a textbox when the user presses F1.
.
.IP "\fB--hline \fIstring"
Display the given string centered at the bottom of the widget.
.
.IP "\fB--ignore" .IP "\fB--ignore"
Ignore options that \fB\*p\fP does not recognize. Ignore options that \fB\*p\fP does not recognize.
Some well-known ones such as "\fB--icon\fP" are ignored anyway, Some well-known ones such as "\fB--icon\fP" are ignored anyway,
@ -385,6 +392,10 @@ See also "\fB--ascii-lines\fR".
.IP "\fB--no-mouse .IP "\fB--no-mouse
Do not enable the mouse. Do not enable the mouse.
. .
.IP "\fB--no-nl-expand
Do not convert "\\n" substrings of the message/prompt text into
literal newlines.
.
.IP "\fB--no-ok" .IP "\fB--no-ok"
.IP "\fB--nook" .IP "\fB--nook"
Suppress the "OK" button in checklist, inputbox and menu box modes. Suppress the "OK" button in checklist, inputbox and menu box modes.
@ -420,8 +431,9 @@ Prints the size of each dialog box to \fB\*p\fP's output.
.IP "\fB--print-version" .IP "\fB--print-version"
Prints \fB\*p\fR's version to \fB\*p\fP's output. Prints \fB\*p\fR's version to \fB\*p\fP's output.
This may be used alone, without other options. This may be used alone, without other options.
It does not cause \fBdialog\fP to exit by itself.
. .
.IP "\fB--scrollbar \fIstring" .IP "\fB--scrollbar"
For widgets holding a scrollable set of data, For widgets holding a scrollable set of data,
draw a scrollbar on its right-margin. draw a scrollbar on its right-margin.
This does not respond to the mouse. This does not respond to the mouse.
@ -501,6 +513,7 @@ string to be displayed at the top of the dialog box.
logs the command-line parameters and logs the command-line parameters and
keystrokes to the given file. keystrokes to the given file.
If \fBdialog\fP reads a configure file, it is logged as well. If \fBdialog\fP reads a configure file, it is logged as well.
Piped input to the \fIgauge\fP widget is logged.
Use control/T to log a picture of the current dialog window. Use control/T to log a picture of the current dialog window.
. .
.IP "\fB--trim" .IP "\fB--trim"
@ -511,7 +524,8 @@ trim literal newlines and repeated blanks from message text.
See also the "\fB--cr-wrap\fR" and "\fB--no-collapse\fR" options. See also the "\fB--cr-wrap\fR" and "\fB--no-collapse\fR" options.
. .
.IP "\fB--version" .IP "\fB--version"
Same as "\fB--print-version\fP". Prints \fB\*p\fR's version to the standard output, and exits.
See also "\fB--print-version\fP".
. .
.IP "\fB--visit-items" .IP "\fB--visit-items"
Modify the tab-traversal of checklist, radiobox, menubox and inputmenu Modify the tab-traversal of checklist, radiobox, menubox and inputmenu
@ -1278,12 +1292,13 @@ also does not work for common options of \*p, such as the gauge box.
original dialog 0.4 program. original dialog 0.4 program.
.PP .PP
\fBwhiptail\fP's manpage borrows features from \fB\*p\fP, e.g., \fBwhiptail\fP's manpage borrows features from \fB\*p\fP, e.g.,
\fB--default-item\fP, \fB--output-fd\fP, \fB--default-item\fP (2000),
but oddly cites only \fB\*p\fP versions up to 0.4 as a source. \fB--output-fd\fP (2002),
but oddly cites only \fB\*p\fP versions up to 0.4 (1996) as a source.
That is, its manpage refers to features which That is, its manpage refers to features which
were borrowed from more recent versions of \fB\*p\fP, e.g., were borrowed from more recent versions of \fB\*p\fP, e.g.,
the \fB--gauge\fP and \fB--password\fP boxes, the \fB--gauge\fP and \fB--password\fP boxes,
as well as options such as \fB-separate-output\fP. as well as options such as \fB-separate-output\fP (2008).
Somewhat humorously, one may note that the \fBpopt\fP feature Somewhat humorously, one may note that the \fBpopt\fP feature
(undocumented in its manpage) (undocumented in its manpage)
of using a "--" as an escape was documented in \fB\*p\fP's manpage about of using a "--" as an escape was documented in \fB\*p\fP's manpage about

541
dialog.3
View File

@ -1,4 +1,4 @@
.\" $Id: dialog.3,v 1.60 2011/03/02 10:19:12 tom Exp $ .\" $Id: dialog.3,v 1.68 2011/06/29 09:07:36 tom Exp $
.\" Copyright 2005-2010,2011 Thomas E. Dickey .\" Copyright 2005-2010,2011 Thomas E. Dickey
.\" .\"
.\" This program is free software; you can redistribute it and/or modify .\" This program is free software; you can redistribute it and/or modify
@ -21,11 +21,24 @@
.ds l dialog .ds l dialog
.ds L Dialog .ds L Dialog
.ds D DIALOG .ds D DIALOG
.
.de ES
.ne 8
.IP
..
.de EX
.RS +10
.nf
..
.de EE
.fi
.RE
..
.\" Bulleted paragraph .\" Bulleted paragraph
.de bP .de bP
.IP \(bu 4 .IP \(bu 4
.. ..
.TH \*D 3 "" "$Date: 2011/03/02 10:19:12 $" .TH \*D 3 "" "$Date: 2011/06/29 09:07:36 $"
.SH NAME .SH NAME
\*l \- widgets and utilities for the \*p program \*l \- widgets and utilities for the \*p program
.SH SYNOPSIS .SH SYNOPSIS
@ -66,7 +79,7 @@ Colors and video attributes are categorized and associated with
settings in the configuration file settings in the configuration file
(see the discussion of \fI$DIALOGRC\fP in \fB\*p\fP(1)). (see the discussion of \fI$DIALOGRC\fP in \fB\*p\fP(1)).
The \fIDIALOG_ATR(n)\fP macro is used for defining the references The \fIDIALOG_ATR(n)\fP macro is used for defining the references
to the combined color and attribute table \fIdlg_color_table[]\fP. to the combined color and attribute table \fBdlg_color_table[]\fP.
.PP .PP
The \fB\*p\fP application passes its command-line parameters The \fB\*p\fP application passes its command-line parameters
to the widget functions. Some of those parameters are single values, to the widget functions. Some of those parameters are single values,
@ -85,7 +98,7 @@ These include definitions based on the generated \fI<dlg_config.h>\fP header.
.SH DATA STRUCTURES .SH DATA STRUCTURES
All of the global data for the \fB\*l\fP library is stored in All of the global data for the \fB\*l\fP library is stored in
a few structures: \fIDIALOG_STATE\fP, \fIDIALOG_VARS\fP and \fIDIALOG_COLORS\fP. a few structures: \fIDIALOG_STATE\fP, \fIDIALOG_VARS\fP and \fIDIALOG_COLORS\fP.
The corresponding \fIdialog_state\fP, \fIdialog_vars\fP and \fIdlg_color_table\fP The corresponding \fBdialog_state\fP, \fBdialog_vars\fP and \fBdlg_color_table\fP
global variables should be initialized to zeros, global variables should be initialized to zeros,
and then populated with the data to use. and then populated with the data to use.
A few of these must be nonzero for the corresponding widgets to function. A few of these must be nonzero for the corresponding widgets to function.
@ -133,7 +146,7 @@ prefer to write results to the standard output,
e.g., by using the "\fB--stdout\fP" option. e.g., by using the "\fB--stdout\fP" option.
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.output_count .IP \fIDIALOG_STATE.output_count
This is incremented by \fIdlg_does_output\fP, This is incremented by \fBdlg_does_output\fP,
which is called by each widget that writes text to the output. which is called by each widget that writes text to the output.
The \fB\*p\fP application uses that to decide if it should The \fB\*p\fP application uses that to decide if it should
also write a separator, i.e., also write a separator, i.e.,
@ -205,12 +218,15 @@ suppress shadows that would be drawn to the right and bottom of each dialog box.
This corresponds to the command-line option "\fB--visit-items\fP". This corresponds to the command-line option "\fB--visit-items\fP".
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.PP .PP
The \fB\*p\fP application resets the \fIdialog_vars\fP data before The \fB\*p\fP application resets the \fBdialog_vars\fP data before
accepting options to invoke each widget. accepting options to invoke each widget.
Most of the \fIDIALOG_VARS\fP members are set directly from \fB\*p\fP's Most of the \fIDIALOG_VARS\fP members are set directly from \fB\*p\fP's
command-line options: command-line options:
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.ascii_lines .IP \fIDIALOG_VARS.ascii_lines
This corresponds to the command-line option "\fB--ascii-lines\fP.
It causes line-drawing to be done with ASCII characters, e.g., "+" and "-".
See \fIDIALOG_VARS.no_lines\fP.
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.backtitle .IP \fIDIALOG_VARS.backtitle
This corresponds to the command-line option "\fB--backtitle\fP \fIbacktitle\fP". This corresponds to the command-line option "\fB--backtitle\fP \fIbacktitle\fP".
@ -344,10 +360,20 @@ and the item-help text will be written to \fB\*p\fP's output after the token "HE
Otherwise, the return status will indicate that the Help button was pressed, Otherwise, the return status will indicate that the Help button was pressed,
and no message printed. and no message printed.
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.help_file
This corresponds to the command-line option "\fB--hfile\fP \fIstring\fP".
The given filename is passed to \fBdialog_helpfile\fP when the user
presses F1.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.help_label .IP \fIDIALOG_VARS.help_label
This corresponds to the command-line option "\fB--help-label\fP \fIstring\fP". This corresponds to the command-line option "\fB--help-label\fP \fIstring\fP".
The given string overrides the label used for "Help" buttons. The given string overrides the label used for "Help" buttons.
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.help_line
This corresponds to the command-line option "\fB--hline\fP \fIstring\fP".
The given string is displayed in the bottom of dialog windows,
like a subtitle.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.help_status .IP \fIDIALOG_VARS.help_status
This corresponds to the command-line option "\fB--help-status\fP". This corresponds to the command-line option "\fB--help-status\fP".
If true, and the the help-button is selected, If true, and the the help-button is selected,
@ -391,6 +417,10 @@ This corresponds to the command-line option "\fB--insecure\fP".
If true, make the password widget friendlier but less secure, If true, make the password widget friendlier but less secure,
by echoing asterisks for each character. by echoing asterisks for each character.
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.in_helpfile
This variable is used to prevent \fBdialog_helpfile\fP from showing
anything, e.g., if F1 were pressed within a help-file display.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.item_help .IP \fIDIALOG_VARS.item_help
This corresponds to the command-line option "\fB--item-help\fP". This corresponds to the command-line option "\fB--item-help\fP".
If true, If true,
@ -423,6 +453,14 @@ This corresponds to the command-line option "\fB--no-label\fP \fIstring\fP".
The given string overrides the label used for "No" buttons. The given string overrides the label used for "No" buttons.
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.no_lines .IP \fIDIALOG_VARS.no_lines
This corresponds to the command-line option "\fB--no-lines\fP.
It suppresses line-drawing.
See \fIDIALOG_VARS.ascii_lines\fP.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.no_nl_expand
This corresponds to the command-line option "\fB--no-nl-expand\fP".
If false, \fBdlg_trim_string\fP converts literal "\\n" substrings
in a message into newlines.
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.nocancel .IP \fIDIALOG_VARS.nocancel
This corresponds to the command-line option "\fB--no-cancel\fP". This corresponds to the command-line option "\fB--no-cancel\fP".
@ -537,24 +575,31 @@ Other parameters depend on the box type.
.IP \fBdialog_calendar .IP \fBdialog_calendar
implements the "\fB--calendar\fP" option. implements the "\fB--calendar\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP subtitle .TP 5
.B const char * \fIsubtitle
is the prompt text shown within the widget. is the prompt text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the height excluding the fixed-height calendar grid. is the height excluding the fixed-height calendar grid.
.IP width .TP 5
.B int \fIwidth
is the overall width of the box, is the overall width of the box,
which is adjusted up to the calendar grid's minimum width if needed. which is adjusted up to the calendar grid's minimum width if needed.
.IP day .TP 5
.B int \fIday
is the initial day of the week shown, is the initial day of the week shown,
counting zero as Sunday. counting zero as Sunday.
If the value is negative, the current day of the week is used. If the value is negative, the current day of the week is used.
.IP month .TP 5
.B int \fImonth
is the initial month of the year shown, is the initial month of the year shown,
counting one as January. counting one as January.
If the value is negative, the current month of the year is used. If the value is negative, the current month of the year is used.
.IP year .TP 5
.B int \fIyear
is the initial year shown. is the initial year shown.
If the value is negative, the current year is used. If the value is negative, the current year is used.
.RE .RE
@ -563,22 +608,29 @@ If the value is negative, the current year is used.
implements the "\fB--checklist\fP" and "\fB--radiolist\fP" options implements the "\fB--checklist\fP" and "\fB--radiolist\fP" options
depending on the \fIflag\fP parameter. depending on the \fIflag\fP parameter.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is adjusted to use the available screen size. If zero, the height is adjusted to use the available screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is adjusted to use the available screen size. If zero, the height is adjusted to use the available screen size.
.IP list_height .TP 5
.B int \fIlist_height
is the minimum height to reserve for displaying the list. is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP. If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.IP item_no .TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP. is the number of rows in \fIitems\fP.
.IP items .TP 5
.B int \fIitems
is an array of strings which is viewed either as a list of rows is an array of strings which is viewed either as a list of rows
.RS .RS
\fItag item status \fR \fItag item status \fR
@ -589,7 +641,7 @@ or
\fItag item status help\fR \fItag item status help\fR
.RE .RE
.IP .IP
depending on whether \fIdialog_vars.item_help\fP is set. depending on whether \fBdialog_vars.item_help\fP is set.
.IP flag .IP flag
is either \fIFLAG_CHECK\fP, for checklists, is either \fIFLAG_CHECK\fP, for checklists,
or \fIFLAG_RADIO\fP for radiolists. or \fIFLAG_RADIO\fP for radiolists.
@ -598,15 +650,19 @@ or \fIFLAG_RADIO\fP for radiolists.
.IP \fBdialog_dselect .IP \fBdialog_dselect
implements the "\fB--dselect\fP" option. implements the "\fB--dselect\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP path .TP 5
.B const char * \fIpath
is the preselected value to show in the input-box, is the preselected value to show in the input-box,
which is used also to set the directory- and file-windows. which is used also to set the directory- and file-windows.
.IP height .TP 5
.B int \fIheight
is the height excluding the minimum needed to show the dialog box framework. is the height excluding the minimum needed to show the dialog box framework.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.RE .RE
@ -614,14 +670,18 @@ If zero, the height is based on the screen size.
.IP \fBdialog_editbox .IP \fBdialog_editbox
implements the "\fB--editbox\fP" option. implements the "\fB--editbox\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP file .TP 5
.B const char * \fIfile
is the name of the file from which to read. is the name of the file from which to read.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is adjusted to use the available screen size. If zero, the height is adjusted to use the available screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is adjusted to use the available screen size. If zero, the height is adjusted to use the available screen size.
.RE .RE
@ -629,22 +689,29 @@ If zero, the height is adjusted to use the available screen size.
.IP \fBdialog_form .IP \fBdialog_form
implements the "\fB--form\fP" option. implements the "\fB--form\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is adjusted to use the available screen size. If zero, the height is adjusted to use the available screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is adjusted to use the available screen size. If zero, the height is adjusted to use the available screen size.
.IP form_height .TP 5
.B int \fIform_height
is the minimum height to reserve for displaying the list. is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP. If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.IP item_no .TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP. is the number of rows in \fIitems\fP.
.IP items .TP 5
.B int \fIitems
is an array of strings which is viewed either as a list of rows is an array of strings which is viewed either as a list of rows
.RS .RS
\fIName NameY NameX Text TextY TextX FLen ILen\fR \fIName NameY NameX Text TextY TextX FLen ILen\fR
@ -655,39 +722,53 @@ or
\fIName NameY NameX Text TextY TextX FLen ILen Help\fR \fIName NameY NameX Text TextY TextX FLen ILen Help\fR
.RE .RE
.IP .IP
depending on whether \fIdialog_vars.item_help\fP is set. depending on whether \fBdialog_vars.item_help\fP is set.
.RE .RE
.\" ************************************************************************ .\" ************************************************************************
.IP \fBdialog_fselect .IP \fBdialog_fselect
implements the "\fB--fselect\fP" option. implements the "\fB--fselect\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP path .TP 5
.B const char * \fIpath
is the preselected value to show in the input-box, is the preselected value to show in the input-box,
which is used also to set the directory- and file-windows. which is used also to set the directory- and file-windows.
.IP height .TP 5
.B int \fIheight
is the height excluding the minimum needed to show the dialog box framework. is the height excluding the minimum needed to show the dialog box framework.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.RE .RE
.\" ************************************************************************ .\" ************************************************************************
.IP \fBdialog_gauge .IP \fBdialog_gauge
implements the "\fB--gauge\fP" option. implements the "\fB--gauge\fP" option.
Alternatively, a simpler or customized gauge widget can be
setup using
\fBdlg_allocate_gauge\fP,
\fBdlg_update_gauge\fP and
\fBdlg_free_gauge\fP.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP percent .TP 5
.B int \fIpercent
is the percentage to show in the progress bar. is the percentage to show in the progress bar.
.RE .RE
.\" ************************************************************************ .\" ************************************************************************
@ -695,43 +776,79 @@ is the percentage to show in the progress bar.
implements the "\fB--inputbox\fP" or implements the "\fB--inputbox\fP" or
"\fB--password\fP" option, depending on the value of \fIpassword\fP. "\fB--password\fP" option, depending on the value of \fIpassword\fP.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP init .TP 5
.B const char * \fIinit
is the initial value of the input box, whose length is taken into account is the initial value of the input box, whose length is taken into account
when auto-sizing the width of the dialog box. when auto-sizing the width of the dialog box.
.IP password .TP 5
.B int \fIpassword
if true, causes typed input to be echoed as asterisks. if true, causes typed input to be echoed as asterisks.
.RE .RE
.\" ************************************************************************ .\" ************************************************************************
.IP \fBdialog_helpfile
implements the "\fB--hfile\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIfile
is the name of a file containing the text to display.
This function is internally bound to F1 (function key "1"),
passing \fBdialog_vars.help_file\fP as a parameter.
The \fBdialog\fP program sets that variable when the \fB--hfile\fP option
is given.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.RE
.\" ************************************************************************
.IP \fBdialog_menu .IP \fBdialog_menu
implements the "\fB--menu\fP" or "\fB--inputmenu\fP" option implements the "\fB--menu\fP" or "\fB--inputmenu\fP" option
depending on whether \fIdialog_vars.input_menu\fP is set. depending on whether \fBdialog_vars.input_menu\fP is set.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP menu_height .TP 5
.B int \fImenu_height
is the minimum height to reserve for displaying the list. is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP. If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.IP item_no .TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP. is the number of rows in \fIitems\fP.
.IP items .TP 5
.B int \fIitems
is an array of strings which is viewed either as a list of rows is an array of strings which is viewed either as a list of rows
.RS .RS
\fItag item\fR \fItag item\fR
@ -742,28 +859,35 @@ or
\fItag item help\fR \fItag item help\fR
.RE .RE
.IP .IP
depending on whether \fIdialog_vars.item_help\fP is set. depending on whether \fBdialog_vars.item_help\fP is set.
.RE .RE
.\" ************************************************************************ .\" ************************************************************************
.IP \fBdialog_mixedform .IP \fBdialog_mixedform
implements the "\fB--mixedform\fP" option. implements the "\fB--mixedform\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is adjusted to use the available screen size. If zero, the height is adjusted to use the available screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is adjusted to use the available screen size. If zero, the height is adjusted to use the available screen size.
.IP form_height .TP 5
.B int \fIform_height
is the minimum height to reserve for displaying the list. is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP. If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.IP item_no .TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP. is the number of rows in \fIitems\fP.
.IP items .TP 5
.B int \fIitems
is an array of strings which is viewed either as a list of rows is an array of strings which is viewed either as a list of rows
.RS .RS
\fIName NameY NameX Text TextY TextX FLen ILen Ityp\fR \fIName NameY NameX Text TextY TextX FLen ILen Ityp\fR
@ -774,27 +898,33 @@ or
\fIName NameY NameX Text TextY TextX FLen ILen Ityp Help\fR \fIName NameY NameX Text TextY TextX FLen ILen Ityp Help\fR
.RE .RE
.IP .IP
depending on whether \fIdialog_vars.item_help\fP is set. depending on whether \fBdialog_vars.item_help\fP is set.
.RE .RE
.\" ************************************************************************ .\" ************************************************************************
.IP \fBdialog_mixedgauge .IP \fBdialog_mixedgauge
implements the "\fB--mixedgauge\fP" option implements the "\fB--mixedgauge\fP" option
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the caption text shown within the widget. is the caption text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP percent .IP percent
is the percentage to show in the progress bar. is the percentage to show in the progress bar.
.IP item_no .TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP. is the number of rows in \fIitems\fP.
.IP items .TP 5
.B int \fIitems
is an array of strings which is viewed as a list of \fItag\fP and \fIitem\fP values. is an array of strings which is viewed as a list of \fItag\fP and \fIitem\fP values.
The \fItag\fP values are listed, one per row, in the list at the top of The \fItag\fP values are listed, one per row, in the list at the top of
the widget. the widget.
@ -832,17 +962,22 @@ Other strings are displayed as is.
implements the "\fB--msgbox\fP" or "\fB--infobox\fP" option implements the "\fB--msgbox\fP" or "\fB--infobox\fP" option
depending on whether \fIpauseopt\fP is set. depending on whether \fIpauseopt\fP is set.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP pauseopt .TP 5
.B int \fIpauseopt
if true, an "OK" button will be shown, if true, an "OK" button will be shown,
and the dialog will wait for it to complete. and the dialog will wait for it to complete.
With an "OK" button, it is denoted a "msgbox", With an "OK" button, it is denoted a "msgbox",
@ -852,35 +987,45 @@ without an "OK" button, it is denoted an "infobox".
.IP \fBdialog_pause .IP \fBdialog_pause
implements the "\fB--pause\fP" option. implements the "\fB--pause\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP seconds .TP 5
.B int \fIseconds
is the timeout to use for the progress bar. is the timeout to use for the progress bar.
.RE .RE
.\" ************************************************************************ .\" ************************************************************************
.IP \fBdialog_prgbox .IP \fBdialog_prgbox
implements the "\fB--prgbox\fP" option. implements the "\fB--prgbox\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
If empty or null, no prompt is shown. If empty or null, no prompt is shown.
.IP command .TP 5
.B const char * \fIcommand
is the name of the command to execute. is the name of the command to execute.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP pauseopt .TP 5
.B int \fIpauseopt
if true, an "OK" button will be shown, if true, an "OK" button will be shown,
and the dialog will wait for it to complete. and the dialog will wait for it to complete.
.RE .RE
@ -888,15 +1033,19 @@ and the dialog will wait for it to complete.
.IP \fBdialog_progressbox .IP \fBdialog_progressbox
implements the "\fB--progressbox\fP" option. implements the "\fB--progressbox\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
If empty or null, no prompt is shown. If empty or null, no prompt is shown.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.RE .RE
@ -905,19 +1054,24 @@ If zero, the height is based on the screen size.
implements the "\fB--tailbox\fP" or "\fB--tailboxbg\fP" option implements the "\fB--tailbox\fP" or "\fB--tailboxbg\fP" option
depending on whether \fIbg_task\fP is set. depending on whether \fIbg_task\fP is set.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP file .TP 5
.B const char * \fIfile
is the name of the file to display in the dialog. is the name of the file to display in the dialog.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP bg_task .TP 5
.B int \fIbg_task
if true, if true,
the window is added to the callback list in \fIdialog_state\fP, the window is added to the callback list in \fBdialog_state\fP,
and the application will poll for the window to be updated. and the application will poll for the window to be updated.
Otherwise an "OK" button is added to the window, Otherwise an "OK" button is added to the window,
and it will be closed when the button is activated. and it will be closed when the button is activated.
@ -926,14 +1080,18 @@ and it will be closed when the button is activated.
.IP \fBdialog_textbox .IP \fBdialog_textbox
implements the "\fB--textbox\fP" option. implements the "\fB--textbox\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP file .TP 5
.B const char * \fIfile
is the name of the file to display in the dialog. is the name of the file to display in the dialog.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.RE .RE
@ -941,25 +1099,32 @@ If zero, the height is based on the screen size.
.IP \fBdialog_timebox .IP \fBdialog_timebox
implements the "\fB--timebox\fP" option. implements the "\fB--timebox\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP subtitle .TP 5
.B const char * \fIsubtitle
is the prompt text shown within the widget. is the prompt text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP hour .TP 5
.B int \fIhour
is the initial hour shown. is the initial hour shown.
If the value is negative, the current hour is used. If the value is negative, the current hour is used.
Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 24. Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 24.
.IP minute .TP 5
.B int \fIminute
is the initial minute shown. is the initial minute shown.
If the value is negative, the current minute is used. If the value is negative, the current minute is used.
Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60. Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60.
.IP second .TP 5
.B int \fIsecond
is the initial second shown. is the initial second shown.
If the value is negative, the current second is used. If the value is negative, the current second is used.
Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60. Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60.
@ -968,14 +1133,18 @@ Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60.
.IP \fBdialog_yesno .IP \fBdialog_yesno
implements the "\fB--yesno\fP" option. implements the "\fB--yesno\fP" option.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.RE .RE
@ -989,7 +1158,7 @@ Bowing to longstanding usage, the functions that initialize the
display and end it are named \fIinit_dialog\fP and \fIend_dialog\fP. display and end it are named \fIinit_dialog\fP and \fIend_dialog\fP.
.PP .PP
The only non-widget function whose name begins with "\fIdialog_\fP" The only non-widget function whose name begins with "\fIdialog_\fP"
is \fIdialog_version\fP, which returns the version number of the is \fBdialog_version\fP, which returns the version number of the
library as a string. library as a string.
. .
.PP .PP
@ -1079,6 +1248,30 @@ This is the number of rows in the array.
.RE .RE
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.TP 5 .TP 5
.B dlg_allocate_gauge
Allocates a gauge widget.
Use \fBdlg_update_gauge\fP to display the result.
.RS
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIpercent
is the percentage to show in the progress bar.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_asciibox .B dlg_asciibox
returns its parameter transformed to the returns its parameter transformed to the
corresponding "+" or "-", etc. for the line-drawing characters used in \fB\*p\fP. corresponding "+" or "-", etc. for the line-drawing characters used in \fB\*p\fP.
@ -1325,7 +1518,7 @@ is the number of \fIitems\fP in the list.
.TP 5 .TP 5
.B dlg_calc_listw .B dlg_calc_listw
This function is obsolete, provided for library-compatibility. This function is obsolete, provided for library-compatibility.
It is replaced by \fIdlg_calc_list_width\fP. It is replaced by \fBdlg_calc_list_width\fP.
.RS .RS
.TP 5 .TP 5
.B int \fIitem_no .B int \fIitem_no
@ -1541,7 +1734,7 @@ It is terminated by an entry with a null \fIname\fP field.
.TP 5 .TP 5
.B dlg_default_item .B dlg_default_item
This function is obsolete, provided for library-compatibility. This function is obsolete, provided for library-compatibility.
It is replaced by \fIdlg_default_formitem\fP and \fIdlg_default_listitem\fP. It is replaced by \fBdlg_default_formitem\fP and \fBdlg_default_listitem\fP.
.RS .RS
.TP 5 .TP 5
.B char ** \fIitems .B char ** \fIitems
@ -1701,6 +1894,18 @@ is the number of columns (or rows if \fIvertical\fP) allowed for the display.
.RE .RE
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.TP 5 .TP 5
.B dlg_draw_helpline
draw the text in \fBdialog_vars.help_line\fP at the bottom of the given window.
.RS
.TP 5
.B WINDOW * \fIdialog
is the window to modify.
.TP 5
.B bool \fIdecorations
if true, allow room for the scrolling arrows.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_scrollbar .B dlg_draw_scrollbar
If \fBdialog_state.use_scrollbar\fP is set, If \fBdialog_state.use_scrollbar\fP is set,
draw a scrollbar on the right margin of windows holding scrollable data. draw a scrollbar on the right margin of windows holding scrollable data.
@ -1898,7 +2103,8 @@ Quit program killing all \fBtailboxbg\fP widgets.
.B const char * \fIfmt .B const char * \fIfmt
is the format of the \fBprintf\fP-like message to write. is the format of the \fBprintf\fP-like message to write.
.TP 5 .TP 5
. .B ...
.br
are the variables to apply to the \fIfmt\fP format. are the variables to apply to the \fIfmt\fP format.
.RE .RE
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
@ -2014,6 +2220,15 @@ is the list to free.
.RE .RE
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.TP 5 .TP 5
.B dlg_free_gauge
Remove the gauge widget from the screen and free its associated memory.
.RS
.TP 5
.B void *\fIobjptr
points to the gauge widget.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_getc .B dlg_getc
Read a character from the given window. Read a character from the given window.
Handle repainting here (to simplify Handle repainting here (to simplify
@ -2615,23 +2830,29 @@ applied to the string.
.B dlg_progressbox .B dlg_progressbox
implements the "\fB--prgbox\fP" and "\fB--progressbox\fP" options. implements the "\fB--prgbox\fP" and "\fB--progressbox\fP" options.
.RS .RS
.IP title .TP 5
.B const char * \fItitle
is the title on the top of the widget. is the title on the top of the widget.
.IP cprompt .TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget. is the prompt text shown within the widget.
If empty or null, no prompt is shown. If empty or null, no prompt is shown.
.IP height .TP 5
.B int \fIheight
is the desired height of the box. is the desired height of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP width .TP 5
.B int \fIwidth
is the desired width of the box. is the desired width of the box.
If zero, the height is based on the screen size. If zero, the height is based on the screen size.
.IP pauseopt .TP 5
.B int \fIpauseopt
if true, an "OK" button will be shown, if true, an "OK" button will be shown,
and the dialog will wait for it to complete. and the dialog will wait for it to complete.
With an "OK" button, it is denoted a "programbox", With an "OK" button, it is denoted a "programbox",
without an "OK" button, it is denoted a "progressbox". without an "OK" button, it is denoted a "progressbox".
.IP fp .TP 5
.B FILE * \fIfp
is the file pointer, which may be a pipe or a regular file. is the file pointer, which may be a pipe or a regular file.
.RE .RE
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
@ -2865,16 +3086,66 @@ Some of these may be values declared in the DLG_KEYS_ENUM.
.RE .RE
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.TP 5 .TP 5
.B dlg_trace_msg
Write a formatted message to the trace file.
.RS
.TP 5
.B const char * \fIfmt
is the format of the \fBprintf\fP-like message to write.
.TP 5
.B ...
.br
are the variables to apply to the \fIfmt\fP format.
.RE
.IP
Use the DLG_TRACE macro for portability, in case the trace
feature is not compiled into the library.
It uses an extra level of parentheses to work with a variable number of
parameters, e.g.,
.ES
.EX
DLG_TRACE(("this is dialog version %s\\n", dialog_version()));
.EE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_trace_win .B dlg_trace_win
If \fBdialog_state.trace\fP is set, If \fBdialog_state.trace\fP is set,
log a printable picture of the given window. log a printable picture of the given window.
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.TP 5 .TP 5
.B dlg_trim_string .B dlg_trim_string
Change embedded "\\n" substrings to '\\n' characters and tabs to single spaces. The \fBdialog\fP program uses this in each widget to adjust the
If there are no "\\n"s, the function strips all extra spaces, for justification. message string,
If it has "\\n"'s, the function preserves extra spaces. which may contain the newline character (referred to as '\\n')
If \fBdialog_vars.cr_wrap\fP is set, the function preserves '\\n's. and/or the special substring "\\n"
(which can be translated into a newline character).
.IP
There are several optional features:
.RS
.bP
Unless \fBdialog_vars.no_nl_expand\fP is set,
.RS
.bP
If it has "\\n" substrings,
the function preserves extra spaces.
For instance, spaces following a newline (substring or character)
are preserved to use as an indentation.
.bP
The function changes embedded "\\n" substrings to '\\n' characters.
.RE
.bP
If \fBdialog_vars.no_nl_expand\fP is not set,
or if there are no "\\n" substrings,
this function strips all extra spaces to simplify justification.
.bP
If \fBdialog_vars.cr_wrap\fP is set,
the function preserves '\\n' newline characters.
Otherwise, each '\\n' newline character is converted to a space.
.bP
Unless \fBdialog_vars.nocollapse\fP is set,
each tab character is converted to a space,
and sequences of blanks (space or tab) are reduced to a single space.
.RE
.RS .RS
.TP 5 .TP 5
.B char * \fIsrc .B char * \fIsrc
@ -2891,6 +3162,18 @@ is the window from which to remove bindings
.RE .RE
.\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
.TP 5 .TP 5
.B dlg_update_gauge
Update a gauge widget to show a different percentage value.
.RS
.TP 5
.B void *\fIobjptr
points to the gauge object to update.
.TP 5
.B int \fIpercent
is the new percentage value to display.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_yes_buttoncode .B dlg_yes_buttoncode
Map the given button index for \fBdlg_yes_labels\fP into \fB\*p\fP's exit-code. Map the given button index for \fBdlg_yes_labels\fP into \fB\*p\fP's exit-code.
.RS .RS

View File

@ -1,5 +1,5 @@
/* /*
* $Id: dialog.c,v 1.186 2011/03/02 09:58:29 tom Exp $ * $Id: dialog.c,v 1.193 2011/06/29 09:10:56 tom Exp $
* *
* cdialog - Display simple dialog boxes from shell scripts * cdialog - Display simple dialog boxes from shell scripts
* *
@ -71,7 +71,9 @@ typedef enum {
,o_gauge ,o_gauge
,o_help ,o_help
,o_help_button ,o_help_button
,o_help_file
,o_help_label ,o_help_label
,o_help_line
,o_help_status ,o_help_status
,o_icon ,o_icon
,o_ignore ,o_ignore
@ -96,6 +98,7 @@ typedef enum {
,o_no_label ,o_no_label
,o_no_lines ,o_no_lines
,o_no_mouse ,o_no_mouse
,o_no_nl_expand
,o_no_shadow ,o_no_shadow
,o_nocancel ,o_nocancel
,o_noitem ,o_noitem
@ -137,6 +140,7 @@ typedef enum {
,o_title ,o_title
,o_trim ,o_trim
,o_under_mouse ,o_under_mouse
,o_version
,o_visit_items ,o_visit_items
,o_wmclass ,o_wmclass
,o_yes_label ,o_yes_label
@ -215,6 +219,8 @@ static const Options options[] = {
{ "help-button", o_help_button, 1, "" }, { "help-button", o_help_button, 1, "" },
{ "help-label", o_help_label, 1, "<str>" }, { "help-label", o_help_label, 1, "<str>" },
{ "help-status", o_help_status, 1, "" }, { "help-status", o_help_status, 1, "" },
{ "hfile", o_help_file, 1, "<str>" },
{ "hline", o_help_line, 1, "<str>" },
{ "icon", o_icon, 1, NULL }, { "icon", o_icon, 1, NULL },
{ "ignore", o_ignore, 1, "" }, { "ignore", o_ignore, 1, "" },
{ "infobox", o_infobox, 2, "<text> <height> <width>" }, { "infobox", o_infobox, 2, "<text> <height> <width>" },
@ -239,6 +245,7 @@ static const Options options[] = {
{ "no-label", o_no_label, 1, "<str>" }, { "no-label", o_no_label, 1, "<str>" },
{ "no-lines", o_no_lines, 1, "" }, { "no-lines", o_no_lines, 1, "" },
{ "no-mouse", o_no_mouse, 1, "" }, { "no-mouse", o_no_mouse, 1, "" },
{ "no-nl-expand", o_no_nl_expand, 1, "" },
{ "no-ok", o_nook, 1, "" }, { "no-ok", o_nook, 1, "" },
{ "no-shadow", o_no_shadow, 1, "" }, { "no-shadow", o_no_shadow, 1, "" },
{ "nocancel", o_nocancel, 1, NULL }, /* see --no-cancel */ { "nocancel", o_nocancel, 1, NULL }, /* see --no-cancel */
@ -281,7 +288,7 @@ static const Options options[] = {
{ "title", o_title, 1, "<title>" }, { "title", o_title, 1, "<title>" },
{ "trim", o_trim, 1, "" }, { "trim", o_trim, 1, "" },
{ "under-mouse", o_under_mouse, 1, NULL }, { "under-mouse", o_under_mouse, 1, NULL },
{ "version", o_print_version, 5, "" }, { "version", o_version, 5, "" },
{ "visit-items", o_visit_items, 1, "" }, { "visit-items", o_visit_items, 1, "" },
{ "wmclass", o_wmclass, 1, NULL }, { "wmclass", o_wmclass, 1, NULL },
{ "yes-label", o_yes_label, 1, "<str>" }, { "yes-label", o_yes_label, 1, "<str>" },
@ -872,6 +879,7 @@ call_mixed_gauge(CALLARGS)
} }
#endif #endif
#ifdef HAVE_DLG_GAUGE
static int static int
call_prgbox(CALLARGS) call_prgbox(CALLARGS)
{ {
@ -891,6 +899,7 @@ call_prgbox(CALLARGS)
numeric_arg(av, 2), numeric_arg(av, 2),
numeric_arg(av, 3), TRUE)); numeric_arg(av, 3), TRUE));
} }
#endif
#ifdef HAVE_DLG_GAUGE #ifdef HAVE_DLG_GAUGE
static int static int
@ -1088,6 +1097,15 @@ compare_opts(const void *a, const void *b)
return strcmp((*p)->name, (*q)->name); return strcmp((*p)->name, (*q)->name);
} }
/*
* Print program's version.
*/
static void
PrintVersion(FILE *fp)
{
fprintf(fp, "Version: %s\n", dialog_version());
}
/* /*
* Print program help-message * Print program help-message
*/ */
@ -1122,6 +1140,9 @@ Help(void)
size_t j, k; size_t j, k;
const Options **opts; const Options **opts;
end_dialog();
dialog_state.output = stdout;
opts = dlg_calloc(const Options *, limit); opts = dlg_calloc(const Options *, limit);
assert_ptr(opts, "Help"); assert_ptr(opts, "Help");
for (j = 0; j < limit; ++j) { for (j = 0; j < limit; ++j) {
@ -1191,6 +1212,9 @@ process_common_options(int argc, char **argv, int offset, bool output)
case o_cr_wrap: case o_cr_wrap:
dialog_vars.cr_wrap = TRUE; dialog_vars.cr_wrap = TRUE;
break; break;
case o_no_nl_expand:
dialog_vars.no_nl_expand = TRUE;
break;
case o_no_collapse: case o_no_collapse:
dialog_vars.nocollapse = TRUE; dialog_vars.nocollapse = TRUE;
break; break;
@ -1236,6 +1260,12 @@ process_common_options(int argc, char **argv, int offset, bool output)
case o_item_help: case o_item_help:
dialog_vars.item_help = TRUE; dialog_vars.item_help = TRUE;
break; break;
case o_help_line:
dialog_vars.help_line = optionString(argv, &offset);
break;
case o_help_file:
dialog_vars.help_file = optionString(argv, &offset);
break;
case o_help_button: case o_help_button:
dialog_vars.help_button = TRUE; dialog_vars.help_button = TRUE;
break; break;
@ -1274,7 +1304,7 @@ process_common_options(int argc, char **argv, int offset, bool output)
break; break;
case o_print_version: case o_print_version:
if (output) { if (output) {
fprintf(stdout, "Version: %s\n", dialog_version()); PrintVersion(dialog_state.output);
} }
break; break;
case o_separator: case o_separator:
@ -1356,6 +1386,7 @@ process_common_options(int argc, char **argv, int offset, bool output)
break; break;
case o_no_mouse: case o_no_mouse:
dialog_state.no_mouse = TRUE; dialog_state.no_mouse = TRUE;
mouse_close();
break; break;
case o_noitem: case o_noitem:
case o_fullbutton: case o_fullbutton:
@ -1474,6 +1505,9 @@ main(int argc, char *argv[])
* that. We can only write to one of them. If --stdout is used, that * that. We can only write to one of them. If --stdout is used, that
* can interfere with initializing the curses library, so we want to * can interfere with initializing the curses library, so we want to
* know explicitly if it is used. * know explicitly if it is used.
*
* Also, look for any --version or --help message, processing those
* immediately.
*/ */
while (offset < argc) { while (offset < argc) {
int base = offset; int base = offset;
@ -1497,6 +1531,14 @@ main(int argc, char *argv[])
case o_keep_tite: case o_keep_tite:
keep_tite = TRUE; keep_tite = TRUE;
break; break;
case o_version:
dialog_state.output = stdout;
PrintVersion(dialog_state.output);
exit(DLG_EXIT_OK);
break;
case o_help:
Help();
break;
default: default:
++offset; ++offset;
continue; continue;
@ -1512,7 +1554,11 @@ main(int argc, char *argv[])
offset = 1; offset = 1;
init_result(my_buffer); init_result(my_buffer);
if (argc == 2) { /* if we don't want clear screen */ /*
* Dialog's output may be redirected (see above). Handle the special
* case of options that only report information without interaction.
*/
if (argc == 2) {
switch (lookupOption(argv[1], 7)) { switch (lookupOption(argv[1], 7)) {
case o_print_maxsize: case o_print_maxsize:
(void) initscr(); (void) initscr();
@ -1521,7 +1567,7 @@ main(int argc, char *argv[])
fprintf(dialog_state.output, "MaxSize: %d, %d\n", SLINES, SCOLS); fprintf(dialog_state.output, "MaxSize: %d, %d\n", SLINES, SCOLS);
break; break;
case o_print_version: case o_print_version:
fprintf(stdout, "Version: %s\n", dialog_version()); PrintVersion(dialog_state.output);
break; break;
case o_clear: case o_clear:
initscr(); initscr();
@ -1531,8 +1577,6 @@ main(int argc, char *argv[])
case o_ignore: case o_ignore:
break; break;
default: default:
case o_help:
dialog_state.output = stdout;
Help(); Help();
break; break;
} }
@ -1621,6 +1665,8 @@ main(int argc, char *argv[])
case o_unknown: case o_unknown:
case o_title: case o_title:
case o_backtitle: case o_backtitle:
case o_help_line:
case o_help_file:
break; break;
default: default:
if (argv[j] != 0) { if (argv[j] != 0) {

View File

@ -1,5 +1,5 @@
/* /*
* $Id: dialog.h,v 1.223 2011/03/02 10:04:09 tom Exp $ * $Id: dialog.h,v 1.231 2011/06/29 09:51:00 tom Exp $
* *
* dialog.h -- common declarations for all dialog modules * dialog.h -- common declarations for all dialog modules
* *
@ -44,7 +44,10 @@
#include <signal.h> /* fork() etc. */ #include <signal.h> /* fork() etc. */
#include <math.h> /* sqrt() */ #include <math.h> /* sqrt() */
#undef ERR /* header conflict with Solaris xpg4 */ /* header conflict with Solaris xpg4 versus <sys/regset.h> */
#if defined(ERR) && (ERR == 13)
#undef ERR
#endif
#if defined(HAVE_NCURSESW_NCURSES_H) #if defined(HAVE_NCURSESW_NCURSES_H)
#include <ncursesw/ncurses.h> #include <ncursesw/ncurses.h>
@ -140,6 +143,7 @@
#define DLG_CTRL(n) ((n) & 0x1f) /* CTRL is preferred, but conflicts */ #define DLG_CTRL(n) ((n) & 0x1f) /* CTRL is preferred, but conflicts */
#define CHR_HELP DLG_CTRL('E')
#define CHR_BACKSPACE DLG_CTRL('H') #define CHR_BACKSPACE DLG_CTRL('H')
#define CHR_REPAINT DLG_CTRL('L') #define CHR_REPAINT DLG_CTRL('L')
#define CHR_KILL DLG_CTRL('U') #define CHR_KILL DLG_CTRL('U')
@ -476,6 +480,11 @@ typedef struct {
/* 1.1-20100118 */ /* 1.1-20100118 */
char *date_format; /* option "--date-format" */ char *date_format; /* option "--date-format" */
char *time_format; /* option "--time-format" */ char *time_format; /* option "--time-format" */
/* 1.1-20110629 */
char *help_line; /* option "--hline" */
char *help_file; /* option "--hfile" */
bool in_helpfile; /* flag to prevent recursion in --hfile */
bool no_nl_expand; /* option "--no-nl-expand" */
} DIALOG_VARS; } DIALOG_VARS;
#define USE_ITEM_HELP(s) (dialog_vars.item_help && (s) != 0) #define USE_ITEM_HELP(s) (dialog_vars.item_help && (s) != 0)
@ -530,6 +539,7 @@ extern int dialog_editbox(const char * /*title*/, const char * /*file*/, int /*h
extern int dialog_form(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*form_height*/, int /*item_no*/, char ** /*items*/); extern int dialog_form(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*form_height*/, int /*item_no*/, char ** /*items*/);
extern int dialog_fselect(const char * /*title*/, const char * /*path*/, int /*height*/, int /*width*/); extern int dialog_fselect(const char * /*title*/, const char * /*path*/, int /*height*/, int /*width*/);
extern int dialog_gauge(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*percent*/); extern int dialog_gauge(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*percent*/);
extern int dialog_helpfile(const char * /*title*/, const char * /*file*/, int /*height*/, int /*width*/);
extern int dialog_inputbox(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, const char * /*init*/, const int /*password*/); extern int dialog_inputbox(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, const char * /*init*/, const int /*password*/);
extern int dialog_menu(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*menu_height*/, int /*item_no*/, char ** /*items*/); extern int dialog_menu(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*menu_height*/, int /*item_no*/, char ** /*items*/);
extern int dialog_mixedform(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*form_height*/, int /*item_no*/, char ** /*items*/); extern int dialog_mixedform(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*form_height*/, int /*item_no*/, char ** /*items*/);
@ -584,6 +594,7 @@ extern int dlg_eat_argv(int * /* argcp */, char *** /* argvp */, int /* start */
/* arrows.c */ /* arrows.c */
extern void dlg_draw_arrows(WINDOW * /*dialog*/, int /*top_arrow*/, int /*bottom_arrow*/, int /*x*/, int /*top*/, int /*bottom*/); extern void dlg_draw_arrows(WINDOW * /*dialog*/, int /*top_arrow*/, int /*bottom_arrow*/, int /*x*/, int /*top*/, int /*bottom*/);
extern void dlg_draw_arrows2(WINDOW * /*dialog*/, int /*top_arrow*/, int /*bottom_arrow*/, int /*x*/, int /*top*/, int /*bottom*/, chtype /*attr*/, chtype /*borderattr*/); extern void dlg_draw_arrows2(WINDOW * /*dialog*/, int /*top_arrow*/, int /*bottom_arrow*/, int /*x*/, int /*top*/, int /*bottom*/, chtype /*attr*/, chtype /*borderattr*/);
extern void dlg_draw_helpline(WINDOW * /*dialog*/, bool /*decorations*/);
extern void dlg_draw_scrollbar(WINDOW * /*dialog*/, long /* first_data */, long /* this_data */, long /* next_data */, long /* total_data */, int /* left */, int /* right */, int /*top*/, int /*bottom*/, chtype /*attr*/, chtype /*borderattr*/); extern void dlg_draw_scrollbar(WINDOW * /*dialog*/, long /* first_data */, long /* this_data */, long /* next_data */, long /* total_data */, int /* left */, int /* right */, int /*top*/, int /*bottom*/, chtype /*attr*/, chtype /*borderattr*/);
/* buttons.c */ /* buttons.c */
@ -619,6 +630,11 @@ extern int dlg_default_formitem(DIALOG_FORMITEM * /*items*/);
extern int dlg_ordinate(const char * /*s*/); extern int dlg_ordinate(const char * /*s*/);
extern void dlg_free_formitems(DIALOG_FORMITEM * /*items*/); extern void dlg_free_formitems(DIALOG_FORMITEM * /*items*/);
/* guage.c */
extern void * dlg_allocate_gauge(const char * /* title */, const char * /* cprompt */, int /* height */, int /* width */, int /* percent */);
extern void dlg_free_gauge(void * /* objptr */);
extern void dlg_update_gauge(void * /* objptr */, int /* percent */);
/* inputstr.c */ /* inputstr.c */
extern bool dlg_edit_string(char * /*string*/, int * /*offset*/, int /*key*/, int /*fkey*/, bool /*force*/); extern bool dlg_edit_string(char * /*string*/, int * /*offset*/, int /*key*/, int /*fkey*/, bool /*force*/);
extern const int * dlg_index_columns(const char * /*string*/); extern const int * dlg_index_columns(const char * /*string*/);
@ -739,6 +755,12 @@ extern void dlg_trace(const char * /*fname*/);
extern void dlg_move_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/); extern void dlg_move_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
#endif #endif
/*
* Normally "enter" means "ok". Use this macro to handle the explicit
* check for DLGK_ENTER:
*/
#define dlg_enter_buttoncode(code) (dialog_vars.nook ? DLG_EXIT_OK : dlg_ok_buttoncode(code))
/* /*
* The following stuff is needed for mouse support * The following stuff is needed for mouse support
*/ */

View File

@ -1,9 +1,9 @@
/* /*
* $Id: dlg_keys.h,v 1.24 2010/01/19 00:57:36 tom Exp $ * $Id: dlg_keys.h,v 1.26 2011/06/21 22:09:22 tom Exp $
* *
* dlg_keys.h -- runtime binding support for dialog * dlg_keys.h -- runtime binding support for dialog
* *
* Copyright 2005-2007,2010 Thomas E. Dickey * Copyright 2005-2010,2011 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -89,12 +89,18 @@ typedef enum {
DLGK_BEGIN, DLGK_BEGIN,
DLGK_FINAL, DLGK_FINAL,
DLGK_SELECT, DLGK_SELECT,
DLGK_HELPFILE,
DLGK_TRACE DLGK_TRACE
} DLG_KEYS_ENUM; } DLG_KEYS_ENUM;
#define is_DLGK_MOUSE(code) ((code) >= M_EVENT) #define is_DLGK_MOUSE(code) ((code) >= M_EVENT)
#define DLGK_MOUSE(code) ((code) + M_EVENT) #define DLGK_MOUSE(code) ((code) + M_EVENT)
#define HELPKEY_BINDINGS \
DLG_KEYS_DATA( DLGK_HELPFILE, CHR_HELP ), \
DLG_KEYS_DATA( DLGK_HELPFILE, KEY_F(1) ), \
DLG_KEYS_DATA( DLGK_HELPFILE, KEY_HELP )
#define ENTERKEY_BINDINGS \ #define ENTERKEY_BINDINGS \
DLG_KEYS_DATA( DLGK_ENTER, '\n' ), \ DLG_KEYS_DATA( DLGK_ENTER, '\n' ), \
DLG_KEYS_DATA( DLGK_ENTER, '\r' ), \ DLG_KEYS_DATA( DLGK_ENTER, '\r' ), \

View File

@ -1,9 +1,9 @@
/* /*
* $Id: editbox.c,v 1.54 2010/04/28 21:02:01 tom Exp $ * $Id: editbox.c,v 1.55 2011/06/21 00:10:46 tom Exp $
* *
* editbox.c -- implements the edit box * editbox.c -- implements the edit box
* *
* Copyright 2007-2009,2010 Thomas E. Dickey * Copyright 2007-2010,2011 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -312,12 +312,14 @@ dlg_editbox(const char *title,
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
NAVIGATE_BINDINGS, NAVIGATE_BINDINGS,
END_KEYS_BINDING END_KEYS_BINDING
}; };
static DLG_KEYS_BINDING binding2[] = { static DLG_KEYS_BINDING binding2[] = {
INPUTSTR_BINDINGS, INPUTSTR_BINDINGS,
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
NAVIGATE_BINDINGS, NAVIGATE_BINDINGS,
END_KEYS_BINDING END_KEYS_BINDING

View File

@ -1,9 +1,9 @@
/* /*
* $Id: formbox.c,v 1.71 2010/02/24 10:45:57 Samuel.Martin.Moro Exp $ * $Id: formbox.c,v 1.73 2011/06/29 09:48:08 tom Exp $
* *
* formbox.c -- implements the form (i.e, some pairs label/editbox) * formbox.c -- implements the form (i.e, some pairs label/editbox)
* *
* Copyright 2003-2009,2010 Thomas E. Dickey * Copyright 2003-2010,2011 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -433,12 +433,14 @@ dlg_form(const char *title,
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
NAVIGATE_BINDINGS, NAVIGATE_BINDINGS,
END_KEYS_BINDING END_KEYS_BINDING
}; };
static DLG_KEYS_BINDING binding2[] = { static DLG_KEYS_BINDING binding2[] = {
INPUTSTR_BINDINGS, INPUTSTR_BINDINGS,
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
NAVIGATE_BINDINGS, NAVIGATE_BINDINGS,
END_KEYS_BINDING END_KEYS_BINDING
@ -633,7 +635,7 @@ dlg_form(const char *title,
case DLGK_ENTER: case DLGK_ENTER:
dlg_del_window(dialog); dlg_del_window(dialog);
result = (state >= 0) ? dlg_ok_buttoncode(state) : DLG_EXIT_OK; result = (state >= 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
continue; continue;
case DLGK_GRID_LEFT: case DLGK_GRID_LEFT:

View File

@ -1,5 +1,5 @@
/* /*
* $Id: fselect.c,v 1.76 2011/01/16 22:20:16 tom Exp $ * $Id: fselect.c,v 1.78 2011/06/29 09:48:21 tom Exp $
* *
* fselect.c -- implements the file-selector box * fselect.c -- implements the file-selector box
* *
@ -532,12 +532,14 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
NAVIGATE_BINDINGS, NAVIGATE_BINDINGS,
END_KEYS_BINDING END_KEYS_BINDING
}; };
static DLG_KEYS_BINDING binding2[] = { static DLG_KEYS_BINDING binding2[] = {
INPUTSTR_BINDINGS, INPUTSTR_BINDINGS,
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
NAVIGATE_BINDINGS, NAVIGATE_BINDINGS,
END_KEYS_BINDING END_KEYS_BINDING
@ -795,7 +797,7 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
} }
/* FALLTHRU */ /* FALLTHRU */
case DLGK_ENTER: case DLGK_ENTER:
result = (state > 0) ? dlg_ok_buttoncode(state) : DLG_EXIT_OK; result = (state > 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
continue; continue;
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
case KEY_RESIZE: case KEY_RESIZE:

220
guage.c
View File

@ -1,5 +1,5 @@
/* /*
* $Id: guage.c,v 1.52 2011/01/17 10:39:28 tom Exp $ * $Id: guage.c,v 1.60 2011/06/27 00:52:28 tom Exp $
* *
* guage.c -- implements the gauge dialog * guage.c -- implements the gauge dialog
* *
@ -35,8 +35,9 @@
#define isMarker(buf) !strncmp(buf, "XXX", (size_t) 3) #define isMarker(buf) !strncmp(buf, "XXX", (size_t) 3)
typedef struct { typedef struct _my_obj {
DIALOG_CALLBACK obj; DIALOG_CALLBACK obj; /* has to be first in struct */
struct _my_obj *next;
WINDOW *text; WINDOW *text;
const char *title; const char *title;
char *prompt; char *prompt;
@ -47,6 +48,43 @@ typedef struct {
char line[MAX_LEN + 1]; char line[MAX_LEN + 1];
} MY_OBJ; } MY_OBJ;
static MY_OBJ *all_objects;
static int
valid(MY_OBJ * obj)
{
MY_OBJ *list = all_objects;
int result = 0;
while (list != 0) {
if (list == obj) {
result = 1;
break;
}
list = list->next;
}
return result;
}
static void
delink(MY_OBJ * obj)
{
MY_OBJ *p = all_objects;
MY_OBJ *q = 0;
while (p != 0) {
if (p == obj) {
if (q != 0) {
q->next = p->next;
} else {
all_objects = p->next;
}
break;
}
q = p;
p = p->next;
}
}
static int static int
read_data(char *buffer, FILE *fp) read_data(char *buffer, FILE *fp)
{ {
@ -55,6 +93,7 @@ read_data(char *buffer, FILE *fp)
if (feof(fp)) { if (feof(fp)) {
result = 0; result = 0;
} else if (fgets(buffer, MY_LEN, fp) != 0) { } else if (fgets(buffer, MY_LEN, fp) != 0) {
DLG_TRACE(("read_data:%s", buffer));
dlg_trim_string(buffer); dlg_trim_string(buffer);
result = 1; result = 1;
} else { } else {
@ -88,6 +127,7 @@ repaint_text(MY_OBJ * obj)
dlg_draw_title(dialog, obj->title); dlg_draw_title(dialog, obj->title);
wattrset(dialog, dialog_attr); wattrset(dialog, dialog_attr);
dlg_draw_helpline(dialog, FALSE);
dlg_print_autowrap(dialog, obj->prompt, obj->height, obj->width); dlg_print_autowrap(dialog, obj->prompt, obj->height, obj->width);
dlg_draw_box(dialog, dlg_draw_box(dialog,
@ -179,6 +219,7 @@ handle_input(DIALOG_CALLBACK * cb)
} else { } else {
if (feof(dialog_state.pipe_input) || if (feof(dialog_state.pipe_input) ||
(ferror(dialog_state.pipe_input) && errno != EINTR)) { (ferror(dialog_state.pipe_input) && errno != EINTR)) {
delink(obj);
dlg_remove_callback(cb); dlg_remove_callback(cb);
} }
} }
@ -202,7 +243,8 @@ handle_my_getc(DIALOG_CALLBACK * cb, int ch, int fkey, int *result)
if (cb != 0) { if (cb != 0) {
if (!fkey && (ch == ERR)) { if (!fkey && (ch == ERR)) {
(void) handle_input(cb); (void) handle_input(cb);
status = (cb->input != 0); /* cb might be freed in handle_input */
status = (valid((MY_OBJ *) cb) && (cb->input != 0));
} }
} else { } else {
status = FALSE; status = FALSE;
@ -215,9 +257,85 @@ my_cleanup(DIALOG_CALLBACK * cb)
{ {
MY_OBJ *obj = (MY_OBJ *) cb; MY_OBJ *obj = (MY_OBJ *) cb;
if (obj != 0) { if (valid(obj)) {
if (obj->prompt != obj->prompt_buf) if (obj->prompt != obj->prompt_buf) {
free(obj->prompt); free(obj->prompt);
obj->prompt = obj->prompt_buf;
}
delink(obj);
}
}
void
dlg_update_gauge(void *objptr, int percent)
{
MY_OBJ *obj = (MY_OBJ *) objptr;
curs_set(0);
obj->percent = percent;
repaint_text(obj);
}
/*
* Allocates a new object and fills it as per the arguments
*/
void *
dlg_allocate_gauge(const char *title,
const char *cprompt,
int height,
int width,
int percent)
{
int x, y;
char *prompt = dlg_strclone(cprompt);
WINDOW *dialog;
MY_OBJ *obj = 0;
dlg_tab_correct_str(prompt);
dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MIN_WIDE);
dlg_print_size(height, width);
dlg_ctl_size(height, width);
/* center dialog box on screen */
x = dlg_box_x_ordinate(width);
y = dlg_box_y_ordinate(height);
dialog = dlg_new_window(height, width, y, x);
obj = dlg_calloc(MY_OBJ, 1);
assert_ptr(obj, "dialog_gauge");
obj->obj.input = dialog_state.pipe_input;
obj->obj.win = dialog;
obj->obj.keep_win = TRUE;
obj->obj.bg_task = TRUE;
obj->obj.handle_getc = handle_my_getc;
obj->obj.handle_input = handle_input;
obj->title = title;
obj->prompt = prompt;
obj->percent = percent;
obj->height = height;
obj->width = width;
obj->next = all_objects;
all_objects = obj;
return (void *) obj;
}
void
dlg_free_gauge(void *objptr)
{
MY_OBJ *obj = (MY_OBJ *) objptr;
curs_set(1);
if (valid(obj)) {
delink(obj);
obj->obj.keep_win = FALSE;
dlg_remove_callback(&(obj->obj));
free(obj);
} }
} }
@ -236,80 +354,46 @@ dialog_gauge(const char *title,
int width, int width,
int percent) int percent)
{ {
#ifdef KEY_RESIZE
int old_height = height;
int old_width = width;
#endif
int fkey; int fkey;
int ch, result; int ch, result;
int x, y; void *objptr = dlg_allocate_gauge(title, cprompt, height, width, percent);
char *prompt = dlg_strclone(cprompt); MY_OBJ *obj = (MY_OBJ *) objptr;
WINDOW *dialog;
MY_OBJ *obj = 0;
curs_set(0); dlg_add_callback_ref((DIALOG_CALLBACK **) & obj, my_cleanup);
dlg_update_gauge(obj, percent);
dlg_tab_correct_str(prompt);
#ifdef KEY_RESIZE
retry:
#endif
dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MIN_WIDE);
dlg_print_size(height, width);
dlg_ctl_size(height, width);
/* center dialog box on screen */
x = dlg_box_x_ordinate(width);
y = dlg_box_y_ordinate(height);
dialog = dlg_new_window(height, width, y, x);
if (obj == 0) {
MY_OBJ **objref;
obj = dlg_calloc(MY_OBJ, 1);
assert_ptr(obj, "dialog_gauge");
objref = &obj;
obj->obj.input = dialog_state.pipe_input;
obj->obj.win = dialog;
obj->obj.keep_win = TRUE;
obj->obj.bg_task = TRUE;
obj->obj.handle_getc = handle_my_getc;
obj->obj.handle_input = handle_input;
obj->title = title;
obj->prompt = prompt;
obj->percent = percent;
obj->height = height;
obj->width = width;
dlg_add_callback_ref((DIALOG_CALLBACK **) objref, my_cleanup);
} else {
obj->obj.win = dialog;
}
repaint_text(obj);
do { do {
ch = dlg_getc(dialog, &fkey); ch = dlg_getc(obj->obj.win, &fkey);
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
if (fkey && ch == KEY_RESIZE) { if (fkey && ch == KEY_RESIZE) {
/* reset data */ MY_OBJ *oldobj = obj;
height = old_height;
width = old_width;
/* repaint */
dlg_clear();
dlg_del_window(dialog);
refresh();
dlg_mouse_free_regions(); dlg_mouse_free_regions();
goto retry;
obj = dlg_allocate_gauge(title,
cprompt,
height,
width,
oldobj->percent);
/* avoid breaking new window in dlg_remove_callback */
oldobj->obj.caller = 0;
oldobj->obj.input = 0;
oldobj->obj.keep_win = FALSE;
/* remove the old version of the gauge */
dlg_clear();
dlg_remove_callback(&(oldobj->obj));
refresh();
dlg_add_callback_ref((DIALOG_CALLBACK **) & obj, my_cleanup);
dlg_update_gauge(obj, obj->percent);
} }
#endif #endif
} }
while (handle_my_getc(&(obj->obj), ch, fkey, &result)); while (valid(obj) && handle_my_getc(&(obj->obj), ch, fkey, &result));
curs_set(1); dlg_free_gauge(obj);
dlg_del_window(dialog);
return (DLG_EXIT_OK); return (DLG_EXIT_OK);
} }

43
help.c Normal file
View File

@ -0,0 +1,43 @@
/*
* $Id: help.c,v 1.2 2011/06/25 00:27:16 tom Exp $
*
* help.c -- implements the help dialog
*
* Copyright 2011 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.
*/
#include <dialog.h>
/*
* Display a help-file as a textbox widget.
*/
int
dialog_helpfile(const char *title,
const char *file,
int height,
int width)
{
int result = DLG_EXIT_ERROR;
if (!dialog_vars.in_helpfile && file != 0 && *file != '\0') {
dialog_vars.in_helpfile = TRUE;
result = dialog_textbox(title, file, height, width);
dialog_vars.in_helpfile = FALSE;
}
return (result);
}

View File

@ -1,9 +1,9 @@
/* /*
* $Id: inputbox.c,v 1.64 2010/01/19 01:03:39 tom Exp $ * $Id: inputbox.c,v 1.67 2011/06/29 09:48:34 tom Exp $
* *
* inputbox.c -- implements the input box * inputbox.c -- implements the input box
* *
* Copyright 2000-2009,2010 Thomas E. Dickey * Copyright 2000-2010,2011 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -46,12 +46,14 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
NAVIGATE_BINDINGS, NAVIGATE_BINDINGS,
END_KEYS_BINDING END_KEYS_BINDING
}; };
static DLG_KEYS_BINDING binding2[] = { static DLG_KEYS_BINDING binding2[] = {
INPUTSTR_BINDINGS, INPUTSTR_BINDINGS,
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
NAVIGATE_BINDINGS, NAVIGATE_BINDINGS,
END_KEYS_BINDING END_KEYS_BINDING
@ -119,6 +121,7 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
dlg_draw_title(dialog, title); dlg_draw_title(dialog, title);
wattrset(dialog, dialog_attr); wattrset(dialog, dialog_attr);
dlg_draw_helpline(dialog, FALSE);
dlg_print_autowrap(dialog, prompt, height, width); dlg_print_autowrap(dialog, prompt, height, width);
/* Draw the input field box */ /* Draw the input field box */
@ -202,7 +205,7 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
case ' ': /* FIXME: conflict with inputstr.c */ case ' ': /* FIXME: conflict with inputstr.c */
case DLGK_ENTER: case DLGK_ENTER:
dlg_del_window(dialog); dlg_del_window(dialog);
result = (state >= 0) ? dlg_ok_buttoncode(state) : DLG_EXIT_OK; result = (state >= 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
break; break;
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
case KEY_RESIZE: case KEY_RESIZE:

View File

@ -1,4 +1,4 @@
# $Id: makefile.in,v 1.78 2011/03/02 09:57:24 tom Exp $ # $Id: makefile.in,v 1.79 2011/06/25 00:27:56 tom Exp $
# template makefile for DIALOG # template makefile for DIALOG
############################################################################## ##############################################################################
# Copyright (c) 1999-2010,2011 Thomas E. Dickey # # Copyright (c) 1999-2010,2011 Thomas E. Dickey #
@ -134,6 +134,7 @@ OBJECTS = $(EXTRAOBJS) \
columns$o \ columns$o \
dlg_keys$o \ dlg_keys$o \
editbox$o \ editbox$o \
help$o \
inputbox$o \ inputbox$o \
inputstr$o \ inputstr$o \
menubox$o \ menubox$o \

View File

@ -1,5 +1,5 @@
/* /*
* $Id: menubox.c,v 1.120 2011/01/19 00:27:53 tom Exp $ * $Id: menubox.c,v 1.122 2011/06/29 09:48:46 tom Exp $
* *
* menubox.c -- implements the menu box * menubox.c -- implements the menu box
* *
@ -291,6 +291,7 @@ dlg_menu(const char *title,
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
DLG_KEYS_DATA( DLGK_FIELD_NEXT, ' ' ), DLG_KEYS_DATA( DLGK_FIELD_NEXT, ' ' ),
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ), DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
@ -312,6 +313,7 @@ dlg_menu(const char *title,
}; };
static DLG_KEYS_BINDING binding2[] = { static DLG_KEYS_BINDING binding2[] = {
INPUTSTR_BINDINGS, INPUTSTR_BINDINGS,
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
END_KEYS_BINDING END_KEYS_BINDING
}; };
@ -685,7 +687,7 @@ dlg_menu(const char *title,
FALSE, width); FALSE, width);
break; break;
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_ok_buttoncode(button); result = dlg_enter_buttoncode(button);
/* /*
* If dlg_menu() is called from dialog_menu(), we want to * If dlg_menu() is called from dialog_menu(), we want to

View File

@ -1,5 +1,5 @@
/* /*
* $Id: mixedgauge.c,v 1.23 2011/01/19 00:27:53 tom Exp $ * $Id: mixedgauge.c,v 1.24 2011/06/27 08:16:38 tom Exp $
* *
* mixedgauge.c -- implements the mixedgauge dialog * mixedgauge.c -- implements the mixedgauge dialog
* *
@ -331,6 +331,7 @@ dlg_begin_mixedgauge(DIALOG_MIXEDGAUGE * dlg,
dialog_attr, border_attr); dialog_attr, border_attr);
dlg_draw_title(dlg->dialog, dlg->title); dlg_draw_title(dlg->dialog, dlg->title);
dlg_draw_helpline(dlg->dialog, FALSE);
if ((dlg->prompt != 0 && *(dlg->prompt) != 0) if ((dlg->prompt != 0 && *(dlg->prompt) != 0)
&& wmove(dlg->dialog, dlg->item_no, 0) != ERR) { && wmove(dlg->dialog, dlg->item_no, 0) != ERR) {

View File

@ -1,9 +1,9 @@
/* /*
* $Id: msgbox.c,v 1.64 2010/01/15 10:50:17 tom Exp $ * $Id: msgbox.c,v 1.66 2011/06/27 08:36:28 tom Exp $
* *
* msgbox.c -- implements the message box and info box * msgbox.c -- implements the message box and info box
* *
* Copyright 2000-2009,2010 Thomas E. Dickey * Copyright 2000-2010,2011 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -37,6 +37,7 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
DLG_KEYS_DATA( DLGK_ENTER, ' ' ), DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
SCROLLKEY_BINDINGS, SCROLLKEY_BINDINGS,
@ -103,6 +104,7 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
dlg_draw_bottom_box(dialog); dlg_draw_bottom_box(dialog);
mouse_mkbutton(height - 2, width / 2 - 4, 6, '\n'); mouse_mkbutton(height - 2, width / 2 - 4, 6, '\n');
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width); dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
dlg_draw_helpline(dialog, FALSE);
while (result == DLG_EXIT_UNKNOWN) { while (result == DLG_EXIT_UNKNOWN) {
if (show) { if (show) {
@ -172,6 +174,7 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
} }
} else { } else {
dlg_print_scrolled(dialog, prompt, offset, page, width, pauseopt); dlg_print_scrolled(dialog, prompt, offset, page, width, pauseopt);
dlg_draw_helpline(dialog, FALSE);
wrefresh(dialog); wrefresh(dialog);
result = DLG_EXIT_OK; result = DLG_EXIT_OK;
} }

View File

@ -1,3 +1,15 @@
cdialog (20110707) unstable; urgency=high
* fix a regression in dlg_getc() from 20110630 changes.
-- Thomas E. Dickey <dickey@invisible-island.net> Thu, 07 Jul 2011 18:10:47 -0400
cdialog (20110630) unstable; urgency=high
* various bug-fixes reported in FreeBSD.
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 13 Jun 2011 05:44:17 -0400
cdialog (20110302) unstable; urgency=high cdialog (20110302) unstable; urgency=high
* Add --prgbox and --progressbox * Add --prgbox and --progressbox

View File

@ -3,12 +3,12 @@ Maintainer: Thomas E. Dickey <dickey@invisible-island.net>
Section: misc Section: misc
Priority: optional Priority: optional
Standards-Version: 3.8.4 Standards-Version: 3.8.4
Build-Depends: debhelper (>= 5) Build-Depends: debhelper (>= 5), libncursesw5-dev (>= 5.3), groff-base
Homepage: http://invisible-island.net/dialog/ Homepage: http://invisible-island.net/dialog/
Package: cdialog Package: cdialog
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends} Depends: libncursesw5 (>= 5.3)
Description: dialog - display dialog boxes from shell scripts Description: dialog - display dialog boxes from shell scripts
Dialog is a program that will let you to present a variety of questions Dialog is a program that will let you to present a variety of questions
or display messages using dialog boxes from a shell script. These or display messages using dialog boxes from a shell script. These

View File

@ -1,9 +1,9 @@
Summary: dialog - display dialog boxes from shell scripts Summary: dialog - display dialog boxes from shell scripts
%define AppProgram dialog %define AppProgram dialog
%define AppVersion 1.1 %define AppVersion 1.1
%define AppRelease 20110302 %define AppRelease 20110707
%define ActualProg c%{AppProgram} %define ActualProg c%{AppProgram}
# $XTermId: dialog.spec,v 1.16 2011/03/02 10:08:16 tom Exp $ # $XTermId: dialog.spec,v 1.24 2011/07/07 22:10:02 tom Exp $
Name: %{ActualProg} Name: %{ActualProg}
Version: %{AppVersion} Version: %{AppVersion}
Release: %{AppRelease} Release: %{AppRelease}

View File

@ -1,5 +1,5 @@
/* /*
* $Id: pause.c,v 1.26 2011/01/18 10:16:33 tom Exp $ * $Id: pause.c,v 1.29 2011/06/29 09:48:53 tom Exp $
* *
* pause.c -- implements the pause dialog * pause.c -- implements the pause dialog
* *
@ -53,6 +53,7 @@ dialog_pause(const char *title,
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
DLG_KEYS_DATA( DLGK_ENTER, ' ' ), DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ), DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ),
@ -124,6 +125,7 @@ dialog_pause(const char *title,
dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
dlg_draw_title(dialog, title); dlg_draw_title(dialog, title);
dlg_draw_helpline(dialog, FALSE);
wattrset(dialog, dialog_attr); wattrset(dialog, dialog_attr);
dlg_print_autowrap(dialog, prompt, height, width); dlg_print_autowrap(dialog, prompt, height, width);
@ -215,7 +217,7 @@ dialog_pause(const char *title,
FALSE, width); FALSE, width);
break; break;
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_ok_buttoncode(button); result = dlg_enter_buttoncode(button);
break; break;
case DLGK_MOUSE(0): case DLGK_MOUSE(0):
result = DLG_EXIT_OK; result = DLG_EXIT_OK;

111
po/sk.po Normal file
View File

@ -0,0 +1,111 @@
# Dialog
# Copyright 2003-2007,2008 # Thomas Dickey
# This file is distributed under the same license as the dialog package.
# Marián Čavojský <preklad@cavo.sk>, 2011
#
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: 2011-03-09 09:50+0100\n"
"Last-Translator: Marián Čavojský <preklad@cavo.sk>\n"
"Language-Team: Slovak <sk-i18n@lists.linux.sk>\n"
"Language: sk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: buttons.c:385
msgid "Yes"
msgstr "Áno"
#: buttons.c:393
msgid "No"
msgstr "Nie"
#: buttons.c:401
msgid "OK"
msgstr "OK"
#: buttons.c:409
msgid "Cancel"
msgstr "Zrušiť"
#: buttons.c:417
msgid "EXIT"
msgstr "VÝCHOD"
#: buttons.c:425
msgid "Extra"
msgstr "Extra"
#: buttons.c:433
msgid "Help"
msgstr "Pomoc"
#. Headline "Month"
#: calendar.c:273
msgid "Month"
msgstr "Mesiac"
#. Headline "Year"
#: calendar.c:293
msgid "Year"
msgstr "Rok"
#: dialog.c:741
msgid "Rename"
msgstr "Premenovať"
#: fselect.c:550
msgid "Directories"
msgstr "Adresáre"
#: fselect.c:551
msgid "Files"
msgstr "Súbory"
#: mixedgauge.c:58
msgid "Succeeded"
msgstr "Vporiadku"
#: mixedgauge.c:61
msgid "Failed"
msgstr "S chybou"
#: mixedgauge.c:64
msgid "Passed"
msgstr "Prešlo"
#: mixedgauge.c:67
msgid "Completed"
msgstr "Skompletované"
#: mixedgauge.c:70
msgid "Checked"
msgstr "Skontrolované"
#: mixedgauge.c:73
msgid "Done"
msgstr "Dokončené"
#: mixedgauge.c:76
msgid "Skipped"
msgstr "Preskočené"
#: mixedgauge.c:79
msgid "In Progress"
msgstr "Spracováva"
#: mixedgauge.c:85
msgid "N/A"
msgstr "N/A"
#: mixedgauge.c:193
msgid "Overall Progress"
msgstr "Celkový pokrok"
#: textbox.c:489
msgid "Search"
msgstr "Vyhľadať"

View File

@ -1,14 +1,13 @@
/* /*
* $Id: prgbox.c,v 1.6 2011/03/02 09:59:26 tom Exp $ * $Id: prgbox.c,v 1.7 2011/06/30 20:44:13 tom Exp $
* *
* prgbox.c -- implements the prg box * prgbox.c -- implements the prg box
* *
* Copyright 2011 Thomas E. Dickey * Copyright 2011 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License, version 2.1
* published by the Free Software Foundation; either version 2.1 of the * as published by the Free Software Foundation.
* License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of

View File

@ -1,5 +1,5 @@
/* /*
* $Id: progressbox.c,v 1.11 2011/03/02 01:10:08 tom Exp $ * $Id: progressbox.c,v 1.13 2011/06/27 08:18:20 tom Exp $
* *
* progressbox.c -- implements the progress box * progressbox.c -- implements the progress box
* *
@ -109,6 +109,7 @@ pause_for_ok(WINDOW *dialog, int height, int width)
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
DLG_KEYS_DATA( DLGK_ENTER, ' ' ), DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
END_KEYS_BINDING END_KEYS_BINDING
@ -189,6 +190,7 @@ dlg_progressbox(const char *title,
dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
dlg_draw_title(dialog, title); dlg_draw_title(dialog, title);
dlg_draw_helpline(dialog, FALSE);
if (*prompt != '\0') { if (*prompt != '\0') {
int y2, x2; int y2, x2;

15
rc.c
View File

@ -1,9 +1,9 @@
/* /*
* $Id: rc.c,v 1.45 2010/01/18 10:28:16 tom Exp $ * $Id: rc.c,v 1.47 2011/06/20 22:30:04 tom Exp $
* *
* rc.c -- routines for processing the configuration file * rc.c -- routines for processing the configuration file
* *
* Copyright 2000-2008,2010 Thomas E. Dickey * Copyright 2000-2010,2011 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -433,9 +433,7 @@ dlg_create_rc(const char *filename)
dlg_color_table[i].hilite)); dlg_color_table[i].hilite));
} }
#endif /* HAVE_COLOR */ #endif /* HAVE_COLOR */
#if 1
dlg_dump_keys(rc_file); dlg_dump_keys(rc_file);
#endif
(void) fclose(rc_file); (void) fclose(rc_file);
} }
@ -455,9 +453,7 @@ dlg_parse_rc(void)
char *tempptr; char *tempptr;
int result = 0; int result = 0;
FILE *rc_file = 0; FILE *rc_file = 0;
#if 1
char *params; char *params;
#endif
/* /*
* At startup, dialog determines the settings to use as follows: * At startup, dialog determines the settings to use as follows:
@ -486,20 +482,21 @@ dlg_parse_rc(void)
sprintf(str, "%s%s", tempptr, DIALOGRC); sprintf(str, "%s%s", tempptr, DIALOGRC);
else else
sprintf(str, "%s/%s", tempptr, DIALOGRC); sprintf(str, "%s/%s", tempptr, DIALOGRC);
rc_file = fopen(str, "rt"); rc_file = fopen(tempptr = str, "rt");
} }
} }
if (rc_file == NULL) { /* step (b) failed? */ if (rc_file == NULL) { /* step (b) failed? */
/* try step (c) */ /* try step (c) */
strcpy(str, GLOBALRC); strcpy(str, GLOBALRC);
if ((rc_file = fopen(str, "rt")) == NULL) if ((rc_file = fopen(tempptr = str, "rt")) == NULL)
return 0; /* step (c) failed, use default values */ return 0; /* step (c) failed, use default values */
} }
DLG_TRACE(("opened rc file \"%s\"\n", tempptr));
/* Scan each line and set variables */ /* Scan each line and set variables */
while ((result == 0) && (fgets(str, MAX_LEN, rc_file) != NULL)) { while ((result == 0) && (fgets(str, MAX_LEN, rc_file) != NULL)) {
dlg_trace_msg("rc:%s\n", str); DLG_TRACE(("rc:%s", str));
if (*str == '\0' || lastch(str) != '\n') { if (*str == '\0' || lastch(str) != '\n') {
/* ignore rest of file if line too long */ /* ignore rest of file if line too long */
fprintf(stderr, "\nParse error: line %d of configuration" fprintf(stderr, "\nParse error: line %d of configuration"

847
samples/valgrind.log Normal file
View File

@ -0,0 +1,847 @@
==23273== Memcheck, a memory error detector.
==23273== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==23273== Using LibVEX rev 1854, a library for dynamic binary translation.
==23273== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==23273== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation framework.
==23273== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==23273==
--23273-- Command line
--23273-- /usr/build/dialog/dialog-1.1-20110707/dialog
--23273-- --title
--23273-- YES/NO BOX
--23273-- --clear
--23273-- --yesno
--23273-- Hi, this is a yes/no dialog box. You can use this to ask questions that have an answer of either yes or no. BTW, do you notice that long lines will be automatically wrapped around so that they can fit in the box? You can also control line breaking explicitly by inserting 'backslash n' at any place you like, but in this case, auto wrap around will be disabled and you will have to control line breaking yourself.
--23273-- 15
--23273-- 61
--23273-- Startup, with flags:
--23273-- --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--23273-- -v
--23273-- --num-callers=10
--23273-- --error-limit=no
--23273-- --show-reachable=yes
--23273-- --leak-resolution=high
--23273-- --leak-check=yes
--23273-- --show-reachable=yes
--23273-- --log-fd=2
--23273-- Contents of /proc/version:
--23273-- Linux version 2.6.26-2-686 (Debian 2.6.26-26lenny3) (dannf@debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Sat Jun 11 14:54:10 UTC 2011
--23273-- Arch and hwcaps: X86, x86-sse1-sse2
--23273-- Page sizes: currently 4096, max supported 4096
--23273-- Valgrind library directory: /usr/lib/valgrind
--23273-- Reading syms from /lib/ld-2.7.so (0x4000000)
--23273-- Reading debug info from /lib/ld-2.7.so...
--23273-- ... CRC mismatch (computed 0f4d8d49 wanted a869dbba)
--23273-- Reading debug info from /usr/lib/debug/lib/ld-2.7.so...
--23273-- Reading syms from /usr/build/dialog/dialog-1.1-20110707/dialog (0x8048000)
--23273-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0x38000000)
--23273-- object doesn't have a dynamic symbol table
--23273-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
--23273-- Reading suppressions file: /usr/lib/valgrind/default.supp
--23273-- REDIR: 0x4015500 (index) redirected to 0x3802cf43 (vgPlain_x86_linux_REDIR_FOR_index)
--23273-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so (0x401E000)
--23273-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so (0x4020000)
==23273== WARNING: new redirection conflicts with existing -- ignoring it
--23273-- new: 0x04015500 (index ) R-> 0x040241e0 index
--23273-- REDIR: 0x40156f0 (strlen) redirected to 0x4024490 (strlen)
--23273-- Reading syms from /usr/lib/debug/libm-2.7.so (0x4027000)
--23273-- Reading syms from /usr/lib/debug/libc-2.7.so (0x404D000)
--23273-- REDIR: 0x40beaf0 (rindex) redirected to 0x40240c0 (rindex)
--23273-- REDIR: 0x40bf760 (memset) redirected to 0x4025380 (memset)
--23273-- REDIR: 0x40be160 (strcmp) redirected to 0x4024770 (strcmp)
--23273-- REDIR: 0x40be700 (strlen) redirected to 0x4024470 (strlen)
--23273-- REDIR: 0x40be910 (strncmp) redirected to 0x40246e0 (strncmp)
--23273-- REDIR: 0x40bdff0 (index) redirected to 0x40241b0 (index)
--23273-- REDIR: 0x40b9740 (free) redirected to 0x4022ad0 (free)
--23273-- REDIR: 0x40bb2c0 (calloc) redirected to 0x4021d60 (calloc)
--23273-- REDIR: 0x40c07e0 (strchrnul) redirected to 0x4025450 (strchrnul)
--23273-- REDIR: 0x40bb5e0 (malloc) redirected to 0x4023cb0 (malloc)
--23273-- REDIR: 0x40bfc80 (memcpy) redirected to 0x40248e0 (memcpy)
--23273-- REDIR: 0x40be7b0 (strnlen) redirected to 0x4024430 (strnlen)
--23273-- REDIR: 0x40bf7c0 (mempcpy) redirected to 0x40254b0 (mempcpy)
--23273-- REDIR: 0x40be1f0 (strcpy) redirected to 0x40244d0 (strcpy)
--23273-- REDIR: 0x40bba60 (realloc) redirected to 0x4023dc0 (realloc)
--23273-- REDIR: 0x40bea20 (strncpy) redirected to 0x40245a0 (strncpy)
--23273-- REDIR: 0x40bf690 (bcmp) redirected to 0x4025070 (bcmp)
--23273-- REDIR: 0x40bde40 (strcat) redirected to 0x4024240 (strcat)
==23273==
==23273== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 14 from 1)
--23273--
--23273-- supp: 14 dl-hack3-cond-1
==23273== malloc/free: in use at exit: 72,482 bytes in 382 blocks.
==23273== malloc/free: 419 allocs, 37 frees, 79,695 bytes allocated.
==23273==
==23273== searching for pointers to 382 not-freed blocks.
==23273== checked 149,580 bytes.
==23273==
==23273== 6 bytes in 1 blocks are still reachable in loss record 1 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8068E64: dlg_strclone (util.c:1740)
==23273== by 0x805FE72: same_cache2 (inputstr.c:212)
==23273== by 0x805FEE7: dlg_index_wchars (inputstr.c:342)
==23273== by 0x8059BBE: print_button (buttons.c:97)
==23273== by 0x805A265: dlg_draw_buttons (buttons.c:297)
==23273== by 0x806A2D0: dialog_yesno (yesno.c:98)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 6 bytes in 1 blocks are still reachable in loss record 2 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8068E64: dlg_strclone (util.c:1740)
==23273== by 0x805FE72: same_cache2 (inputstr.c:212)
==23273== by 0x805FFCE: dlg_index_columns (inputstr.c:397)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x805A1F3: dlg_draw_buttons (buttons.c:296)
==23273== by 0x806A2D0: dialog_yesno (yesno.c:98)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 7 bytes in 2 blocks are still reachable in loss record 3 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8068E64: dlg_strclone (util.c:1740)
==23273== by 0x805FE72: same_cache2 (inputstr.c:212)
==23273== by 0x805FFCE: dlg_index_columns (inputstr.c:397)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8059E3A: dlg_button_sizes (buttons.c:179)
==23273== by 0x8059F04: dlg_button_x_step (buttons.c:209)
==23273== by 0x805A02F: dlg_button_layout (buttons.c:234)
==23273== by 0x806A11F: dialog_yesno (yesno.c:71)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273==
==23273==
==23273== 11 bytes in 1 blocks are still reachable in loss record 4 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8068E64: dlg_strclone (util.c:1740)
==23273== by 0x805FE72: same_cache2 (inputstr.c:212)
==23273== by 0x805FFCE: dlg_index_columns (inputstr.c:397)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8067711: real_auto_size (util.c:1101)
==23273== by 0x8067A1F: dlg_auto_size (util.c:1167)
==23273== by 0x806A14E: dialog_yesno (yesno.c:72)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 12 bytes in 1 blocks are still reachable in loss record 5 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x807F18F: _nc_add_to_try (add_tries.c:90)
==23273== by 0x80885C6: _nc_init_keytry (init_keytry.c:74)
==23273== by 0x80807F4: _nc_keypad (lib_options.c:262)
==23273== by 0x808035F: keypad (lib_options.c:129)
==23273== by 0x8066340: init_dialog (util.c:330)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 16 bytes in 1 blocks are still reachable in loss record 6 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x41165D0: tsearch (tsearch.c:281)
==23273== by 0x805FC92: make_cache (inputstr.c:149)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FFB4: dlg_index_columns (inputstr.c:396)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8066FD3: dlg_print_scrolled (util.c:886)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 16 bytes in 1 blocks are still reachable in loss record 7 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x41165D0: tsearch (tsearch.c:281)
==23273== by 0x805FC92: make_cache (inputstr.c:149)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FECD: dlg_index_wchars (inputstr.c:341)
==23273== by 0x8059BBE: print_button (buttons.c:97)
==23273== by 0x805A265: dlg_draw_buttons (buttons.c:297)
==23273== by 0x806A2D0: dialog_yesno (yesno.c:98)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 16 bytes in 1 blocks are still reachable in loss record 8 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x41165D0: tsearch (tsearch.c:281)
==23273== by 0x805FC92: make_cache (inputstr.c:149)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FFB4: dlg_index_columns (inputstr.c:396)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x805A1F3: dlg_draw_buttons (buttons.c:296)
==23273== by 0x806A2D0: dialog_yesno (yesno.c:98)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 16 bytes in 1 blocks are still reachable in loss record 9 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x41165D0: tsearch (tsearch.c:281)
==23273== by 0x805FC92: make_cache (inputstr.c:149)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FFB4: dlg_index_columns (inputstr.c:396)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8067711: real_auto_size (util.c:1101)
==23273== by 0x8067A1F: dlg_auto_size (util.c:1167)
==23273== by 0x806A14E: dialog_yesno (yesno.c:72)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273==
==23273==
==23273== 16 bytes in 1 blocks are still reachable in loss record 10 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x807F2D5: _nc_doalloc (doalloc.c:55)
==23273== by 0x8086167: _nc_trace_alloc (trace_buf.c:55)
==23273== by 0x8086261: _nc_trace_buf (trace_buf.c:90)
==23273== by 0x80864A7: _nc_visbuf2n (visbuf.c:94)
==23273== by 0x8086538: _nc_visbuf2 (visbuf.c:114)
==23273== by 0x8086553: _nc_visbuf (visbuf.c:120)
==23273== by 0x8088693: recur_tries (trace_tries.c:55)
==23273== by 0x80886D7: recur_tries (trace_tries.c:59)
==23273== by 0x80886D7: recur_tries (trace_tries.c:59)
==23273==
==23273==
==23273== 21 bytes in 1 blocks are still reachable in loss record 11 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x40BE45F: strdup (strdup.c:43)
==23273== by 0x8081EE0: setupterm (lib_setup.c:471)
==23273== by 0x8072292: newterm (lib_newterm.c:115)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 23 bytes in 1 blocks are still reachable in loss record 12 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8088526: _nc_home_terminfo (home_terminfo.c:57)
==23273== by 0x8085E1B: _nc_read_entry (read_entry.c:492)
==23273== by 0x8081834: grab_entry (lib_setup.c:255)
==23273== by 0x8081D46: setupterm (lib_setup.c:438)
==23273== by 0x8072292: newterm (lib_newterm.c:115)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 24 bytes in 1 blocks are still reachable in loss record 13 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x805FDE1: same_cache2 (inputstr.c:201)
==23273== by 0x805FEE7: dlg_index_wchars (inputstr.c:342)
==23273== by 0x8059BBE: print_button (buttons.c:97)
==23273== by 0x805A265: dlg_draw_buttons (buttons.c:297)
==23273== by 0x806A2D0: dialog_yesno (yesno.c:98)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 24 bytes in 1 blocks are still reachable in loss record 14 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x805FDE1: same_cache2 (inputstr.c:201)
==23273== by 0x805FFCE: dlg_index_columns (inputstr.c:397)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x805A1F3: dlg_draw_buttons (buttons.c:296)
==23273== by 0x806A2D0: dialog_yesno (yesno.c:98)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 28 bytes in 1 blocks are still reachable in loss record 15 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x805FC0F: make_cache (inputstr.c:139)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FFB4: dlg_index_columns (inputstr.c:396)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8066FD3: dlg_print_scrolled (util.c:886)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 28 bytes in 1 blocks are still reachable in loss record 16 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x805FC0F: make_cache (inputstr.c:139)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FECD: dlg_index_wchars (inputstr.c:341)
==23273== by 0x8059BBE: print_button (buttons.c:97)
==23273== by 0x805A265: dlg_draw_buttons (buttons.c:297)
==23273== by 0x806A2D0: dialog_yesno (yesno.c:98)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 28 bytes in 1 blocks are still reachable in loss record 17 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x805FC0F: make_cache (inputstr.c:139)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FFB4: dlg_index_columns (inputstr.c:396)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x805A1F3: dlg_draw_buttons (buttons.c:296)
==23273== by 0x806A2D0: dialog_yesno (yesno.c:98)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 28 bytes in 1 blocks are still reachable in loss record 18 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x805FC0F: make_cache (inputstr.c:139)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FFB4: dlg_index_columns (inputstr.c:396)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8067711: real_auto_size (util.c:1101)
==23273== by 0x8067A1F: dlg_auto_size (util.c:1167)
==23273== by 0x806A14E: dialog_yesno (yesno.c:72)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 28 bytes in 2 blocks are still reachable in loss record 19 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x805FDE1: same_cache2 (inputstr.c:201)
==23273== by 0x805FFCE: dlg_index_columns (inputstr.c:397)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8059E3A: dlg_button_sizes (buttons.c:179)
==23273== by 0x8059F04: dlg_button_x_step (buttons.c:209)
==23273== by 0x805A02F: dlg_button_layout (buttons.c:234)
==23273== by 0x806A11F: dialog_yesno (yesno.c:71)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 32 bytes in 2 blocks are still reachable in loss record 20 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x41165D0: tsearch (tsearch.c:281)
==23273== by 0x805FC92: make_cache (inputstr.c:149)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FFB4: dlg_index_columns (inputstr.c:396)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8059E3A: dlg_button_sizes (buttons.c:179)
==23273== by 0x8059F04: dlg_button_x_step (buttons.c:209)
==23273== by 0x805A02F: dlg_button_layout (buttons.c:234)
==23273== by 0x806A11F: dialog_yesno (yesno.c:71)
==23273==
==23273==
==23273== 33 bytes in 1 blocks are still reachable in loss record 21 of 62
==23273== at 0x4023E8C: realloc (vg_replace_malloc.c:429)
==23273== by 0x807F2A9: _nc_doalloc (doalloc.c:50)
==23273== by 0x808620A: _nc_trace_alloc (trace_buf.c:63)
==23273== by 0x8086261: _nc_trace_buf (trace_buf.c:90)
==23273== by 0x80864A7: _nc_visbuf2n (visbuf.c:94)
==23273== by 0x8086538: _nc_visbuf2 (visbuf.c:114)
==23273== by 0x8086553: _nc_visbuf (visbuf.c:120)
==23273== by 0x8088693: recur_tries (trace_tries.c:55)
==23273== by 0x80886D7: recur_tries (trace_tries.c:59)
==23273== by 0x80886D7: recur_tries (trace_tries.c:59)
==23273==
==23273==
==23273== 44 bytes in 1 blocks are still reachable in loss record 22 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x805FDE1: same_cache2 (inputstr.c:201)
==23273== by 0x805FFCE: dlg_index_columns (inputstr.c:397)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8067711: real_auto_size (util.c:1101)
==23273== by 0x8067A1F: dlg_auto_size (util.c:1167)
==23273== by 0x806A14E: dialog_yesno (yesno.c:72)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 47 bytes in 1 blocks are still reachable in loss record 23 of 62
==23273== at 0x4023E8C: realloc (vg_replace_malloc.c:429)
==23273== by 0x807F2A9: _nc_doalloc (doalloc.c:50)
==23273== by 0x8085368: read_termtype (read_entry.c:283)
==23273== by 0x8085B64: _nc_read_file_entry (read_entry.c:392)
==23273== by 0x8085BF5: _nc_read_tic_entry (read_entry.c:413)
==23273== by 0x8085C8A: _nc_read_terminfo_dirs (read_entry.c:438)
==23273== by 0x8085E90: _nc_read_entry (read_entry.c:500)
==23273== by 0x8081834: grab_entry (lib_setup.c:255)
==23273== by 0x8081D46: setupterm (lib_setup.c:438)
==23273== by 0x8072292: newterm (lib_newterm.c:115)
==23273==
==23273==
==23273== 55 bytes in 1 blocks are still reachable in loss record 24 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x8084EC3: read_termtype (read_entry.c:207)
==23273== by 0x8085B64: _nc_read_file_entry (read_entry.c:392)
==23273== by 0x8085BF5: _nc_read_tic_entry (read_entry.c:413)
==23273== by 0x8085C8A: _nc_read_terminfo_dirs (read_entry.c:438)
==23273== by 0x8085E90: _nc_read_entry (read_entry.c:500)
==23273== by 0x8081834: grab_entry (lib_setup.c:255)
==23273== by 0x8081D46: setupterm (lib_setup.c:438)
==23273== by 0x8072292: newterm (lib_newterm.c:115)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273==
==23273==
==23273== 56 bytes in 2 blocks are still reachable in loss record 25 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x805FC0F: make_cache (inputstr.c:139)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FFB4: dlg_index_columns (inputstr.c:396)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8059E3A: dlg_button_sizes (buttons.c:179)
==23273== by 0x8059F04: dlg_button_x_step (buttons.c:209)
==23273== by 0x805A02F: dlg_button_layout (buttons.c:234)
==23273== by 0x806A11F: dialog_yesno (yesno.c:71)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273==
==23273==
==23273== 66 bytes in 1 blocks are still reachable in loss record 26 of 62
==23273== at 0x4023E8C: realloc (vg_replace_malloc.c:429)
==23273== by 0x807F2A9: _nc_doalloc (doalloc.c:50)
==23273== by 0x808238C: get_space (lib_tparm.c:155)
==23273== by 0x8082443: save_number (lib_tparm.c:180)
==23273== by 0x8082D8B: tparam_internal (lib_tparm.c:564)
==23273== by 0x80833C4: tparm (lib_tparm.c:788)
==23273== by 0x80704CF: _nc_mvcur_init (lib_mvcur.c:358)
==23273== by 0x8072684: newterm (lib_newterm.c:191)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273==
==23273==
==23273== 80 bytes in 1 blocks are still reachable in loss record 27 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x8072E08: _nc_makenew (lib_newwin.c:218)
==23273== by 0x807299B: newwin (lib_newwin.c:126)
==23273== by 0x8074F9A: _nc_setupscreen (lib_set_term.c:459)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 80 bytes in 1 blocks are still reachable in loss record 28 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x8072E08: _nc_makenew (lib_newwin.c:218)
==23273== by 0x807299B: newwin (lib_newwin.c:126)
==23273== by 0x8074CB3: _nc_setupscreen (lib_set_term.c:414)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 80 bytes in 1 blocks are still reachable in loss record 29 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x8072E08: _nc_makenew (lib_newwin.c:218)
==23273== by 0x807299B: newwin (lib_newwin.c:126)
==23273== by 0x8074C55: _nc_setupscreen (lib_set_term.c:410)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 80 bytes in 1 blocks are still reachable in loss record 30 of 62
==23273== at 0x4023E8C: realloc (vg_replace_malloc.c:429)
==23273== by 0x807F2A9: _nc_doalloc (doalloc.c:50)
==23273== by 0x808538F: read_termtype (read_entry.c:284)
==23273== by 0x8085B64: _nc_read_file_entry (read_entry.c:392)
==23273== by 0x8085BF5: _nc_read_tic_entry (read_entry.c:413)
==23273== by 0x8085C8A: _nc_read_terminfo_dirs (read_entry.c:438)
==23273== by 0x8085E90: _nc_read_entry (read_entry.c:500)
==23273== by 0x8081834: grab_entry (lib_setup.c:255)
==23273== by 0x8081D46: setupterm (lib_setup.c:438)
==23273== by 0x8072292: newterm (lib_newterm.c:115)
==23273==
==23273==
==23273== 112 bytes in 7 blocks are still reachable in loss record 31 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x41165D0: tsearch (tsearch.c:281)
==23273== by 0x805FC92: make_cache (inputstr.c:149)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FFB4: dlg_index_columns (inputstr.c:396)
==23273== by 0x8066A0A: dlg_print_line (util.c:668)
==23273== by 0x8066E40: justify_text (util.c:813)
==23273== by 0x8066F5E: dlg_print_autowrap (util.c:843)
==23273== by 0x806703E: dlg_print_scrolled (util.c:892)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273==
==23273==
==23273== 118 bytes in 1 blocks are still reachable in loss record 32 of 62
==23273== at 0x4023E8C: realloc (vg_replace_malloc.c:429)
==23273== by 0x807F2A9: _nc_doalloc (doalloc.c:50)
==23273== by 0x8082957: _nc_tparm_analyze (lib_tparm.c:374)
==23273== by 0x8082B5E: tparam_internal (lib_tparm.c:502)
==23273== by 0x80833C4: tparm (lib_tparm.c:788)
==23273== by 0x80782E6: vidputs (lib_vidattr.c:187)
==23273== by 0x8078B59: vidattr (lib_vidattr.c:270)
==23273== by 0x807ACE8: ClrToEOS (tty_update.c:957)
==23273== by 0x807AF54: ClrBottom (tty_update.c:1006)
==23273== by 0x807AB1C: ClrUpdate (tty_update.c:897)
==23273==
==23273==
==23273== 128 bytes in 8 blocks are still reachable in loss record 33 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x41165D0: tsearch (tsearch.c:281)
==23273== by 0x805FC92: make_cache (inputstr.c:149)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FECD: dlg_index_wchars (inputstr.c:341)
==23273== by 0x8066A18: dlg_print_line (util.c:669)
==23273== by 0x8066E40: justify_text (util.c:813)
==23273== by 0x8066F5E: dlg_print_autowrap (util.c:843)
==23273== by 0x806703E: dlg_print_scrolled (util.c:892)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273==
==23273==
==23273== 128 bytes in 1 blocks are still reachable in loss record 34 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x806BDE0: start_color (lib_color.c:238)
==23273== by 0x80663B1: dlg_color_setup (util.c:360)
==23273== by 0x806638E: init_dialog (util.c:342)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 128 bytes in 1 blocks are still reachable in loss record 35 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x806BDA7: start_color (lib_color.c:236)
==23273== by 0x80663B1: dlg_color_setup (util.c:360)
==23273== by 0x806638E: init_dialog (util.c:342)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 160 bytes in 1 blocks are still reachable in loss record 36 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x8087176: _nc_hash_map (hashmap.c:299)
==23273== by 0x80865F4: _nc_scroll_optimize (hardscroll.c:199)
==23273== by 0x807A762: doupdate (tty_update.c:778)
==23273== by 0x8073C0A: wrefresh (lib_refresh.c:58)
==23273== by 0x806D95D: _nc_wgetch (lib_getch.c:295)
==23273== by 0x806DD0D: wgetch (lib_getch.c:467)
==23273== by 0x80654FC: really_getch (ui_getc.c:352)
==23273== by 0x806566B: dlg_getc (ui_getc.c:423)
==23273== by 0x80627C4: mouse_wgetch (mousewget.c:35)
==23273==
==23273==
==23273== 160 bytes in 1 blocks are still reachable in loss record 37 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x8087141: _nc_hash_map (hashmap.c:297)
==23273== by 0x80865F4: _nc_scroll_optimize (hardscroll.c:199)
==23273== by 0x807A762: doupdate (tty_update.c:778)
==23273== by 0x8073C0A: wrefresh (lib_refresh.c:58)
==23273== by 0x806D95D: _nc_wgetch (lib_getch.c:295)
==23273== by 0x806DD0D: wgetch (lib_getch.c:467)
==23273== by 0x80654FC: really_getch (ui_getc.c:352)
==23273== by 0x806566B: dlg_getc (ui_getc.c:423)
==23273== by 0x80627C4: mouse_wgetch (mousewget.c:35)
==23273==
==23273==
==23273== 160 bytes in 1 blocks are still reachable in loss record 38 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x807F2D5: _nc_doalloc (doalloc.c:55)
==23273== by 0x80865CB: _nc_scroll_optimize (hardscroll.c:192)
==23273== by 0x807A762: doupdate (tty_update.c:778)
==23273== by 0x8073C0A: wrefresh (lib_refresh.c:58)
==23273== by 0x806D95D: _nc_wgetch (lib_getch.c:295)
==23273== by 0x806DD0D: wgetch (lib_getch.c:467)
==23273== by 0x80654FC: really_getch (ui_getc.c:352)
==23273== by 0x806566B: dlg_getc (ui_getc.c:423)
==23273== by 0x80627C4: mouse_wgetch (mousewget.c:35)
==23273==
==23273==
==23273== 172 bytes in 1 blocks are still reachable in loss record 39 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x8081CD7: setupterm (lib_setup.c:431)
==23273== by 0x8072292: newterm (lib_newterm.c:115)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 196 bytes in 7 blocks are still reachable in loss record 40 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x805FC0F: make_cache (inputstr.c:139)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FFB4: dlg_index_columns (inputstr.c:396)
==23273== by 0x8066A0A: dlg_print_line (util.c:668)
==23273== by 0x8066E40: justify_text (util.c:813)
==23273== by 0x8066F5E: dlg_print_autowrap (util.c:843)
==23273== by 0x806703E: dlg_print_scrolled (util.c:892)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273==
==23273==
==23273== 224 bytes in 8 blocks are still reachable in loss record 41 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x805FC0F: make_cache (inputstr.c:139)
==23273== by 0x805FCF7: load_cache (inputstr.c:161)
==23273== by 0x805FECD: dlg_index_wchars (inputstr.c:341)
==23273== by 0x8066A18: dlg_print_line (util.c:669)
==23273== by 0x8066E40: justify_text (util.c:813)
==23273== by 0x8066F5E: dlg_print_autowrap (util.c:843)
==23273== by 0x806703E: dlg_print_scrolled (util.c:892)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273==
==23273==
==23273== 252 bytes in 1 blocks are still reachable in loss record 42 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x80858B3: read_termtype (read_entry.c:345)
==23273== by 0x8085B64: _nc_read_file_entry (read_entry.c:392)
==23273== by 0x8085BF5: _nc_read_tic_entry (read_entry.c:413)
==23273== by 0x8085C8A: _nc_read_terminfo_dirs (read_entry.c:438)
==23273== by 0x8085E90: _nc_read_entry (read_entry.c:500)
==23273== by 0x8081834: grab_entry (lib_setup.c:255)
==23273== by 0x8081D46: setupterm (lib_setup.c:438)
==23273== by 0x8072292: newterm (lib_newterm.c:115)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273==
==23273==
==23273== 421 bytes in 1 blocks are still reachable in loss record 43 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8068E64: dlg_strclone (util.c:1740)
==23273== by 0x805FE72: same_cache2 (inputstr.c:212)
==23273== by 0x805FFCE: dlg_index_columns (inputstr.c:397)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8066FD3: dlg_print_scrolled (util.c:886)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 480 bytes in 1 blocks are still reachable in loss record 44 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x8072E36: _nc_makenew (lib_newwin.c:223)
==23273== by 0x807299B: newwin (lib_newwin.c:126)
==23273== by 0x8074F9A: _nc_setupscreen (lib_set_term.c:459)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 480 bytes in 1 blocks are still reachable in loss record 45 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x8072E36: _nc_makenew (lib_newwin.c:223)
==23273== by 0x807299B: newwin (lib_newwin.c:126)
==23273== by 0x8074CB3: _nc_setupscreen (lib_set_term.c:414)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 480 bytes in 1 blocks are still reachable in loss record 46 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x8072E36: _nc_makenew (lib_newwin.c:223)
==23273== by 0x807299B: newwin (lib_newwin.c:126)
==23273== by 0x8074C55: _nc_setupscreen (lib_set_term.c:410)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 689 bytes in 1 blocks are still reachable in loss record 47 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8085659: read_termtype (read_entry.c:318)
==23273== by 0x8085B64: _nc_read_file_entry (read_entry.c:392)
==23273== by 0x8085BF5: _nc_read_tic_entry (read_entry.c:413)
==23273== by 0x8085C8A: _nc_read_terminfo_dirs (read_entry.c:438)
==23273== by 0x8085E90: _nc_read_entry (read_entry.c:500)
==23273== by 0x8081834: grab_entry (lib_setup.c:255)
==23273== by 0x8081D46: setupterm (lib_setup.c:438)
==23273== by 0x8072292: newterm (lib_newterm.c:115)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273==
==23273==
==23273== 780 bytes in 65 blocks are still reachable in loss record 48 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x807F1FF: _nc_add_to_try (add_tries.c:104)
==23273== by 0x80885C6: _nc_init_keytry (init_keytry.c:74)
==23273== by 0x80807F4: _nc_keypad (lib_options.c:262)
==23273== by 0x808035F: keypad (lib_options.c:129)
==23273== by 0x8066340: init_dialog (util.c:330)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 1,008 bytes in 84 blocks are still reachable in loss record 49 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x807F119: _nc_add_to_try (add_tries.c:77)
==23273== by 0x80885C6: _nc_init_keytry (init_keytry.c:74)
==23273== by 0x80807F4: _nc_keypad (lib_options.c:262)
==23273== by 0x808035F: keypad (lib_options.c:129)
==23273== by 0x8066340: init_dialog (util.c:330)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 1,338 bytes in 1 blocks are still reachable in loss record 50 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8084DF7: read_termtype (read_entry.c:193)
==23273== by 0x8085B64: _nc_read_file_entry (read_entry.c:392)
==23273== by 0x8085BF5: _nc_read_tic_entry (read_entry.c:413)
==23273== by 0x8085C8A: _nc_read_terminfo_dirs (read_entry.c:438)
==23273== by 0x8085E90: _nc_read_entry (read_entry.c:500)
==23273== by 0x8081834: grab_entry (lib_setup.c:255)
==23273== by 0x8081D46: setupterm (lib_setup.c:438)
==23273== by 0x8072292: newterm (lib_newterm.c:115)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273==
==23273==
==23273== 1,382 bytes in 7 blocks are still reachable in loss record 51 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8068E64: dlg_strclone (util.c:1740)
==23273== by 0x805FE72: same_cache2 (inputstr.c:212)
==23273== by 0x805FFCE: dlg_index_columns (inputstr.c:397)
==23273== by 0x8066A0A: dlg_print_line (util.c:668)
==23273== by 0x8066E40: justify_text (util.c:813)
==23273== by 0x8066F5E: dlg_print_autowrap (util.c:843)
==23273== by 0x806703E: dlg_print_scrolled (util.c:892)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273==
==23273==
==23273== 1,520 bytes in 1 blocks are still reachable in loss record 52 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x80747CF: _nc_setupscreen (lib_set_term.c:221)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 1,640 bytes in 1 blocks are still reachable in loss record 53 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8087007: _nc_hash_map (hashmap.c:277)
==23273== by 0x80865F4: _nc_scroll_optimize (hardscroll.c:199)
==23273== by 0x807A762: doupdate (tty_update.c:778)
==23273== by 0x8073C0A: wrefresh (lib_refresh.c:58)
==23273== by 0x806D95D: _nc_wgetch (lib_getch.c:295)
==23273== by 0x806DD0D: wgetch (lib_getch.c:467)
==23273== by 0x80654FC: really_getch (ui_getc.c:352)
==23273== by 0x806566B: dlg_getc (ui_getc.c:423)
==23273== by 0x80627C4: mouse_wgetch (mousewget.c:35)
==23273==
==23273==
==23273== 1,684 bytes in 1 blocks are still reachable in loss record 54 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x805FDE1: same_cache2 (inputstr.c:201)
==23273== by 0x805FFCE: dlg_index_columns (inputstr.c:397)
==23273== by 0x8060166: dlg_count_columns (inputstr.c:473)
==23273== by 0x8066FD3: dlg_print_scrolled (util.c:886)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 1,803 bytes in 8 blocks are still reachable in loss record 55 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8068E64: dlg_strclone (util.c:1740)
==23273== by 0x805FE72: same_cache2 (inputstr.c:212)
==23273== by 0x805FEE7: dlg_index_wchars (inputstr.c:342)
==23273== by 0x8066A18: dlg_print_line (util.c:669)
==23273== by 0x8066E40: justify_text (util.c:813)
==23273== by 0x8066F5E: dlg_print_autowrap (util.c:843)
==23273== by 0x806703E: dlg_print_scrolled (util.c:892)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273==
==23273==
==23273== 1,892 bytes in 1 blocks are still reachable in loss record 56 of 62
==23273== at 0x4023E8C: realloc (vg_replace_malloc.c:429)
==23273== by 0x807F2A9: _nc_doalloc (doalloc.c:50)
==23273== by 0x80853BA: read_termtype (read_entry.c:285)
==23273== by 0x8085B64: _nc_read_file_entry (read_entry.c:392)
==23273== by 0x8085BF5: _nc_read_tic_entry (read_entry.c:413)
==23273== by 0x8085C8A: _nc_read_terminfo_dirs (read_entry.c:438)
==23273== by 0x8085E90: _nc_read_entry (read_entry.c:500)
==23273== by 0x8081834: grab_entry (lib_setup.c:255)
==23273== by 0x8081D46: setupterm (lib_setup.c:438)
==23273== by 0x8072292: newterm (lib_newterm.c:115)
==23273==
==23273==
==23273== 2,800 bytes in 1 blocks are still reachable in loss record 57 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x8085F59: _nc_set_buffer (setbuf.c:119)
==23273== by 0x807481F: _nc_setupscreen (lib_set_term.c:232)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 5,528 bytes in 7 blocks are still reachable in loss record 58 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x805FDE1: same_cache2 (inputstr.c:201)
==23273== by 0x805FFCE: dlg_index_columns (inputstr.c:397)
==23273== by 0x8066A0A: dlg_print_line (util.c:668)
==23273== by 0x8066E40: justify_text (util.c:813)
==23273== by 0x8066F5E: dlg_print_autowrap (util.c:843)
==23273== by 0x806703E: dlg_print_scrolled (util.c:892)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 7,212 bytes in 8 blocks are still reachable in loss record 59 of 62
==23273== at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==23273== by 0x805FDE1: same_cache2 (inputstr.c:201)
==23273== by 0x805FEE7: dlg_index_wchars (inputstr.c:342)
==23273== by 0x8066A18: dlg_print_line (util.c:669)
==23273== by 0x8066E40: justify_text (util.c:813)
==23273== by 0x8066F5E: dlg_print_autowrap (util.c:843)
==23273== by 0x806703E: dlg_print_scrolled (util.c:892)
==23273== by 0x806A30C: dialog_yesno (yesno.c:104)
==23273== by 0x804A728: call_yesno (dialog.c:600)
==23273== by 0x804CC56: main (dialog.c:1679)
==23273==
==23273==
==23273== 12,800 bytes in 40 blocks are still reachable in loss record 60 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x80729EC: newwin (lib_newwin.c:130)
==23273== by 0x8074F9A: _nc_setupscreen (lib_set_term.c:459)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 12,800 bytes in 40 blocks are still reachable in loss record 61 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x80729EC: newwin (lib_newwin.c:130)
==23273== by 0x8074CB3: _nc_setupscreen (lib_set_term.c:414)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273==
==23273== 12,800 bytes in 40 blocks are still reachable in loss record 62 of 62
==23273== at 0x4021E22: calloc (vg_replace_malloc.c:397)
==23273== by 0x80729EC: newwin (lib_newwin.c:130)
==23273== by 0x8074C55: _nc_setupscreen (lib_set_term.c:410)
==23273== by 0x80723F1: newterm (lib_newterm.c:146)
==23273== by 0x806E82C: initscr (lib_initscr.c:83)
==23273== by 0x8066211: init_dialog (util.c:292)
==23273== by 0x804C880: main (dialog.c:1604)
==23273==
==23273== LEAK SUMMARY:
==23273== definitely lost: 0 bytes in 0 blocks.
==23273== possibly lost: 0 bytes in 0 blocks.
==23273== still reachable: 72,482 bytes in 382 blocks.
==23273== suppressed: 0 bytes in 0 blocks.
--23273-- memcheck: sanity checks: 8 cheap, 2 expensive
--23273-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--23273-- memcheck: auxmaps_L1: 0 searches, 0 cmps, ratio 0:10
--23273-- memcheck: auxmaps_L2: 0 searches, 0 nodes
--23273-- memcheck: SMs: n_issued = 11 (176k, 0M)
--23273-- memcheck: SMs: n_deissued = 0 (0k, 0M)
--23273-- memcheck: SMs: max_noaccess = 65535 (1048560k, 1023M)
--23273-- memcheck: SMs: max_undefined = 0 (0k, 0M)
--23273-- memcheck: SMs: max_defined = 25 (400k, 0M)
--23273-- memcheck: SMs: max_non_DSM = 11 (176k, 0M)
--23273-- memcheck: max sec V bit nodes: 21 (1k, 0M)
--23273-- memcheck: set_sec_vbits8 calls: 130 (new: 21, updates: 109)
--23273-- memcheck: max shadow mem size: 481k, 0M
--23273-- translate: fast SP updates identified: 4,767 ( 83.0%)
--23273-- translate: generic_known SP updates identified: 612 ( 10.6%)
--23273-- translate: generic_unknown SP updates identified: 358 ( 6.2%)
--23273-- tt/tc: 11,509 tt lookups requiring 11,938 probes
--23273-- tt/tc: 11,509 fast-cache updates, 3 flushes
--23273-- transtab: new 5,099 (117,852 -> 1,563,594; ratio 132:10) [0 scs]
--23273-- transtab: dumped 0 (0 -> ??)
--23273-- transtab: discarded 9 (222 -> ??)
--23273-- scheduler: 864,676 jumps (bb entries).
--23273-- scheduler: 8/7,086 major/minor sched events.
--23273-- sanity: 9 cheap, 2 expensive checks.
--23273-- exectx: 769 lists, 102 contexts (avg 0 per list)
--23273-- exectx: 470 searches, 372 full compares (791 per 1000)
--23273-- exectx: 0 cmp2, 36 cmp4, 2,470 cmpAll
--23273-- errormgr: 69 supplist searches, 5,672 comparisons during search
--23273-- errormgr: 14 errlist searches, 36 comparisons during search

View File

@ -1,5 +1,5 @@
/* /*
* $Id: tailbox.c,v 1.61 2011/01/16 21:48:16 tom Exp $ * $Id: tailbox.c,v 1.63 2011/06/27 08:19:43 tom Exp $
* *
* tailbox.c -- implements the tail box * tailbox.c -- implements the tail box
* *
@ -284,6 +284,7 @@ dialog_tailbox(const char *title, const char *file, int height, int width, int b
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
DLG_KEYS_DATA( DLGK_BEGIN, '0' ), DLG_KEYS_DATA( DLGK_BEGIN, '0' ),
DLG_KEYS_DATA( DLGK_BEGIN, KEY_BEG ), DLG_KEYS_DATA( DLGK_BEGIN, KEY_BEG ),
@ -338,6 +339,7 @@ dialog_tailbox(const char *title, const char *file, int height, int width, int b
dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
dlg_draw_bottom_box(dialog); dlg_draw_bottom_box(dialog);
dlg_draw_title(dialog, title); dlg_draw_title(dialog, title);
dlg_draw_helpline(dialog, FALSE);
if (!bg_task) { if (!bg_task) {
buttons = dlg_exit_label(); buttons = dlg_exit_label();

View File

@ -1,5 +1,5 @@
/* /*
* $Id: textbox.c,v 1.99 2011/01/16 22:20:34 tom Exp $ * $Id: textbox.c,v 1.101 2011/06/29 09:53:03 tom Exp $
* *
* textbox.c -- implements the text box * textbox.c -- implements the text box
* *
@ -452,6 +452,7 @@ get_search_term(WINDOW *dialog, char *input, int height, int width)
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
INPUTSTR_BINDINGS, INPUTSTR_BINDINGS,
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
END_KEYS_BINDING END_KEYS_BINDING
}; };
@ -628,6 +629,7 @@ dialog_textbox(const char *title, const char *file, int height, int width)
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
DLG_KEYS_DATA( DLGK_GRID_DOWN, 'J' ), DLG_KEYS_DATA( DLGK_GRID_DOWN, 'J' ),
DLG_KEYS_DATA( DLGK_GRID_DOWN, 'j' ), DLG_KEYS_DATA( DLGK_GRID_DOWN, 'j' ),
@ -819,7 +821,10 @@ dialog_textbox(const char *title, const char *file, int height, int width)
FALSE, width); FALSE, width);
break; break;
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_exit_buttoncode(button); if (dialog_vars.nook)
result = DLG_EXIT_OK;
else
result = dlg_exit_buttoncode(button);
break; break;
case DLGK_PAGE_FIRST: case DLGK_PAGE_FIRST:
if (!obj.begin_reached) { if (!obj.begin_reached) {

View File

@ -1,5 +1,5 @@
/* /*
* $Id: timebox.c,v 1.43 2011/01/18 01:07:45 Garrett.Cooper Exp $ * $Id: timebox.c,v 1.45 2011/06/27 08:20:22 tom Exp $
* *
* timebox.c -- implements the timebox dialog * timebox.c -- implements the timebox dialog
* *
@ -148,6 +148,7 @@ dialog_timebox(const char *title,
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
DLG_KEYS_DATA( DLGK_DELETE_RIGHT,KEY_DC ), DLG_KEYS_DATA( DLGK_DELETE_RIGHT,KEY_DC ),
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
DLG_KEYS_DATA( DLGK_ENTER, ' ' ), DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
DLG_KEYS_DATA( DLGK_FIELD_FIRST,KEY_HOME ), DLG_KEYS_DATA( DLGK_FIELD_FIRST,KEY_HOME ),
@ -223,6 +224,7 @@ dialog_timebox(const char *title,
dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
dlg_draw_bottom_box(dialog); dlg_draw_bottom_box(dialog);
dlg_draw_title(dialog, title); dlg_draw_title(dialog, title);
dlg_draw_helpline(dialog, FALSE);
wattrset(dialog, dialog_attr); wattrset(dialog, dialog_attr);
dlg_print_autowrap(dialog, prompt, height, width); dlg_print_autowrap(dialog, prompt, height, width);

View File

@ -1,5 +1,5 @@
/* /*
* $Id: trace.c,v 1.12 2011/01/13 01:36:34 tom Exp $ * $Id: trace.c,v 1.14 2011/06/21 21:12:56 tom Exp $
* *
* trace.c -- implements screen-dump and keystroke-logging * trace.c -- implements screen-dump and keystroke-logging
* *
@ -119,6 +119,7 @@ dlg_trace_chr(int ch, int fkey)
CASE(DLGK_BEGIN); CASE(DLGK_BEGIN);
CASE(DLGK_FINAL); CASE(DLGK_FINAL);
CASE(DLGK_SELECT); CASE(DLGK_SELECT);
CASE(DLGK_HELPFILE);
CASE(DLGK_TRACE); CASE(DLGK_TRACE);
} }
} }
@ -144,6 +145,7 @@ dlg_trace(const char *fname)
myFP = fopen(fname, "a"); myFP = fopen(fname, "a");
if (myFP != 0) { if (myFP != 0) {
dlg_trace_time("** opened at"); dlg_trace_time("** opened at");
dlg_trace_msg("** dialog %s\n", dialog_version());
} }
} }
} else if (myFP != 0) { } else if (myFP != 0) {

174
ui_getc.c
View File

@ -1,5 +1,5 @@
/* /*
* $Id: ui_getc.c,v 1.59 2011/02/28 10:56:15 tom Exp $ * $Id: ui_getc.c,v 1.63 2011/07/07 22:05:58 tom Exp $
* *
* ui_getc.c - user interface glue for getc() * ui_getc.c - user interface glue for getc()
* *
@ -385,6 +385,9 @@ prev_callback(DIALOG_CALLBACK * p)
return p; return p;
} }
#define isBeforeChr(chr) ((chr) == before_chr && !before_fkey)
#define isBeforeFkey(chr) ((chr) == before_chr && before_fkey)
/* /*
* Read a character from the given window. Handle repainting here (to simplify * Read a character from the given window. Handle repainting here (to simplify
* things in the calling application). Also, if input-callback(s) are set up, * things in the calling application). Also, if input-callback(s) are set up,
@ -396,7 +399,8 @@ dlg_getc(WINDOW *win, int *fkey)
{ {
WINDOW *save_win = win; WINDOW *save_win = win;
int ch = ERR; int ch = ERR;
int before_lookup; int before_chr;
int before_fkey;
int result; int result;
bool done = FALSE; bool done = FALSE;
bool literal = FALSE; bool literal = FALSE;
@ -411,6 +415,8 @@ dlg_getc(WINDOW *win, int *fkey)
wtimeout(win, interval); wtimeout(win, interval);
while (!done) { while (!done) {
bool handle_others = FALSE;
/* /*
* If there was no pending file-input, check the keyboard. * If there was no pending file-input, check the keyboard.
*/ */
@ -420,80 +426,108 @@ dlg_getc(WINDOW *win, int *fkey)
continue; continue;
} }
before_lookup = ch; before_chr = ch;
before_fkey = *fkey;
ch = dlg_lookup_key(win, ch, fkey); ch = dlg_lookup_key(win, ch, fkey);
dlg_trace_chr(ch, *fkey); dlg_trace_chr(ch, *fkey);
current = time((time_t *) 0); current = time((time_t *) 0);
switch (ch) { /*
case CHR_LITERAL: * If we acquired a fkey value, then it is one of dialog's builtin
if (!literal) { * codes such as DLGK_HELPFILE.
literal = TRUE; */
keypad(win, FALSE); if (!*fkey || *fkey != before_fkey) {
continue; switch (ch) {
} case CHR_LITERAL:
break; if (!literal) {
case CHR_REPAINT: literal = TRUE;
(void) touchwin(win); keypad(win, FALSE);
(void) wrefresh(curscr); continue;
break;
case ERR: /* wtimeout() in effect; check for file I/O */
if (interval > 0
&& current >= expired) {
dlg_exiterr("timeout");
}
if (!valid_file(stdin)
|| !valid_file(dialog_state.screen_output)) {
ch = ESC;
done = TRUE;
} else if (check_inputs()) {
if (handle_inputs(win))
dlg_raise_window(win);
else
done = TRUE;
} else {
done = (interval <= 0);
}
break;
case DLGK_FIELD_PREV:
/* FALLTHRU */
case KEY_BTAB:
/* FALLTHRU */
case DLGK_FIELD_NEXT:
/* FALLTHRU */
case TAB:
/* Handle tab/backtab as a special case for traversing between the
* nominal "current" window, and other windows having callbacks.
* If the nominal (control) window closes, we'll close the windows
* with callbacks.
*/
if (dialog_state.getc_callbacks != 0 &&
(before_lookup == TAB ||
before_lookup == KEY_BTAB)) {
if (before_lookup == TAB)
p = next_callback(p);
else
p = prev_callback(p);
if ((dialog_state.getc_redirect = p) != 0) {
win = p->win;
} else {
win = save_win;
} }
dlg_raise_window(win);
break; break;
} case CHR_REPAINT:
/* FALLTHRU */ (void) touchwin(win);
default: (void) wrefresh(curscr);
break;
case ERR: /* wtimeout() in effect; check for file I/O */
if (interval > 0
&& current >= expired) {
dlg_exiterr("timeout");
}
if (!valid_file(stdin)
|| !valid_file(dialog_state.screen_output)) {
ch = ESC;
done = TRUE;
} else if (check_inputs()) {
if (handle_inputs(win))
dlg_raise_window(win);
else
done = TRUE;
} else {
done = (interval <= 0);
}
break;
case DLGK_HELPFILE:
if (dialog_vars.help_file) {
int yold, xold;
getyx(win, yold, xold);
dialog_helpfile("HELP", dialog_vars.help_file, 0, 0);
dlg_raise_window(win);
wmove(win, yold, xold);
}
continue;
case DLGK_FIELD_PREV:
/* FALLTHRU */
case KEY_BTAB:
/* FALLTHRU */
case DLGK_FIELD_NEXT:
/* FALLTHRU */
case TAB:
/* Handle tab/backtab as a special case for traversing between
* the nominal "current" window, and other windows having
* callbacks. If the nominal (control) window closes, we'll
* close the windows with callbacks.
*/
if (dialog_state.getc_callbacks != 0 &&
(isBeforeChr(TAB) ||
isBeforeFkey(KEY_BTAB))) {
p = (isBeforeChr(TAB)
? next_callback(p)
: prev_callback(p));
if ((dialog_state.getc_redirect = p) != 0) {
win = p->win;
} else {
win = save_win;
}
dlg_raise_window(win);
break;
}
/* FALLTHRU */
default:
#ifdef NO_LEAKS #ifdef NO_LEAKS
if (before_lookup == DLG_CTRL('P')) { if (isBeforeChr(DLG_CTRL('P'))) {
/* for testing, ^P closes the connection */ /* for testing, ^P closes the connection */
close(0); close(0);
close(1); close(1);
close(2); close(2);
break; break;
} }
#endif #endif
handle_others = TRUE;
break;
#ifdef HAVE_DLG_TRACE
case CHR_TRACE:
dlg_trace_win(win);
break;
#endif
}
} else {
handle_others = TRUE;
}
if (handle_others) {
if ((p = dialog_state.getc_redirect) != 0) { if ((p = dialog_state.getc_redirect) != 0) {
if (!(p->handle_getc(p, ch, *fkey, &result))) { if (!(p->handle_getc(p, ch, *fkey, &result))) {
dlg_remove_callback(p); dlg_remove_callback(p);
@ -503,12 +537,6 @@ dlg_getc(WINDOW *win, int *fkey)
} else { } else {
done = TRUE; done = TRUE;
} }
break;
#ifdef HAVE_DLG_TRACE
case CHR_TRACE:
dlg_trace_win(win);
break;
#endif
} }
} }
if (literal) if (literal)

433
util.c
View File

@ -1,5 +1,5 @@
/* /*
* $Id: util.c,v 1.211 2011/01/19 00:31:43 tom Exp $ * $Id: util.c,v 1.227 2011/07/07 23:42:30 tom Exp $
* *
* util.c -- miscellaneous utilities for dialog * util.c -- miscellaneous utilities for dialog
* *
@ -37,6 +37,20 @@
#endif #endif
#endif #endif
#if defined(HAVE_WCHGAT)
# if defined(NCURSES_VERSION_PATCH)
# if NCURSES_VERSION_PATCH >= 20060715
# define USE_WCHGAT 1
# else
# define USE_WCHGAT 0
# endif
# else
# define USE_WCHGAT 1
# endif
#else
# define USE_WCHGAT 0
#endif
/* globals */ /* globals */
DIALOG_STATE dialog_state; DIALOG_STATE dialog_state;
DIALOG_VARS dialog_vars; DIALOG_VARS dialog_vars;
@ -61,6 +75,8 @@ DIALOG_VARS dialog_vars;
#define DATA(atr,upr,lwr,cmt) { atr COLOR_DATA(upr) RC_DATA(lwr,cmt) } #define DATA(atr,upr,lwr,cmt) { atr COLOR_DATA(upr) RC_DATA(lwr,cmt) }
#define UseShadow(dw) ((dw) != 0 && (dw)->normal != 0 && (dw)->shadow != 0)
/* /*
* Table of color and attribute values, default is for mono display. * Table of color and attribute values, default is for mono display.
*/ */
@ -411,7 +427,7 @@ dlg_get_attrs(WINDOW *win)
{ {
chtype result; chtype result;
#ifdef HAVE_GETATTRS #ifdef HAVE_GETATTRS
result = getattrs(win); result = (chtype) getattrs(win);
#else #else
attr_t my_result; attr_t my_result;
short my_pair; short my_pair;
@ -487,6 +503,7 @@ end_dialog(void)
} }
} }
#define ESCAPE_LEN 3
#define isOurEscape(p) (((p)[0] == '\\') && ((p)[1] == 'Z') && ((p)[2] != 0)) #define isOurEscape(p) (((p)[0] == '\\') && ((p)[1] == 'Z') && ((p)[2] != 0))
static int static int
@ -500,7 +517,7 @@ centered(int width, const char *string)
if (dialog_vars.colors) { if (dialog_vars.colors) {
for (n = 0; n < len; ++n) { for (n = 0; n < len; ++n) {
if (isOurEscape(string + n)) { if (isOurEscape(string + n)) {
hide += 3; hide += ESCAPE_LEN;
} }
} }
} }
@ -661,6 +678,7 @@ dlg_print_line(WINDOW *win,
{ {
const char *wrap_ptr = prompt; const char *wrap_ptr = prompt;
const char *test_ptr = prompt; const char *test_ptr = prompt;
const char *hide_ptr = 0;
const int *cols = dlg_index_columns(prompt); const int *cols = dlg_index_columns(prompt);
const int *indx = dlg_index_wchars(prompt); const int *indx = dlg_index_wchars(prompt);
int wrap_inx = 0; int wrap_inx = 0;
@ -687,8 +705,9 @@ dlg_print_line(WINDOW *win,
wrap_inx = n; wrap_inx = n;
*x = cur_x; *x = cur_x;
} else if (isOurEscape(test_ptr)) { } else if (isOurEscape(test_ptr)) {
hidden += 3; hide_ptr = test_ptr;
n += 2; hidden += ESCAPE_LEN;
n += (ESCAPE_LEN - 1);
} }
cur_x = lm + tabbed + cols[n + 1]; cur_x = lm + tabbed + cols[n + 1];
if (cur_x > (rm + hidden)) if (cur_x > (rm + hidden))
@ -724,6 +743,23 @@ dlg_print_line(WINDOW *win,
} }
#endif #endif
/*
* If we found hidden text past the last point that we will display,
* discount that from the displayed length.
*/
if ((hide_ptr != 0) && (hide_ptr >= wrap_ptr)) {
hidden -= ESCAPE_LEN;
test_ptr = wrap_ptr;
while (test_ptr < wrap_ptr) {
if (isOurEscape(test_ptr)) {
hidden -= ESCAPE_LEN;
test_ptr += ESCAPE_LEN;
} else {
++test_ptr;
}
}
}
/* /*
* Print the line if we have a window pointer. Otherwise this routine * Print the line if we have a window pointer. Otherwise this routine
* is just being called for sizing the window. * is just being called for sizing the window.
@ -736,6 +772,8 @@ dlg_print_line(WINDOW *win,
if (*x == 1) if (*x == 1)
*x = rm; *x = rm;
*x -= hidden;
/* Find the start of the next line and return a pointer to it */ /* Find the start of the next line and return a pointer to it */
test_ptr = wrap_ptr; test_ptr = wrap_ptr;
while (*test_ptr == ' ') while (*test_ptr == ' ')
@ -863,43 +901,49 @@ dlg_print_scrolled(WINDOW *win,
high = len; high = len;
#endif #endif
dummy = newwin(high, width, 0, 0); dummy = newwin(high, width, 0, 0);
wbkgdset(dummy, dialog_attr | ' '); if (dummy == 0) {
wattrset(dummy, dialog_attr); wattrset(win, dialog_attr);
werase(dummy); dlg_print_autowrap(win, prompt, height + 1 + (3 * MARGIN), width);
dlg_print_autowrap(dummy, prompt, high, width); last = 0;
getyx(dummy, y, x); } else {
wbkgdset(dummy, dialog_attr | ' ');
wattrset(dummy, dialog_attr);
werase(dummy);
dlg_print_autowrap(dummy, prompt, high, width);
getyx(dummy, y, x);
copywin(dummy, /* srcwin */ copywin(dummy, /* srcwin */
win, /* dstwin */ win, /* dstwin */
offset + MARGIN, /* sminrow */ offset + MARGIN, /* sminrow */
MARGIN, /* smincol */ MARGIN, /* smincol */
MARGIN, /* dminrow */ MARGIN, /* dminrow */
MARGIN, /* dmincol */ MARGIN, /* dmincol */
height, /* dmaxrow */ height, /* dmaxrow */
wide, /* dmaxcol */ wide, /* dmaxcol */
FALSE); FALSE);
delwin(dummy); delwin(dummy);
/* if the text is incomplete, or we have scrolled, show the percentage */ /* if the text is incomplete, or we have scrolled, show the percentage */
if (y > 0 && wide > 4) { if (y > 0 && wide > 4) {
percent = (int) ((height + offset) * 100.0 / y); percent = (int) ((height + offset) * 100.0 / y);
if (percent < 0) if (percent < 0)
percent = 0; percent = 0;
if (percent > 100) if (percent > 100)
percent = 100; percent = 100;
if (offset != 0 || percent != 100) { if (offset != 0 || percent != 100) {
(void) wattrset(win, position_indicator_attr); (void) wattrset(win, position_indicator_attr);
(void) wmove(win, MARGIN + height, wide - 4); (void) wmove(win, MARGIN + height, wide - 4);
(void) sprintf(buffer, "%d%%", percent); (void) sprintf(buffer, "%d%%", percent);
(void) waddstr(win, buffer); (void) waddstr(win, buffer);
if ((len = (int) strlen(buffer)) < 4) { if ((len = (int) strlen(buffer)) < 4) {
wattrset(win, border_attr); wattrset(win, border_attr);
whline(win, dlg_boxchar(ACS_HLINE), 4 - len); whline(win, dlg_boxchar(ACS_HLINE), 4 - len);
}
} }
} }
last = (y - height);
} }
last = (y - height);
} else } else
#endif #endif
{ {
@ -1037,6 +1081,25 @@ longest_word(const char *string)
return result; return result;
} }
static int
count_real_columns(const char *text)
{
int result = dlg_count_columns(text);
if (result && dialog_vars.colors) {
int hidden = 0;
while (*text) {
if (isOurEscape(text)) {
hidden += ESCAPE_LEN;
text += ESCAPE_LEN;
} else {
++text;
}
}
result -= hidden;
}
return result;
}
/* /*
* if (height or width == -1) Maximize() * if (height or width == -1) Maximize()
* if (height or width == 0), justify and return actual limits. * if (height or width == 0), justify and return actual limits.
@ -1074,7 +1137,7 @@ real_auto_size(const char *title,
} else if (prompt != 0) { } else if (prompt != 0) {
wide = MAX(title_length, mincols); wide = MAX(title_length, mincols);
if (strchr(prompt, '\n') == 0) { if (strchr(prompt, '\n') == 0) {
double val = dialog_state.aspect_ratio * dlg_count_columns(prompt); double val = dialog_state.aspect_ratio * count_real_columns(prompt);
double xxx = sqrt(val); double xxx = sqrt(val);
int tmp = (int) xxx; int tmp = (int) xxx;
wide = MAX(wide, tmp); wide = MAX(wide, tmp);
@ -1190,6 +1253,27 @@ dlg_auto_sizefile(const char *title,
(void) fclose(fd); (void) fclose(fd);
} }
static chtype
dlg_get_cell_attrs(WINDOW *win)
{
chtype result;
#ifdef USE_WIDE_CURSES
cchar_t wch;
wchar_t cc;
attr_t attrs;
short pair;
if (win_wch(win, &wch) == OK
&& getcchar(&wch, &cc, &attrs, &pair, NULL) == OK) {
result = attrs;
} else {
result = 0;
}
#else
result = winch(win) & (A_ATTRIBUTES & ~A_COLOR);
#endif
return result;
}
/* /*
* Draw a rectangular box with line drawing characters. * Draw a rectangular box with line drawing characters.
* *
@ -1239,53 +1323,220 @@ dlg_draw_box(WINDOW *win, int y, int x, int height, int width,
wattrset(win, save); wattrset(win, save);
} }
static DIALOG_WINDOWS *
find_window(WINDOW *win)
{
DIALOG_WINDOWS *result = 0;
DIALOG_WINDOWS *p;
for (p = dialog_state.all_windows; p != 0; p = p->next) {
if (p->normal == win) {
result = p;
break;
}
}
return result;
}
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
/*
* If we have wchgat(), use that for updating shadow attributes, to work with
* wide-character data.
*/
/*
* Check if the given point is "in" the given window. If so, return the window
* pointer, otherwise null.
*/
static WINDOW *
in_window(WINDOW *win, int y, int x)
{
WINDOW *result = 0;
int y_base = getbegy(win);
int x_base = getbegx(win);
int y_last = getmaxy(win) + y_base;
int x_last = getmaxx(win) + x_base;
if (y >= y_base && y <= y_last && x >= x_base && x <= x_last)
result = win;
return result;
}
static WINDOW *
window_at_cell(DIALOG_WINDOWS * dw, int y, int x)
{
WINDOW *result = 0;
DIALOG_WINDOWS *p;
int y_want = y + getbegy(dw->shadow);
int x_want = x + getbegx(dw->shadow);
for (p = dialog_state.all_windows; p != 0; p = p->next) {
if (dw->normal != p->normal
&& dw->shadow != p->normal
&& (result = in_window(p->normal, y_want, x_want)) != 0) {
break;
}
}
if (result == 0) {
result = stdscr;
}
return result;
}
static bool
in_shadow(WINDOW *normal, WINDOW *shadow, int y, int x)
{
bool result = FALSE;
int ybase = getbegy(normal);
int ylast = getmaxy(normal) + ybase;
int xbase = getbegx(normal);
int xlast = getmaxx(normal) + xbase;
y += getbegy(shadow);
x += getbegx(shadow);
if (y >= ybase + SHADOW_ROWS
&& y < ylast + SHADOW_ROWS
&& x >= xlast
&& x < xlast + SHADOW_COLS) {
/* in the right-side */
result = TRUE;
} else if (y >= ylast
&& y < ylast + SHADOW_ROWS
&& x >= ybase + SHADOW_COLS
&& x < ylast + SHADOW_COLS) {
/* check the bottom */
result = TRUE;
}
return result;
}
/*
* When erasing a shadow, check each cell to make sure that it is not part of
* another box's shadow. This is a little complicated since most shadows are
* merged onto stdscr.
*/
static bool
last_shadow(DIALOG_WINDOWS * dw, int y, int x)
{
DIALOG_WINDOWS *p;
bool result = TRUE;
for (p = dialog_state.all_windows; p != 0; p = p->next) {
if (p->normal != dw->normal
&& in_shadow(p->normal, dw->shadow, y, x)) {
result = FALSE;
break;
}
}
return result;
}
static void
repaint_cell(DIALOG_WINDOWS * dw, bool draw, int y, int x)
{
WINDOW *win = dw->shadow;
WINDOW *cellwin;
int y2, x2;
if ((cellwin = window_at_cell(dw, y, x)) != 0
&& (draw || last_shadow(dw, y, x))
&& (y2 = (y + getbegy(win) - getbegy(cellwin))) >= 0
&& (x2 = (x + getbegx(win) - getbegx(cellwin))) >= 0
&& wmove(cellwin, y2, x2) != ERR) {
chtype the_cell = dlg_get_attrs(cellwin);
chtype the_attr = (draw ? shadow_attr : the_cell);
if (dlg_get_cell_attrs(cellwin) & A_ALTCHARSET) {
the_attr |= A_ALTCHARSET;
}
#if USE_WCHGAT
wchgat(cellwin, 1,
the_attr & (chtype) (~A_COLOR),
PAIR_NUMBER(the_attr),
NULL);
#else
{
chtype the_char = ((winch(cellwin) & A_CHARTEXT) | the_attr);
(void) waddch(cellwin, the_char);
}
#endif
wnoutrefresh(cellwin);
}
}
#define RepaintCell(dw, draw, y, x) repaint_cell(dw, draw, y, x)
static void
repaint_shadow(DIALOG_WINDOWS * dw, bool draw, int y, int x, int height, int width)
{
int i, j;
if (UseShadow(dw)) {
#if !USE_WCHGAT
chtype save = dlg_get_attrs(dw->shadow);
wattrset(dw->shadow, draw ? shadow_attr : screen_attr);
#endif
for (i = 0; i < SHADOW_ROWS; ++i) {
for (j = 0; j < width; ++j) {
RepaintCell(dw, draw, i + y + height, j + x + SHADOW_COLS);
}
}
for (i = 0; i < height; i++) {
for (j = 0; j < SHADOW_COLS; ++j) {
RepaintCell(dw, draw, i + y + SHADOW_ROWS, j + x + width);
}
}
(void) wnoutrefresh(dw->shadow);
#if !USE_WCHGAT
wattrset(dw->shadow, save);
#endif
}
}
/* /*
* Draw a shadow on the parent window corresponding to the right- and * Draw a shadow on the parent window corresponding to the right- and
* bottom-edge of the child window, to give a 3-dimensional look. * bottom-edge of the child window, to give a 3-dimensional look.
*/ */
static void static void
draw_childs_shadow(WINDOW *parent, WINDOW *child) draw_childs_shadow(DIALOG_WINDOWS * dw)
{ {
if (has_colors()) { /* Whether terminal supports color? */ if (UseShadow(dw)) {
chtype save = dlg_get_attrs(parent); repaint_shadow(dw,
TRUE,
getbegy(dw->normal) - getbegy(dw->shadow),
getbegx(dw->normal) - getbegx(dw->shadow),
getmaxy(dw->normal),
getmaxx(dw->normal));
}
}
dlg_draw_shadow(parent, /*
getbegy(child) - getbegy(parent), * Erase a shadow on the parent window corresponding to the right- and
getbegx(child) - getbegx(parent), * bottom-edge of the child window.
getmaxy(child), */
getmaxx(child)); static void
wattrset(parent, save); erase_childs_shadow(DIALOG_WINDOWS * dw)
{
if (UseShadow(dw)) {
repaint_shadow(dw,
FALSE,
getbegy(dw->normal) - getbegy(dw->shadow),
getbegx(dw->normal) - getbegx(dw->shadow),
getmaxy(dw->normal),
getmaxx(dw->normal));
} }
} }
/* /*
* Draw shadows along the right and bottom edge to give a more 3D look * Draw shadows along the right and bottom edge to give a more 3D look
* to the boxes * to the boxes.
*/ */
void void
dlg_draw_shadow(WINDOW *win, int y, int x, int height, int width) dlg_draw_shadow(WINDOW *win, int y, int x, int height, int width)
{ {
int i, j; repaint_shadow(find_window(win), TRUE, y, x, height, width);
if (has_colors()) { /* Whether terminal supports color? */
wattrset(win, shadow_attr);
for (i = 0; i < SHADOW_ROWS; ++i) {
for (j = 0; j < width; ++j) {
if (wmove(win, i + y + height, j + x + SHADOW_COLS) != ERR) {
(void) waddch(win, winch(win) & (chtype) (~A_COLOR));
}
}
}
for (i = 0; i < height; i++) {
for (j = 0; j < SHADOW_COLS; ++j) {
if (wmove(win, i + y + SHADOW_ROWS, j + x + width) != ERR) {
(void) waddch(win, winch(win) & (chtype) (~A_COLOR));
}
}
}
(void) wnoutrefresh(win);
}
} }
#endif /* HAVE_COLOR */ #endif /* HAVE_COLOR */
@ -1340,6 +1591,10 @@ dlg_exit(int code)
code = DLG_EXIT_HELP; code = DLG_EXIT_HELP;
goto retry; goto retry;
} }
#ifdef HAVE_DLG_TRACE
dlg_trace((const char *) 0); /* close it */
#endif
#ifdef NO_LEAKS #ifdef NO_LEAKS
_dlg_inputstr_leaks(); _dlg_inputstr_leaks();
#if defined(NCURSES_VERSION) && defined(HAVE__NC_FREE_AND_EXIT) #if defined(NCURSES_VERSION) && defined(HAVE__NC_FREE_AND_EXIT)
@ -1650,6 +1905,8 @@ dlg_del_window(WINDOW *win)
} }
if (q) { if (q) {
if (dialog_state.all_windows != 0)
erase_childs_shadow(q);
delwin(q->normal); delwin(q->normal);
dlg_unregister_window(q->normal); dlg_unregister_window(q->normal);
free(q); free(q);
@ -1663,26 +1920,13 @@ dlg_del_window(WINDOW *win)
WINDOW * WINDOW *
dlg_new_window(int height, int width, int y, int x) dlg_new_window(int height, int width, int y, int x)
{ {
WINDOW *win; return dlg_new_modal_window(stdscr, height, width, y, x);
DIALOG_WINDOWS *p = dlg_calloc(DIALOG_WINDOWS, 1);
if ((win = newwin(height, width, y, x)) == 0) {
dlg_exiterr("Can't make new window at (%d,%d), size (%d,%d).\n",
y, x, height, width);
}
p->next = dialog_state.all_windows;
p->normal = win;
dialog_state.all_windows = p;
#ifdef HAVE_COLOR
if (dialog_state.use_shadow) {
draw_childs_shadow(p->shadow = stdscr, win);
}
#endif
(void) keypad(win, TRUE);
return win;
} }
/*
* "Modal" windows differ from normal ones by having a shadow in a window
* separate from the standard screen.
*/
WINDOW * WINDOW *
dlg_new_modal_window(WINDOW *parent, int height, int width, int y, int x) dlg_new_modal_window(WINDOW *parent, int height, int width, int y, int x)
{ {
@ -1699,7 +1943,8 @@ dlg_new_modal_window(WINDOW *parent, int height, int width, int y, int x)
dialog_state.all_windows = p; dialog_state.all_windows = p;
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
if (dialog_state.use_shadow) { if (dialog_state.use_shadow) {
draw_childs_shadow(p->shadow = parent, win); p->shadow = parent;
draw_childs_shadow(p);
} }
#endif #endif
@ -1714,19 +1959,12 @@ dlg_new_modal_window(WINDOW *parent, int height, int width, int y, int x)
void void
dlg_move_window(WINDOW *win, int height, int width, int y, int x) dlg_move_window(WINDOW *win, int height, int width, int y, int x)
{ {
DIALOG_WINDOWS *p, *q; DIALOG_WINDOWS *p;
if (win != 0) { if (win != 0) {
dlg_ctl_size(height, width); dlg_ctl_size(height, width);
for (p = dialog_state.all_windows; p != 0; p = q) { if ((p = find_window(win)) != 0) {
q = p->next;
if (p->normal == win) {
break;
}
}
if (p != 0) {
(void) wresize(win, height, width); (void) wresize(win, height, width);
(void) mvwin(win, y, x); (void) mvwin(win, y, x);
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
@ -1741,8 +1979,7 @@ dlg_move_window(WINDOW *win, int height, int width, int y, int x)
(void) refresh(); (void) refresh();
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
if (p->shadow) draw_childs_shadow(p);
draw_childs_shadow(p->shadow, win);
#endif #endif
} }
} }
@ -1883,7 +2120,7 @@ dlg_trim_string(char *s)
char *base = s; char *base = s;
char *p1; char *p1;
char *p = s; char *p = s;
int has_newlines = (strstr(s, "\\n") != 0); int has_newlines = !dialog_vars.no_nl_expand && (strstr(s, "\\n") != 0);
while (*p != '\0') { while (*p != '\0') {
if (*p == TAB && !dialog_vars.nocollapse) if (*p == TAB && !dialog_vars.nocollapse)

View File

@ -1,9 +1,9 @@
/* /*
* $Id: yesno.c,v 1.49 2010/01/15 10:54:54 tom Exp $ * $Id: yesno.c,v 1.51 2011/06/27 08:20:57 tom Exp $
* *
* yesno.c -- implements the yes/no box * yesno.c -- implements the yes/no box
* *
* Copyright 1999-2009,2010 Thomas E. Dickey * Copyright 1999-2010,2011 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -35,6 +35,7 @@ dialog_yesno(const char *title, const char *cprompt, int height, int width)
{ {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static DLG_KEYS_BINDING binding[] = { static DLG_KEYS_BINDING binding[] = {
HELPKEY_BINDINGS,
ENTERKEY_BINDINGS, ENTERKEY_BINDINGS,
DLG_KEYS_DATA( DLGK_ENTER, ' ' ), DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ), DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ),
@ -89,6 +90,7 @@ dialog_yesno(const char *title, const char *cprompt, int height, int width)
dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr); dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
dlg_draw_bottom_box(dialog); dlg_draw_bottom_box(dialog);
dlg_draw_title(dialog, title); dlg_draw_title(dialog, title);
dlg_draw_helpline(dialog, FALSE);
wattrset(dialog, dialog_attr); wattrset(dialog, dialog_attr);