2
0
mirror of https://github.com/Aigor44/ncursesw-morphos.git synced 2025-01-06 14:44:25 +08:00

ncurses 5.6 - patch 20081018

+ build-fixes for OS/2 EMX.
+ modify form library to accept control characters such as newline
  in set_field_buffer(), which is compatible with Solaris (report by
  Nit Khair).
+ modify configure script to assume --without-hashed-db when
  --disable-database is used.
+ add "-e" option in ncurses/Makefile.in when generating source-files
  to force earlier exit if the build environment fails unexpectedly
  (prompted by patch by Adrian Bunk).
+ change configure script to use CF_UTF8_LIB, improved variant of
  CF_LIBUTF8.
This commit is contained in:
Thomas E. Dickey 2008-10-19 00:58:44 +00:00
parent b6bff46512
commit b5df67bc68
12 changed files with 1864 additions and 1205 deletions

15
NEWS
View File

@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.1311 2008/10/12 23:06:21 tom Exp $
-- $Id: NEWS,v 1.1316 2008/10/18 21:51:20 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -45,6 +45,19 @@ See the AUTHORS file for the corresponding full names.
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
20081018
+ build-fixes for OS/2 EMX.
+ modify form library to accept control characters such as newline
in set_field_buffer(), which is compatible with Solaris (report by
Nit Khair).
+ modify configure script to assume --without-hashed-db when
--disable-database is used.
+ add "-e" option in ncurses/Makefile.in when generating source-files
to force earlier exit if the build environment fails unexpectedly
(prompted by patch by Adrian Bunk).
+ change configure script to use CF_UTF8_LIB, improved variant of
CF_LIBUTF8.
20081012
+ add teraterm4.59 terminfo entry, use that as primary teraterm entry, rename
original to teraterm2.3 -TD

228
aclocal.m4 vendored
View File

@ -28,7 +28,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: aclocal.m4,v 1.466 2008/10/04 21:21:40 tom Exp $
dnl $Id: aclocal.m4,v 1.469 2008/10/18 21:59:42 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
@ -261,6 +261,28 @@ if test -n "$1" ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ADD_SUBDIR_PATH version: 2 updated: 2007/07/29 10:12:59
dnl ------------------
dnl Append to a search-list for a nonstandard header/lib-file
dnl $1 = the variable to return as result
dnl $2 = the package name
dnl $3 = the subdirectory, e.g., bin, include or lib
dnl $4 = the directory under which we will test for subdirectories
dnl $5 = a directory that we do not want $4 to match
AC_DEFUN([CF_ADD_SUBDIR_PATH],
[
test "$4" != "$5" && \
test -d "$4" && \
ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) {
test -n "$verbose" && echo " ... testing for $3-directories under $4"
test -d $4/$3 && $1="[$]$1 $4/$3"
test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2"
test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3"
test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3"
test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2"
}
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34
dnl ----------------
dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
@ -997,6 +1019,118 @@ AC_MSG_RESULT($cf_result)
CXXFLAGS="$cf_save_CXXFLAGS"
])
dnl ---------------------------------------------------------------------------
dnl CF_FIND_LINKAGE version: 12 updated: 2007/07/29 20:13:53
dnl ---------------
dnl Find a library (specifically the linkage used in the code fragment),
dnl searching for it if it is not already in the library path.
dnl See also CF_ADD_SEARCHPATH.
dnl
dnl Parameters (4-on are optional):
dnl $1 = headers for library entrypoint
dnl $2 = code fragment for library entrypoint
dnl $3 = the library name without the "-l" option or ".so" suffix.
dnl $4 = action to perform if successful (default: update CPPFLAGS, etc)
dnl $5 = action to perform if not successful
dnl $6 = module name, if not the same as the library name
dnl $7 = extra libraries
dnl
dnl Sets these variables:
dnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found
dnl $cf_cv_header_path_$3 - include-directory if needed
dnl $cf_cv_library_path_$3 - library-directory if needed
dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3
AC_DEFUN([CF_FIND_LINKAGE],[
# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
# will be set on completion of the AC_TRY_LINK below.
cf_cv_header_path_$3=
cf_cv_library_path_$3=
CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)])
AC_TRY_LINK([$1],[$2],
cf_cv_find_linkage_$3=yes,[
cf_cv_find_linkage_$3=no
CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
cf_save_CPPFLAGS="$CPPFLAGS"
cf_test_CPPFLAGS="$CPPFLAGS"
CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
for cf_cv_header_path_$3 in $cf_search
do
if test -d $cf_cv_header_path_$3 ; then
CF_VERBOSE(... testing $cf_cv_header_path_$3)
CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3"
AC_TRY_COMPILE([$1],[$2],[
CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
cf_cv_find_linkage_$3=maybe
cf_test_CPPFLAGS="$CPPFLAGS"
break],[
CPPFLAGS="$cf_save_CPPFLAGS"
])
fi
done
if test "$cf_cv_find_linkage_$3" = maybe ; then
CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
cf_save_LIBS="$LIBS"
cf_save_LDFLAGS="$LDFLAGS"
ifelse([$6],,,[
CPPFLAGS="$cf_test_CPPFLAGS"
LIBS="-l$3 $7 $cf_save_LIBS"
AC_TRY_LINK([$1],[$2],[
CF_VERBOSE(... found $3 library in system)
cf_cv_find_linkage_$3=yes])
CPPFLAGS="$cf_save_CPPFLAGS"
LIBS="$cf_save_LIBS"
])
if test "$cf_cv_find_linkage_$3" != yes ; then
CF_LIBRARY_PATH(cf_search,$3)
for cf_cv_library_path_$3 in $cf_search
do
if test -d $cf_cv_library_path_$3 ; then
CF_VERBOSE(... testing $cf_cv_library_path_$3)
CPPFLAGS="$cf_test_CPPFLAGS"
LIBS="-l$3 $7 $cf_save_LIBS"
LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
AC_TRY_LINK([$1],[$2],[
CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
cf_cv_find_linkage_$3=yes
cf_cv_library_file_$3="-l$3"
break],[
CPPFLAGS="$cf_save_CPPFLAGS"
LIBS="$cf_save_LIBS"
LDFLAGS="$cf_save_LDFLAGS"
])
fi
done
LIBS="$cf_save_LIBS"
CPPFLAGS="$cf_save_CPPFLAGS"
LDFLAGS="$cf_save_LDFLAGS"
fi
else
cf_cv_find_linkage_$3=no
fi
],$7)
if test "$cf_cv_find_linkage_$3" = yes ; then
ifelse([$4],,[
CF_ADD_INCDIR($cf_cv_header_path_$3)
CF_ADD_LIBDIR($cf_cv_library_path_$3)
LIBS="-l$3 $LIBS"
],[$4])
else
ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_FUNC_DLSYM version: 1 updated: 2004/06/16 20:52:45
dnl -------------
dnl Test for dlsym() and related functions, as well as libdl.
@ -1862,6 +1996,27 @@ $ac_includes_default
])
done
])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59
dnl --------------
dnl Construct a search-list for a nonstandard header-file
AC_DEFUN([CF_HEADER_PATH],
[CF_SUBDIR_PATH($1,$2,include)
test "$includedir" != NONE && \
test "$includedir" != "/usr/include" && \
test -d "$includedir" && {
test -d $includedir && $1="[$]$1 $includedir"
test -d $includedir/$2 && $1="[$]$1 $includedir/$2"
}
test "$oldincludedir" != NONE && \
test "$oldincludedir" != "/usr/include" && \
test -d "$oldincludedir" && {
test -d $oldincludedir && $1="[$]$1 $oldincludedir"
test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
}
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
@ -1988,7 +2143,7 @@ ifdef([AC_FUNC_FSEEKO],[
])
])
dnl ---------------------------------------------------------------------------
dnl CF_LDFLAGS_STATIC version: 3 updated: 2008/07/05 13:56:40
dnl CF_LDFLAGS_STATIC version: 4 updated: 2008/10/18 17:58:20
dnl -----------------
dnl Check for compiler/linker flags used to temporarily force usage of static
dnl libraries. This depends on the compiler and platform. Use this to help
@ -1998,7 +2153,7 @@ AC_DEFUN([CF_LDFLAGS_STATIC],[
if test "$GCC" = yes ; then
case $cf_cv_system_name in #(
aix[[45]]*) #( gcc 4.2.4 linkage on AIX is broken
OS/2*|os2*|aix[[45]]*) #( vi
LDFLAGS_STATIC=
LDFLAGS_SHARED=
;;
@ -2038,26 +2193,11 @@ AC_SUBST(LDFLAGS_STATIC)
AC_SUBST(LDFLAGS_SHARED)
])
dnl ---------------------------------------------------------------------------
dnl CF_LIBUTF8 version: 2 updated: 2002/01/19 22:51:32
dnl ----------
dnl Check for libutf8
AC_DEFUN([CF_LIBUTF8],
[
AC_CACHE_CHECK(for putwc in libutf8,cf_cv_libutf8,[
cf_save_LIBS="$LIBS"
LIBS="-lutf8 $LIBS"
AC_TRY_LINK([
#include <libutf8.h>],[putwc(0,0);],
[cf_cv_libutf8=yes],
[cf_cv_libutf8=no])
LIBS="$cf_save_LIBS"
])
if test "$cf_cv_libutf8" = yes ; then
AC_DEFINE(HAVE_LIBUTF8_H)
LIBS="-lutf8 $LIBS"
fi
])dnl
dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59
dnl ---------------
dnl Construct a search-list for a nonstandard library-file
AC_DEFUN([CF_LIBRARY_PATH],
[CF_SUBDIR_PATH($1,$2,lib)])dnl
dnl ---------------------------------------------------------------------------
dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16
dnl -------------
@ -4706,6 +4846,22 @@ if test "$ac_cv_header_termios_h" = yes ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SUBDIR_PATH version: 5 updated: 2007/07/29 09:55:12
dnl --------------
dnl Construct a search-list for a nonstandard header/lib-file
dnl $1 = the variable to return as result
dnl $2 = the package name
dnl $3 = the subdirectory, e.g., bin, include or lib
AC_DEFUN([CF_SUBDIR_PATH],
[$1=""
CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix)
CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix)
CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix)
CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SUBST version: 4 updated: 2006/06/17 12:33:03
dnl --------
dnl Shorthand macro for substituting things that the user may override
@ -4892,6 +5048,32 @@ AC_DEFUN([CF_UPPER],
$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_UTF8_LIB version: 5 updated: 2008/10/17 19:37:52
dnl -----------
dnl Check for multibyte support, and if not found, utf8 compatibility library
AC_DEFUN([CF_UTF8_LIB],
[
AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
cf_save_LIBS="$LIBS"
AC_TRY_LINK([
#include <stdlib.h>],[putwc(0,0);],
[cf_cv_utf8_lib=yes],
[CF_FIND_LINKAGE([
#include <libutf8.h>],[putwc(0,0);],utf8,
[cf_cv_utf8_lib=add-on],
[cf_cv_utf8_lib=no])
])])
# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
# ncurses/ncursesw:
if test "$cf_cv_utf8_lib" = "add-on" ; then
AC_DEFINE(HAVE_LIBUTF8_H)
CF_ADD_INCDIR($cf_cv_header_path_utf8)
CF_ADD_LIBDIR($cf_cv_library_path_utf8)
LIBS="-lutf8 $LIBS"
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
dnl ----------
dnl Use AC_VERBOSE w/o the warnings

2564
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -28,14 +28,14 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: configure.in,v 1.452 2008/10/11 16:02:56 tom Exp $
dnl $Id: configure.in,v 1.454 2008/10/18 14:53:32 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl See http://invisible-island.net/autoconf/ for additional information.
dnl
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.13.20020210)
AC_REVISION($Revision: 1.452 $)
AC_REVISION($Revision: 1.454 $)
AC_INIT(ncurses/base/lib_initscr.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
@ -423,6 +423,8 @@ if test "$use_database" != no ; then
[ --with-hashed-db specify hashed-database library],,
[with_hashed_db=no])
AC_MSG_RESULT($with_hashed_db)
else
with_hashed_db=no
fi
AC_MSG_CHECKING(for list of fallback descriptions)
@ -679,8 +681,8 @@ if test "$with_widec" = yes ; then
NCURSES_CH_T=cchar_t
AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs)
if test "$ac_cv_func_putwc" != yes ; then
CF_LIBUTF8
if test "$cf_cv_libutf8" = yes ; then
CF_UTF8_LIB
if test "$cf_cv_utf8_lib" != no ; then
NCURSES_LIBUTF8=1
fi
fi

View File

@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.667 2008/10/12 15:47:49 tom Exp $
# $Id: dist.mk,v 1.668 2008/10/18 13:15:11 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@ -37,7 +37,7 @@ SHELL = /bin/sh
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 6
NCURSES_PATCH = 20081012
NCURSES_PATCH = 20081018
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: frm_driver.c,v 1.87 2008/07/12 21:24:07 tom Exp $")
MODULE_ID("$Id: frm_driver.c,v 1.88 2008/10/18 16:25:00 tom Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
@ -4333,15 +4333,6 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
len = Buffer_Length(field);
if (buffer == 0)
{
for (i = 0; (value[i] != '\0') && (i < len); ++i)
{
if (iscntrl(UChar(value[i])))
RETURN(E_BAD_ARGUMENT);
}
}
if (Growable(field))
{
/* for a growable field we must assume zero terminated strings, because
@ -4356,14 +4347,6 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
* field->cols))))
RETURN(E_SYSTEM_ERROR);
/* in this case we also have to check, whether or not the remaining
characters in value are also printable for buffer 0. */
if (buffer == 0)
{
for (i = len; i < vlen; i++)
if (iscntrl(UChar(value[i])))
RETURN(E_BAD_ARGUMENT);
}
len = vlen;
}
}
@ -4376,6 +4359,13 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
* There should be a better way, but this handles nonspacing characters
* and other special cases that we really do not want to handle here.
*/
#if NCURSES_EXT_FUNCS
if (wresize(field->working, field->drows, field->dcols) == ERR)
#endif
{
delwin(field->working);
field->working = newpad(field->drows, field->dcols);
}
wclear(field->working);
mvwaddstr(field->working, 0, 0, value);
@ -4385,7 +4375,12 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
}
else
{
mvwin_wchnstr(field->working, 0, 0, widevalue, (int)len);
for (i = 0; i < (unsigned)field->drows; ++i)
{
mvwin_wchnstr(field->working, i, 0,
widevalue + (i * field->dcols),
field->dcols);
}
for (i = 0; i < len; ++i)
{
if (CharEq(myZEROS, widevalue[i]))

View File

@ -1,6 +1,6 @@
'\" t
.\"***************************************************************************
.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@ -27,7 +27,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: form_field_buffer.3x,v 1.14 2006/11/04 17:12:00 tom Exp $
.\" $Id: form_field_buffer.3x,v 1.15 2008/10/18 18:35:17 tom Exp $
.TH form_field_buffer 3X ""
.SH NAME
\fBform_field_buffer\fR - field buffer control
@ -46,17 +46,47 @@ int set_max_field(FIELD *field, int max);
.br
.SH DESCRIPTION
The function \fBset_field_buffer\fR sets the numbered buffer of the given field
to contain a given string. Buffer 0 is the displayed value of the field; other
numbered buffers may be allocated by applications through the \fBnbuf\fR
argument of (see \fBform_field_new\fR(3X)) but are not manipulated by the forms
library. The function \fBfield_buffer\fR returns the address of the buffer.
Please note that this buffer has always the length of the buffer, that means
that it may typically contain trailing spaces. If you entered leading spaces
the buffer may also contain them. If you want the raw data, you must write your
to contain a given string:
.RS 3
.TP 3
-
Buffer 0 is the displayed value of the field.
.TP 3
-
Other numbered buffers may be allocated by applications through the \fBnbuf\fR
argument of (see \fBform_field_new\fR(3X))
but are not manipulated by the forms library.
.RE
.PP
The function \fBfield_buffer\fR returns a pointer to
the contents of the given numbered buffer:
.RS 3
.TP 3
-
The buffer contents always have the same length,
and are padded with trailing spaces
as needed to ensure this length is the same.
.TP 3
-
The buffer may contain leading spaces, depending on how it was set.
.TP 3
-
The buffer contents are set with \fBset_field_buffer\fP,
or as a side effect of any editing operations on the corresponding field.
.TP 3
-
Editing operations are based on the \fIwindow\fP which displays the field,
rather than a \fIstring\fP.
The window contains only printable characters, and is filled with blanks.
If you want the raw data, you must write your
own routine that copies the value out of the buffer and removes the leading
and trailing spaces. Please note also, that subsequent operations on the form
will probably change the content of the buffer. So do not use it for long term
storage of the entered form data.
and trailing spaces.
.TP 3
-
Because editing operations change the content of the buffer to
correspond to the window, you should not rely on using buffers
for long-term storage of form data.
.RE
.PP
The function \fBset_field_status\fR sets the associated status flag of
\fIfield\fR; \fBfield_status\fR gets the current value. The status flag

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.112 2007/09/01 20:45:53 tom Exp $
# $Id: Makefile.in,v 1.113 2008/10/18 14:11:54 tom Exp $
##############################################################################
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -183,10 +183,10 @@ $(DESTDIR)$(libdir) :
../lib : ; mkdir $@
./fallback.c : $(tinfo)/MKfallback.sh
sh $(tinfo)/MKfallback.sh @TERMINFO@ @TERMINFO_SRC@ $(FALLBACK_LIST) >$@
sh -e $(tinfo)/MKfallback.sh @TERMINFO@ @TERMINFO_SRC@ $(FALLBACK_LIST) >$@
./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
sh -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
init_keytry.h: make_keys$(BUILD_EXEEXT) keys.list
./make_keys$(BUILD_EXEEXT) keys.list > $@
@ -205,14 +205,14 @@ make_hash$(BUILD_EXEEXT) : \
$(BUILD_CC) -o $@ $(BUILD_CCFLAGS) -DMAIN_PROGRAM $(tinfo)/comp_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
./expanded.c : $(serial)/MKexpanded.sh
sh $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
sh -e $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
./comp_captab.c: \
make_hash$(BUILD_EXEEXT) \
../include/hashsize.h \
$(tinfo)/MKcaptab.sh \
$(tinfo)/MKcaptab.awk
sh $(tinfo)/MKcaptab.sh $(AWK) $(USE_BIG_STRINGS) $(tinfo)/MKcaptab.awk $(srcdir)/../include/@TERMINFO_CAPS@ > $@
sh -e $(tinfo)/MKcaptab.sh $(AWK) $(USE_BIG_STRINGS) $(tinfo)/MKcaptab.awk $(srcdir)/../include/@TERMINFO_CAPS@ > $@
./lib_keyname.c: keys.list $(base)/MKkeyname.awk
$(AWK) -f $(base)/MKkeyname.awk bigstrings=$(USE_BIG_STRINGS) keys.list > $@
@ -257,7 +257,7 @@ realclean :: distclean
test_progs : $(TEST_PROGS)
./link_test.c : $(base)/MKlib_gen.sh ../include/curses.h
sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@
sh -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@
captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS)
@ECHO_LINK@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS)

View File

@ -79,7 +79,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_mouse.c,v 1.101 2008/09/27 19:14:52 tom Exp $")
MODULE_ID("$Id: lib_mouse.c,v 1.102 2008/10/18 21:48:55 tom Exp $")
#include <term.h>
#include <tic.h>
@ -255,13 +255,13 @@ mouse_server(unsigned long param)
* 3 = middle.
*/
if ((mouev.fs ^ oldstate) & MOUSE_BN1_DOWN)
write_event(mouev.fs & MOUSE_BN1_DOWN,
write_event(sp, mouev.fs & MOUSE_BN1_DOWN,
sp->_emxmouse_buttons[1], mouev.col, mouev.row);
if ((mouev.fs ^ oldstate) & MOUSE_BN2_DOWN)
write_event(mouev.fs & MOUSE_BN2_DOWN,
write_event(sp, mouev.fs & MOUSE_BN2_DOWN,
sp->_emxmouse_buttons[3], mouev.col, mouev.row);
if ((mouev.fs ^ oldstate) & MOUSE_BN3_DOWN)
write_event(mouev.fs & MOUSE_BN3_DOWN,
write_event(sp, mouev.fs & MOUSE_BN3_DOWN,
sp->_emxmouse_buttons[2], mouev.col, mouev.row);
finish:
@ -545,7 +545,7 @@ initialize_mousetype(SCREEN *sp)
setmode(handles[1], O_BINARY);
/* Do not use CRT functions, we may single-threaded. */
rc = DosCreateThread((unsigned long *) &sp->_emxmouse_thread,
mouse_server, sp, 0, 8192);
mouse_server, (long) sp, 0, 8192);
if (rc) {
printf("mouse thread error %d=%#x", rc, rc);
} else {

View File

@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: README,v 1.37 2008/06/28 15:52:45 tom Exp $
-- $Id: README,v 1.38 2008/10/18 21:02:45 tom Exp $
-------------------------------------------------------------------------------
The programs in this directory are designed to test your newest toy :-)
@ -71,11 +71,11 @@ data_ahead test: demo_forms
data_behind test: demo_forms
dup_field -
dynamic_field_info test: demo_forms
field_arg -
field_back -
field_arg test: demo_forms
field_back test: demo_forms
field_buffer test: cardfile demo_forms edit_field ncurses
field_count -
field_fore -
field_count test: demo_forms
field_fore test: demo_forms
field_index test: demo_forms
field_info test: ncurses
field_init -
@ -83,18 +83,18 @@ field_just -
field_opts test: demo_forms ncurses
field_opts_off test: cardfile demo_forms
field_opts_on test: demo_forms
field_pad -
field_pad test: demo_forms
field_status test: demo_forms
field_term -
field_type test: demo_forms
field_userptr test: ncurses
field_userptr test: edit_field ncurses
form_driver test: cardfile demo_forms edit_field ncurses
form_fields test: cardfile demo_forms
form_init -
form_opts -
form_opts_off -
form_opts_on -
form_page -
form_page test: demo_forms
form_request_by_name -
form_request_name test: edit_field
form_sub test: cardfile demo_forms ncurses
@ -110,7 +110,7 @@ move_field -
new_field test: cardfile demo_forms ncurses
new_fieldtype test: ncurses
new_form test: cardfile demo_forms ncurses
new_page -
new_page test: demo_forms
pos_form_cursor -
post_form test: cardfile demo_forms ncurses
scale_form test: demo_forms ncurses
@ -121,7 +121,7 @@ set_field_fore test: demo_forms
set_field_init -
set_field_just test: cardfile demo_forms
set_field_opts test: demo_forms ncurses
set_field_pad -
set_field_pad test: demo_forms
set_field_status test: demo_forms
set_field_term -
set_field_type test: demo_forms ncurses
@ -149,7 +149,7 @@ item_count test: demo_menus
item_description -
item_index test: demo_menus ncurses
item_init -
item_name test: ncurses
item_name test: demo_menus ncurses
item_opts -
item_opts_off -
item_opts_on -
@ -205,7 +205,7 @@ set_menu_userptr -
set_menu_win test: demo_menus ncurses
set_top_row -
top_row -
unpost_menu test: ncurses
unpost_menu test: demo_menus ncurses
libncurses:
----------
@ -213,24 +213,24 @@ BC -
COLORS test: echochar ncurses savescreen xmas
COLOR_PAIR test: background blue bs cardfile demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide inserts knight ncurses newdemo rain savescreen tclock testaddch testcurs view worm xmas
COLOR_PAIRS test: echochar ncurses newdemo savescreen
COLS test: cardfile demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels echochar edit_field firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
ESCDELAY lib: ncurses
LINES test: cardfile demo_defkey demo_keyok demo_menus demo_panels echochar edit_field firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
COLS test: cardfile demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto echochar edit_field firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
ESCDELAY test: test_opaque
LINES test: cardfile demo_defkey demo_keyok demo_menus demo_panels ditto echochar edit_field firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
PAIR_NUMBER test: ncurses
PC lib: ncurses
SP lib: ncurses
TABSIZE lib: menu
TABSIZE test: test_opaque
UP -
acs_map test: gdc ins_wide inserts knight movewindow ncurses newdemo testcurs
add_wch test: demo_panels ncurses
add_wchnstr -
add_wchstr test: view
addch test: blue bs echochar hashtest ncurses savescreen testaddch view worm
addch test: blue bs echochar hashtest ncurses savescreen test_opaque testaddch view worm
addchnstr -
addchstr -
addnstr -
addnwstr test: ncurses
addstr test: blue bs cardfile ditto gdc hanoi lrtest ncurses savescreen
addstr test: blue bs cardfile gdc hanoi lrtest ncurses savescreen
addwstr test: ncurses
assume_default_colors test: ncurses
attr_get test: ncurses
@ -251,7 +251,7 @@ boolfnames test: test_arrays progs: dump_entry
boolnames test: test_arrays progs: dump_entry infocmp
border -
border_set -
box test: cardfile chgat demo_forms demo_menus demo_panels edit_field inch_wide inchs ins_wide inserts lrtest ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
box test: cardfile chgat demo_forms demo_menus demo_panels ditto edit_field inch_wide inchs ins_wide inserts lrtest ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
box_set test: ncurses
can_change_color test: ncurses
cbreak test: background blue bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto filter firework foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses newdemo savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
@ -275,15 +275,15 @@ delay_output test: newdemo
delch -
deleteln -
delscreen test: ditto dots_mvcur
delwin test: cardfile chgat demo_forms demo_menus demo_panels edit_field inch_wide inchs ins_wide inserts movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
derwin test: cardfile chgat demo_forms demo_menus inch_wide inchs ins_wide inserts movewindow ncurses test_get_wstr test_getstr test_instr test_inwstr test_opaque
doupdate test: cardfile demo_menus demo_panels edit_field ins_wide inserts knight movewindow ncurses redraw savescreen test_get_wstr test_getstr
delwin test: cardfile chgat demo_forms demo_panels edit_field inch_wide inchs ins_wide inserts movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
derwin test: cardfile chgat demo_forms demo_menus ditto inch_wide inchs ins_wide inserts movewindow ncurses test_get_wstr test_getstr test_instr test_inwstr test_opaque
doupdate test: cardfile demo_menus demo_panels ditto edit_field ins_wide inserts knight movewindow ncurses redraw savescreen test_get_wstr test_getstr
dupwin test: edit_field
echo test: bs hanoi ncurses test_get_wstr test_getstr testcurs testscanw
echo_wchar test: ncurses
echochar test: echochar ncurses
endwin test: background blue bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto dots_mvcur echochar filter firework firstlast foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts keynames knight lrtest movewindow ncurses newdemo rain redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
erase test: cardfile demo_menus filter firework firstlast hanoi lrtest ncurses tclock testcurs
endwin test: background blue bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto dots_mvcur echochar filter firework firstlast foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts key_names keynames knight lrtest movewindow ncurses newdemo rain redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
erase test: cardfile demo_menus filter firework firstlast hanoi lrtest ncurses tclock test_opaque testcurs
erasechar lib: ncurses
erasewchar -
filter test: filter
@ -297,9 +297,9 @@ getbegy test: chgat demo_menus demo_panels movewindow ncurses newdemo redraw
getbkgd test: ncurses
getbkgrnd test: ncurses
getcchar test: ncurses view
getch test: background blue bs chgat color_set demo_altkeys ditto filter firework firstlast foldkeys hanoi hashtest lrtest savescreen tclock testaddch testcurs view xmas
getcurx test: bs chgat demo_altkeys demo_defkey demo_panels foldkeys movewindow ncurses redraw savescreen test_get_wstr test_getstr testcurs
getcury test: bs chgat demo_altkeys demo_defkey demo_panels edit_field foldkeys movewindow ncurses redraw savescreen testcurs
getch test: background blue bs chgat color_set demo_altkeys filter firework firstlast foldkeys hanoi hashtest lrtest savescreen tclock test_opaque testaddch testcurs view xmas
getcurx test: bs chgat demo_altkeys demo_defkey demo_panels foldkeys movewindow ncurses redraw savescreen test_get_wstr test_getstr test_opaque testcurs
getcury test: bs chgat demo_altkeys demo_defkey demo_panels edit_field foldkeys movewindow ncurses redraw savescreen test_opaque testcurs
getmaxx test: chgat demo_panels inch_wide inchs movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
getmaxy test: chgat demo_forms demo_panels inch_wide inchs movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
getmouse test: bs knight movewindow ncurses
@ -360,17 +360,17 @@ key_name test: key_names ncurses
keybound test: demo_altkeys demo_defkey
keyname test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses redraw testcurs view progs: tic
keyok test: demo_keyok foldkeys
keypad test: bs cardfile chgat demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels edit_field filter firework foldkeys hashtest inch_wide inchs ins_wide inserts keynames knight lrtest movewindow ncurses redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view
keypad test: bs cardfile chgat demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto edit_field filter firework foldkeys hashtest inch_wide inchs ins_wide inserts key_names keynames knight lrtest movewindow ncurses redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view
killchar lib: ncurses
killwchar -
leaveok test: hanoi test_opaque
longname test: testcurs progs: tput
mcprint -
meta test: ncurses
meta test: key_names keynames ncurses
mouse_trafo -
mouseinterval -
mousemask test: bs demo_forms demo_menus knight movewindow ncurses
move test: blue bs cardfile chgat demo_altkeys demo_menus echochar foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses savescreen test_get_wstr test_getstr test_instr test_inwstr testscanw view xmas
move test: blue bs cardfile chgat demo_altkeys demo_menus echochar foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses savescreen test_get_wstr test_getstr test_instr test_inwstr test_opaque testscanw view xmas
mvadd_wch test: ncurses
mvadd_wchnstr -
mvadd_wchstr -
@ -421,7 +421,7 @@ mvwaddchnstr -
mvwaddchstr test: inchs
mvwaddnstr test: newdemo testcurs
mvwaddnwstr -
mvwaddstr test: firstlast ins_wide inserts knight ncurses newdemo test_instr testcurs xmas
mvwaddstr test: ditto firstlast ins_wide inserts knight ncurses newdemo test_instr testcurs xmas
mvwaddwstr test: test_inwstr
mvwchgat test: chgat
mvwdelch test: ncurses
@ -457,8 +457,8 @@ mvwvline_set -
napms test: demo_panels ditto dots dots_mvcur echochar firework gdc hanoi lrtest ncurses railroad rain tclock test_opaque testcurs view worm xmas progs: tset
newpad test: edit_field ncurses testcurs
newscr lib: ncurses
newterm test: demo_altkeys ditto dots_mvcur filter foldkeys gdc keynames
newwin test: cardfile chgat demo_defkey demo_forms demo_keyok demo_menus demo_panels edit_field firstlast inch_wide inchs ins_wide inserts knight movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs xmas
newterm test: demo_altkeys ditto dots_mvcur filter foldkeys gdc key_names keynames
newwin test: cardfile chgat demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto edit_field firstlast inch_wide inchs ins_wide inserts knight movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs xmas
nl test: demo_forms ncurses rain testcurs
nocbreak test: testcurs
nodelay test: ditto firework gdc lrtest ncurses newdemo rain tclock test_opaque view worm xmas
@ -485,7 +485,7 @@ putwin test: ncurses
qiflush -
raw test: demo_forms ncurses redraw testcurs
redrawwin test: redraw
refresh test: blue bs demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto echochar filter firstlast gdc hanoi hashtest lrtest movewindow ncurses savescreen tclock testcurs view xmas
refresh test: blue bs demo_defkey demo_forms demo_keyok demo_menus demo_panels echochar filter firstlast gdc hanoi hashtest lrtest movewindow ncurses savescreen tclock testcurs view xmas
reset_prog_mode test: filter ncurses
reset_shell_mode test: bs filter savescreen
resetty -
@ -503,8 +503,8 @@ scrl test: view
scroll test: testcurs
scrollok test: demo_altkeys demo_defkey demo_keyok demo_panels ditto foldkeys hashtest knight ncurses redraw test_opaque testcurs testscanw view
set_curterm lib: ncurses
set_escdelay -
set_tabsize -
set_escdelay test: test_opaque
set_tabsize test: test_opaque
set_term lib: ncurses
setcchar test: demo_panels ins_wide ncurses view
setscrreg test: view
@ -529,7 +529,7 @@ slk_wset test: ncurses
standend test: blue gdc ncurses
standout test: blue ncurses
start_color test: background blue bs cardfile chgat color_set demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide inserts knight ncurses newdemo rain savescreen tclock testaddch testcurs view worm xmas
stdscr test: bs chgat demo_altkeys demo_forms demo_menus demo_panels ditto filter firework foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts keynames knight lrtest movewindow ncurses rain redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view worm xmas
stdscr test: bs chgat demo_altkeys demo_forms demo_menus demo_panels ditto filter firework foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts key_names keynames knight lrtest movewindow ncurses rain redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view worm xmas
strcodes test: test_arrays progs: dump_entry
strfnames test: test_arrays progs: dump_entry
strnames test: foldkeys test_arrays progs: dump_entry infocmp tic
@ -579,7 +579,7 @@ vwscanw lib: ncurses
wadd_wch test: inch_wide
wadd_wchnstr lib: form
wadd_wchstr -
waddch test: demo_forms demo_panels firstlast inch_wide inchs knight ncurses test_get_wstr test_getstr test_instr test_inwstr test_opaque worm
waddch test: demo_forms demo_panels ditto firstlast inch_wide inchs knight ncurses test_get_wstr test_getstr test_instr test_inwstr test_opaque worm
waddchnstr lib: ncurses
waddchstr -
waddnstr lib: menu
@ -614,7 +614,7 @@ werase test: cardfile demo_forms demo_menus demo_panels edit_field firstlast
wget_wch test: ins_wide ncurses
wget_wstr test: test_get_wstr
wgetbkgrnd lib: ncurses
wgetch test: cardfile chgat demo_defkey demo_keyok demo_menus demo_panels edit_field gdc inserts knight movewindow ncurses newdemo rain redraw test_opaque testcurs worm
wgetch test: cardfile chgat demo_defkey demo_keyok demo_menus demo_panels ditto edit_field gdc inserts knight movewindow ncurses newdemo rain redraw test_opaque testcurs worm
wgetn_wstr test: ncurses test_get_wstr
wgetnstr test: ncurses test_getstr
wgetparent test: test_opaque
@ -642,7 +642,7 @@ winstr test: test_instr
winwstr test: test_inwstr
wmouse_trafo lib: form
wmove test: chgat demo_altkeys demo_defkey demo_keyok demo_menus demo_panels firstlast foldkeys inch_wide inchs ins_wide inserts knight movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs worm
wnoutrefresh test: demo_menus edit_field inch_wide inchs ins_wide inserts knight movewindow ncurses redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque
wnoutrefresh test: demo_menus ditto edit_field inch_wide inchs ins_wide inserts knight movewindow ncurses redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque
wprintw test: chgat demo_defkey demo_forms demo_keyok demo_menus demo_panels edit_field inch_wide inchs ins_wide inserts knight movewindow ncurses test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
wredrawln test: redraw
wrefresh test: chgat demo_forms demo_keyok demo_menus demo_panels edit_field firstlast knight lrtest movewindow ncurses newdemo redraw savescreen tclock testcurs view worm xmas

View File

@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
* $Id: demo_forms.c,v 1.26 2008/08/23 23:22:55 tom Exp $
* $Id: demo_forms.c,v 1.30 2008/10/18 20:38:20 tom Exp $
*
* Demonstrate a variety of functions from the form library.
* Thomas Dickey - 2003/4/26
@ -35,20 +35,13 @@
TYPE_ENUM -
TYPE_REGEXP -
dup_field -
field_arg -
field_back -
field_count -
field_fore -
field_init -
field_just -
field_pad -
field_term -
field_type -
form_init -
form_opts -
form_opts_off -
form_opts_on -
form_page -
form_request_by_name -
form_term -
form_userptr -
@ -59,7 +52,6 @@ move_field -
new_page -
pos_form_cursor -
set_field_init -
set_field_pad -
set_field_term -
set_fieldtype_arg -
set_fieldtype_choice -
@ -112,10 +104,10 @@ make_field(int frow, int fcol, int rows, int cols)
* O_STATIC off makes the form library ignore justification.
*/
set_field_just(f, j_value);
set_field_userptr(f, (void *) 0);
if (d_option) {
if (has_colors()) {
set_field_fore(f, COLOR_PAIR(2));
set_field_back(f, A_UNDERLINE | COLOR_PAIR(3));
} else {
set_field_fore(f, A_BOLD);
}
@ -126,6 +118,11 @@ make_field(int frow, int fcol, int rows, int cols)
field_opts_off(f, O_STATIC);
set_max_field(f, m_value);
}
/*
* The userptr is used in edit_field.c's inactive_field().
*/
set_field_userptr(f, (void *) (long) field_back(f));
if (t_value)
set_field_buffer(f, 0, t_value);
}
@ -262,7 +259,11 @@ show_current_field(WINDOW *win, FORM * form)
waddstr(win, " behind");
waddch(win, '\n');
if ((field = current_field(form)) != 0) {
wprintw(win, "Field %d:", field_index(field));
wprintw(win, "Page %d%s, Field %d/%d%s:",
form_page(form),
new_page(field) ? "*" : "",
field_index(field), field_count(form),
field_arg(field) ? "(arg)" : "");
if ((type = field_type(field)) != 0) {
if (type == TYPE_ALNUM)
waddstr(win, "ALNUM");
@ -297,6 +298,21 @@ show_current_field(WINDOW *win, FORM * form)
wprintw(win, " size %dx%d (max %d)",
field_rows, field_cols, field_max);
}
waddch(win, ' ');
wattrset(win, field_fore(field));
waddstr(win, "fore");
wattroff(win, field_fore(field));
waddch(win, '/');
wattrset(win, field_back(field));
waddstr(win, "back");
wattroff(win, field_back(field));
wprintw(win, ", pad '%c'",
field_pad(field));
waddstr(win, "\n");
for (nbuf = 0; nbuf <= 2; ++nbuf) {
if ((buffer = field_buffer(field, nbuf)) != 0) {
@ -366,6 +382,7 @@ demo_forms(void)
f[n++] = make_label(2, 34, "MI");
f[n++] = make_field(3, 34, 1, 1);
set_field_pad(f[n - 1], '?');
set_field_type(f[n - 1], TYPE_ALPHA, 1);
break;
case 2:
@ -395,6 +412,8 @@ demo_forms(void)
f[n++] = make_label(5, 0, "Comments");
f[n++] = make_field(6, 0, 4, 46);
set_field_buffer(f[n - 1], 0, "HELLO\nWORLD!");
set_field_buffer(f[n - 1], 1, "Hello\nWorld!");
}
f[n++] = (FIELD *) 0;
@ -499,6 +518,7 @@ main(int argc, char *argv[])
start_color();
init_pair(1, COLOR_WHITE, COLOR_BLUE);
init_pair(2, COLOR_GREEN, COLOR_BLACK);
init_pair(3, COLOR_CYAN, COLOR_BLACK);
bkgd(COLOR_PAIR(1));
refresh();
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2003-2005,2006 Free Software Foundation, Inc. *
* Copyright (c) 2003-2006,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -26,7 +26,7 @@
* authorization. *
****************************************************************************/
/*
* $Id: edit_field.c,v 1.13 2006/12/09 16:50:11 tom Exp $
* $Id: edit_field.c,v 1.14 2008/10/18 20:40:20 tom Exp $
*
* A wrapper for form_driver() which keeps track of the user's editing changes
* for each field, and makes the result available as a null-terminated string
@ -291,6 +291,13 @@ offset_in_field(FORM * form)
return form->curcol + form->currow * field->dcols;
}
static void
inactive_field(FIELD * f)
{
void *ptr = field_userptr(f);
set_field_back(f, (chtype) ptr);
}
int
edit_field(FORM * form, int *result)
{
@ -310,7 +317,7 @@ edit_field(FORM * form, int *result)
if (ch <= KEY_MAX) {
set_field_back(before, A_REVERSE);
} else if (ch <= MAX_FORM_COMMAND) {
set_field_back(before, A_UNDERLINE);
inactive_field(before);
}
*result = ch;
@ -439,7 +446,7 @@ edit_field(FORM * form, int *result)
}
if (current_field(form) != before)
set_field_back(before, A_UNDERLINE);
inactive_field(before);
return status;
}
#else