summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/grayhints
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-11-02 20:52:45 +0000
committerKarl Berry <karl@freefriends.org>2018-11-02 20:52:45 +0000
commitc17064775d7e90924ff14d980639b5d6d9e0618a (patch)
tree4c335d485e75a8fe7e3776d21105bc774e4ae0cf /Master/texmf-dist/doc/latex/grayhints
parenta6bc45dd24d1f3842b164f345b38526bbbdff0cb (diff)
grayhints (2nov18)
git-svn-id: svn://tug.org/texlive/trunk@49052 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/grayhints')
-rw-r--r--Master/texmf-dist/doc/latex/grayhints/README.md11
-rw-r--r--Master/texmf-dist/doc/latex/grayhints/doc/grayhints.pdfbin0 -> 92618 bytes
-rw-r--r--Master/texmf-dist/doc/latex/grayhints/doc/grayhints_man.pdfbin415594 -> 400042 bytes
-rw-r--r--Master/texmf-dist/doc/latex/grayhints/doc/grayhints_man.tex354
-rw-r--r--Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.pdfbin37442 -> 104160 bytes
-rw-r--r--Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex89
-rw-r--r--Master/texmf-dist/doc/latex/grayhints/examples/gh-fmts-eforms.tex273
-rw-r--r--Master/texmf-dist/doc/latex/grayhints/examples/gh-fmts-hyperref.tex257
-rw-r--r--Master/texmf-dist/doc/latex/grayhints/examples/gh-hyperref.tex88
9 files changed, 909 insertions, 163 deletions
diff --git a/Master/texmf-dist/doc/latex/grayhints/README.md b/Master/texmf-dist/doc/latex/grayhints/README.md
index 5bda721fde6..9f65b35c723 100644
--- a/Master/texmf-dist/doc/latex/grayhints/README.md
+++ b/Master/texmf-dist/doc/latex/grayhints/README.md
@@ -1,6 +1,6 @@
-The graphicxbox Package
+The grayhints Package
Author: D. P. Story
-Dated: 2017-03-02
+Dated: 2018-11-01
This package provides JavaScript code snippets to create 'gray hints'. Gray
hints, as I term them, are text that appears initially in a text field that
@@ -10,6 +10,11 @@ might read 'yyyy/mm/dd'. As soon as the field comes into focus, the hint
disappears. It reappears when the field is blurred and the user did not enter
any text into the field.
+What's New (2018/11/01) Revised package to work correctly with PDF-XChange Editor (not
+PDF-XChange View). Improved code for handling the case where the user commits date by
+pressing the Enter key (the data is committed, but the field does not blur). Some commands
+for customizing the user experience in the case of pressing the Enter key to commit.
+
Dependent packages:
(1) eforms (2017/02/27) to use the field fields of eforms.
(2) insdljs (2017/03/02) a minimal requirement when using form fields defined
@@ -18,6 +23,8 @@ Dependent packages:
hints for calculation fields will not appear.
Package works for dvips/Distiller, pdflatex, lualatex, and xelatex.
+
+PDF Viewers: Adobe Reader DC, PDF-XChange Editor, and, of course Adobe Acrobat.
Enjoy!
diff --git a/Master/texmf-dist/doc/latex/grayhints/doc/grayhints.pdf b/Master/texmf-dist/doc/latex/grayhints/doc/grayhints.pdf
new file mode 100644
index 00000000000..1fdb414c03c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/grayhints/doc/grayhints.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/grayhints/doc/grayhints_man.pdf b/Master/texmf-dist/doc/latex/grayhints/doc/grayhints_man.pdf
index 2113116e40f..696bf290bc4 100644
--- a/Master/texmf-dist/doc/latex/grayhints/doc/grayhints_man.pdf
+++ b/Master/texmf-dist/doc/latex/grayhints/doc/grayhints_man.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/grayhints/doc/grayhints_man.tex b/Master/texmf-dist/doc/latex/grayhints/doc/grayhints_man.tex
index c5ff2503be1..bb180c0dae1 100644
--- a/Master/texmf-dist/doc/latex/grayhints/doc/grayhints_man.tex
+++ b/Master/texmf-dist/doc/latex/grayhints/doc/grayhints_man.tex
@@ -7,11 +7,20 @@
\usepackage{grayhints}\previewOff
\usepackage{graphicx,array,fancyvrb}
\usepackage{aeb_mlink}
+
+\usepackage{xbmks}
+\DeclareInitView{layoutmag={navitab:UseOutlines}}
+\xbmksetup{colors={int=red},styles={intbf}}
+
+\advance\marginparwidth 8pt
+
+
%\usepackage{myriadpro}
%\usepackage{calibri}
\usepackage[altbullet]{lucidbry}
\def\hardspace{{\fontfamily{cmtt}\selectfont\symbol{32}}}
+\let\uif\textsf
\usepackage{acroman}
\usepackage[active]{srcltx}
@@ -19,6 +28,7 @@
\urlstyle{tt}
\renewcommand\LayoutTextField[2]{#2}
+%\AACalculate{\CalcToGray}
%\def\tutpath{doc/tutorial}
%\def\tutpathi{tutorial}
@@ -35,7 +45,7 @@
email={dpstory@acrotex.net},
subject=Documentation for the grayhints,
talksite={\url{www.acrotex.net}},
- version={v1.0, 2017/03/02},
+ version={1.2, 2018/26/04},
Keywords={LaTeX, form field, hints, AcroTeX},
copyrightStatus=True,
copyrightNotice={Copyright (C) \the\year, D. P. Story},
@@ -92,6 +102,16 @@ _path=_path.substring(0,pos)+"/"+manualfilename;
\maketitle
+\pdfbookmarkx[1]{Title Page}[action={\Named{FirstPage}}]{TitlePage}
+\pdfbookmarkx[1]{Links to AcroTeX.Net}[action={/S/GoTo/D(undefined)},%
+ color=magenta,style={bf}]{acrotex}
+\belowpdfbookmarkx{http://www.acrotex.net}[action={\URI{http://www.acrotex.net}},%
+ color=magenta,style={bf}]{home}
+\belowpdfbookmarkx{http://blog.acrotex.net}[action={\URI{http://blog.acrotex.net}},%
+ color=magenta,style={bf}]{blog}
+
+
+
\selectColors{linkColor=black}
\tableofcontents
\selectColors{linkColor=webgreen}
@@ -102,9 +122,10 @@ _path=_path.substring(0,pos)+"/"+manualfilename;
We often see in HTML pages or in compiled executable applications, form
fields (text fields, input fields) that require user input. The untouched
field has text within it informing the user of the nature of the data to be
-entered into the field. This, usually, grayed hint immediately disappears
-when the user focus the cursor on the field. We illustrate the concept with
-an example or two.
+entered into the field. This ``grayed hint'' immediately disappears
+when the user focuses the cursor on the field.\footnote{Focus on the field by
+clicking inside the form field.} We illustrate the concept with an example or
+two.
\begin{quote}
\textField[\textColor{\matchGray}
\TU{Enter your first name so I can get to know you better}
@@ -115,8 +136,8 @@ an example or two.
}]{NameFirst1}{2in}{11bp}\vcgBdry[\medskipamount]
\textField[\textColor{\matchGray}
\TU{Enter your favorite date, in the indicated format}
- \AA{\AAKeystroke{AFDate_KeystrokeEx("yyyy/mm/dd");\r\KeyToGray}
- \AAFormat{AFDate_FormatEx("yyyy/mm/dd");\r\FmtToGray{yyyy/mm/dd}}
+ \AA{\AAKeystroke{\DateKeyEx("yyyy/mm/dd");\r\KeyToGray}
+ \AAFormat{\DateFmtEx("yyyy/mm/dd");\r\FmtToGray{yyyy/mm/dd}}
\AAOnFocus{\JS{\FocusToBlack}}
\AAOnBlur{\JS{\BlurToBlack}}
}]{DateField1}{1in}{11bp}\cgBdry[1.5em]
@@ -124,18 +145,25 @@ an example or two.
\TU{Press to clear to clear all fields.}
\A{\JS{this.resetForm();}}]{reset}{}{11bp}
\end{quote}
- Of course, the usual tooltips may also be provided.\medskip\noindent
+ Of course, the usual tool tips may also be provided.\medskip\noindent
It is not natural for Adobe form fields to do this, it takes some support
code for it to work properly; scripts for the Keystroke, Format, OnFocus,
- and OnBlur events are needed.
+ OnBlur, and Calculate events are needed.
+
+The \pkg{grayhints} package works as designed for \app{Adobe Reader} and
+\app{PDF-XChange Editor}.\footnote{\app{PDF-XChange Viewer}, which is no longer
+supported by \href{https://www.tracker-software.com/}{Tracker Software
+Products}, will display the gray hints, but some of the needed JavaScript are not supported.} All {\LaTeX}
+workflows for PDF creation are also supported.
\section{Package options}
Without passing any options, the \pkg{eforms} package of \AEB, dated
-2017/02/27, is required and a document JavaScript function
-\texttt{AllowCalc()} is automatically embedded in the document; however there
-are options to modify this default setup.
+2017/02/27, is required; the document JavaScript function
+\texttt{AllowCalc()} and modified Adobe built-in functions are automatically
+embedded in the document. There are options, however, to modify this default
+setup.
\begin{description}
\item[\texttt{usehyforms}] By default, this package requires
\pkg{eforms}, dated 2017/02/27; however, if you are more
@@ -143,34 +171,42 @@ are options to modify this default setup.
option \texttt{usehyforms}.\footnote{\pkg{eforms} and
\pkg{hyperref} form fields can be used in one document.} When
\texttt{usehyforms} is specified, \pkg{insdljs} dated 2017/03/02 or
- later is required. This requirement is to support the
- \texttt{usealtadobe}, discussed next.
+ later is required.
+% This requirement is to support the
+% \texttt{usealtadobe}, discussed next.
\item[\texttt{nocalcs}] If this option is taken, the document
JavaScript function \texttt{AllowCalc()} is not embedded in the document. The
implications are that you are not using any calculation fields.
- \item[\texttt{usealtadobe}] If you have the \app{Acrobat} application,
- you can edit form fields. When you write custom formatting scripts
- (as does this package) using Adobe's built-in functions, such as
- \texttt{AFNumber\_Keystroke} and \texttt{AFNumber\_Format}, the
- user-interface for editing the custom script is not available. The
- \texttt{usealtadobe} option is passed to \pkg{insldjs};
- \pkg{insdljs}, in turn, inputs alternate names for the common
- \app{Adobe} built-ins. Refer to
- \hyperref[s:altadobfuncs]{Section~\ref*{s:altadobfuncs}} for more
- information.
+
+% \item[\texttt{usealtadobe}] If you have the \app{Acrobat} application,
+% you can edit form fields. When you write custom formatting scripts
+% (as does this package) using Adobe's built-in functions, such as
+% \texttt{AFNumber\_Keystroke} and \texttt{AFNumber\_Format}, the
+% user-interface for editing the custom script is not available. The
+% \texttt{usealtadobe} option is passed to \pkg{insldjs};
+% \pkg{insdljs}, in turn, inputs alternate names for the common
+% \app{Adobe} built-ins. Refer to
+% \hyperref[s:altadobfuncs]{Section~\ref*{s:altadobfuncs}} for more
+% information.
\item[\texttt{nodljs}] When this option is specified, there are no
requirements placed on this package; that is, neither \pkg{eforms}
- nor \pkg{insdljs} are required.
+ nor \pkg{insdljs} are required. Use this option is you are not
+ using any of the Adobe built-in formatting functions.
\end{description}
-\paragraph*{Demo file:} \texttt{gh-eforms.tex,\;gh-hyperref.tex}. The latter file
-uses the \opt{usehyforms} option (and \pkg{hyperref} form fields), while the former uses the \pkg{eforms} package.
+\paragraph*{Demo files:} \texttt{gh-eforms.tex,\;gh-hyperref.tex}. The latter file
+uses the \opt{usehyforms} option (and \pkg{hyperref} form fields), while the
+former uses the \pkg{eforms} package. The demo files
+\texttt{gh-fmt-eforms.tex,\;gh-fmt-hyperref.tex} provided additional examples
+of the use of Adobe's built-in formatting functions.
\section{Creating a form field with a gray hint}
-In this documentation, we use \pkg{eforms} form fields to illustrate concepts, the demonstration file
-\texttt{gh-hyperref.tex} has the form field markup for the case of \pkg{hyperref} forms.
+In this documentation, we use \pkg{eforms} form fields to illustrate
+concepts, the demonstration file \texttt{gh-hyperref.tex} and
+\texttt{gh-fmt-hyperref.tex} has the form field markup for the case of
+\pkg{hyperref} forms.
There are two cases: (1) an ordinary variable text form field (this includes
text fields and editable combo boxes) with no calculate script; (2) same as
@@ -189,6 +225,7 @@ color of the text in the text field must be appropriate. We illustrate,
\AAFormat{\FmtToGray{First Name}}
\AAOnFocus{\JS{\FocusToBlack}}
\AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray} %!normalfont( required if !app(PDF-XChange Editor) is used)
}]{NameFirst}{2in}{11bp}
\end{Verbatim}
By default, the text color is black and the grayed hint text is light gray.
@@ -210,20 +247,28 @@ the color for the text to the gray color using the command \cs{matchGray} of
normal color (usually black).
\item{OnBlur Script:} In line~(6), the \cs{BlurToBlack} script is
placed within the argument of \cs{OnBlur}, in the manner
- indicated. When the field loses focus (is blurred), the script
+ indicated. When the field loses focus (blurred), the script
changes the color of text to gray if the field is empty or to
its normal color (usually black), otherwise.
+ \item{Calculate Script:} In line~(7), the Calculate event resets the
+ color to gray. This is needed when the user presses the
+ \uif{Enter} key rather than exiting the field by tabbing out, or
+ clicking or tapping an area outside the field. This script is required
+ when (1) there is a possibility that \app{PDF-XChange Editor} is used; or
+ (2) a ``totals'' calculation field.
\end{description}
\end{quote}
The \pkg{hyperref} form field counterpart to the above example is,
\begin{Verbatim}[xleftmargin=\parindent,commandchars=!(),numbers=left,numbersep=3bp,fontsize=\small]
\TextField[name={NameFirst},
- height=11bp,width=2in,
- color=\matchGray,
- keystroke=\KeyToGray,
- format=\FmtToGray{First Name},
- onfocus=\FocusToBlack,
- onblur=\BlurToBlack]{}
+ height=11bp,width=2in,charsize=9bp,
+ color={\matchGray},
+ keystroke={\KeyToGray},
+ format={\FmtToGray{First Name}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray} %!normalfont( required if !app(PDF-XChange Editor) is used)
+]{}
\end{Verbatim}
The two fields appear side-by-side:
\begin{quote}
@@ -235,7 +280,7 @@ The two fields appear side-by-side:
\AAOnBlur{\JS{\BlurToBlack}}
}]{NameFirst2}{2in}{11bp}\cgBdry[0.5em]
\TextField[name={NameFirst3},
- height=11bp,width=2in,
+ height=11bp,width=2in,,charsize=9bp,
color=\matchGray,
keystroke=\KeyToGray,
format=\FmtToGray{First Name},
@@ -245,7 +290,7 @@ The two fields appear side-by-side:
\TU{Press to clear to clear all fields.}
\A{\JS{this.resetForm();}}]{reset}{}{11bp}
\end{quote}
-Both fields appear in the `default' appearance.
+Both fields appear in their `default' appearance.
\subsection{Variable text field, with calculate script}
@@ -259,15 +304,21 @@ the code snippet \cs{CalcToGray} as part of your calculate script.
\AAFormat{AFNumber_Format(0,1,0,0,"",true);\r\FmtToGray{Total}}
\AACalculate{var cArray=new Array("Integer");\r
if(AllowCalc(cArray))AFSimple_Calculate("SUM", cArray );\r
- \CalcToGray}
+ !textbf~\CalcToGray@}
\AAOnFocus{\JS{\FocusToBlack}}
- \AAOnBlur{\JS{\BlurToBlack}}}
-]{TotalNumbers}{1in}{11bp}
+ \AAOnBlur{\JS{\BlurToBlack}}
+}]{TotalNumbers}{1in}{11bp}
\end{Verbatim}
The use of \cs{r} is optional, the author uses this to format the script
-within the user-interface of \app{Acrobat}. The \cs{textColor} (line~(2)),
-\cs{AAOnFocus} (line~(8)), and \cs{AAOnBlur} (line~(8)) are the same as earlier presented.
-Several comments are needed for the \cs{AAKeystroke}, \cs{AAFormat} and \cs{AACalculate} lines.
+within the user-interface of \app{Acrobat} (or \app{PDF-XChange
+Editor}).\footnote{The helper commands \cs{r} and \cs{t} are defined in
+\pkg{eforms}; if \pkg{eforms} is not loaded, use \cs{jsR} and \cs{jsT}
+instead.} The \cs{textColor} (line~(2)), \cs{AAOnFocus} (line~(8)), and
+\cs{AAOnBlur} (line~(9)) are the same as earlier presented. Several comments
+are needed for the \cs{AAKeystroke}, \cs{AAFormat} and \cs{AACalculate}
+lines. The \cs{AACalculate} event above also shows, in general, how to integrate
+the gray hint methodology with other scripts; as a general rule, the gray hints commands
+should come last.
\begin{itemize}
\item This is a number field, so we use the built-in functions
\texttt{AFNumber\_Keystroke} and \texttt{AFNumber\_Format} provided
@@ -291,7 +342,7 @@ Several comments are needed for the \cs{AAKeystroke}, \cs{AAFormat} and \cs{AACa
\end{itemize}
Let's go to the examples. Build three fields (four actually), in the first two
enter integers, the other two fields compute their sum.
-\begin{quote}\previewOff
+\begin{quote} %\previewOff
\ding{172}\ \textField[\TU{Enter an integer}
\textColor{\matchGray}\AA{%
\AAKeystroke{AFNumber_Keystroke(0,1,0,0,"",true);\r\KeyToGray}
@@ -379,7 +430,8 @@ We repeat the `First Name' example with different declared colors. We begin by d
\normalGrayColors{blue}{magenta}
\end{Verbatim}
then build a `gray hinted' field,
-\begin{quote}\previewOff\normalGrayColors{blue}{magenta}%
+\begin{quote}%\previewOff
+ \normalGrayColors{blue}{magenta}%
\textField[\textColor{\matchGray}
\TU{Enter your first name so I can get to know you better}
\AA{\AAFormat{\FmtToGray{First Name}}
@@ -392,39 +444,46 @@ then build a `gray hinted' field,
\A{\JS{this.resetForm();}}]{reset}{}{11bp}
\end{quote}
-\subsection{Remarks on the
- \texorpdfstring{\protect\opt{usealtadobe}}{usealtadobe} option}\label{s:altadobfuncs}
-
-The \opt{usealtadobe} option is useful for developers who have the
-\app{Adobe} application and who wish to develop and test scripts that extend
-in the current work. The \opt{usealtadobe} option inputs from \pkg{insdljs} the following
-alternate names. As a general rule, all Adobe built-in format, validate, and calculation functions
-that begin with `AF' are given alternate names that begin with `EF'. More specifically, the table
-below lists the effected functions.
-\begin{quote}
-\begin{tabular}{>{\ttfamily}l>{\ttfamily}l}
+\subsection{Remarks on using Adobe built-in formatting functions}\label{s:altadobfuncs}
+
+The \pkg{grayhints} package (as well as does \pkg{insdljs}) offers
+alternating naming of the \app{Adobe} built-in formatting functions. As a
+general rule, all Adobe built-in format, validate, and calculation functions
+that begin with `AF' are given alternate names that begin with `EF'. More
+specifically, \hyperref[table:builtin]{Table~\ref*{table:builtin}} lists the
+Adobe built-in formatting functions and their alternative names. The purpose
+of these alternate names is to allow the JavaScript developer to access the
+scripts through the \app{Acrobat} user-interface.
+\begin{table}[htb]\centering
+\begin{tabular}{>{\ttfamily}l>{\ttfamily}ll}
\multicolumn{1}{>{\sffamily\bfseries}l}{Adobe function name}&%
-\multicolumn{1}{>{\sffamily\bfseries}l}{Alternate function name}\\
-AFNumber\_Keystroke&EFNumber\_Keystroke\\
-AFNumber\_Format&EFNumber\_Format\\
-AFPercent\_Keystroke&EFPercent\_Keystroke\\
-AFPercent\_Format&EFPercent\_Format\\
-AFDate\_Format&EFDate\_Format\\
-AFDate\_Keystroke&EFDate\_Keystroke\\
-AFDate\_FormatEx&EFDate\_FormatEx\\
-AFTime\_Keystroke&EFTime\_Keystroke\\
-AFTime\_Format&EFTime\_Format\\
-AFTime\_FormatEx&EFTime\_FormatEx\\
-AFDate\_KeystrokeEx&EFDate\_KeystrokeEx\\
-AFSpecial\_Keystroke&EFSpecial\_Keystroke\\
-AFSpecial\_Format&EFSpecial\_Format\\
-AFSpecial\_KeystrokeEx&EFSpecial\_KeystrokeEx\\
-AFRange\_Validate&EFRange\_Validate\\
-AFRange\_Validate&EFRange\_Validate\\
-AFSimple\_Calculate&EFSimple\_Calculate\\
-AFMergeChange&EFMergeChange
+\multicolumn{1}{>{\sffamily\bfseries}l}{Alternate function name}&%
+\multicolumn{1}{>{\sffamily\bfseries}l}{\LaTeX{} command\protect\footnotemark}\\
+AFNumber\_Keystroke&EFNumber\_Keystroke&\cs{NumKey}\\
+AFNumber\_Format&EFNumber\_Format&\cs{NumFmt}\\
+AFPercent\_Keystroke&EFPercent\_Keystroke&\cs{PercentKey}\\
+AFPercent\_Format&EFPercent\_Format&\cs{PercentFmt}\\
+AFDate\_Keystroke&EFDate\_Keystroke&\cs{DateKey}\\
+AFDate\_Format&EFDate\_Format&\cs{DateFmt}\\
+AFDate\_KeystrokeEx&EFDate\_KeystrokeEx&\cs{DateKeyEx}\\
+AFDate\_FormatEx&EFDate\_FormatEx&\cs{DateFmtEx}\\
+AFTime\_Keystroke&EFTime\_Keystroke&\cs{TimeKey}\\
+AFTime\_Format&EFTime\_Format&\cs{TimeFmt}\\
+AFTime\_FormatEx&EFTime\_FormatEx&\cs{TimeFmtEx}\\
+AFSpecial\_Keystroke&EFSpecial\_Keystroke&\cs{SpecialKey}\\
+AFSpecial\_Format&EFSpecial\_Format&\cs{SpecialFmt}\\
+AFSpecial\_KeystrokeEx&EFSpecial\_KeystrokeEx&\cs{SpecialKeyEx}\\
+AFRange\_Validate&EFRange\_Validate&\cs{RangeValidate}\\
+AFSimple\_Calculate&EFSimple\_Calculate&\cs{SimpleCalc}\\
+AFMergeChange&EFMergeChange&\cs{MergeChange}
\end{tabular}
-\end{quote}
+\caption{Built-in formatting commands}\label{table:builtin}
+\end{table}
+
+You can learn more about the `AF' versions and their arguments at the
+\href{http://blog.acrotex.net}{Acro\negthinspace\TeX\space Blog} web site; in
+particular, carefully read the article
+\mlurl{http://www.acrotex.net/blog/?p=218}.
\begin{figure}[htb]
\begin{minipage}[t]{.5\linewidth-2.5pt}\kern0pt\centering
@@ -439,8 +498,9 @@ AFMergeChange&EFMergeChange
\caption{Format tab: `AF' versus `EF' functions}\label{fig:AltAdbFncs}
\end{figure}
-\hyperref[fig:AltAdbFncs]{Figure~\ref*{fig:AltAdbFncs}} shows the impact of using the `EF' functions. On the left,
-\texttt{AFNumber\_Format} is used to format a number field that uses gray hints using the code
+\leavevmode\hyperref[fig:AltAdbFncs]{Figure~\ref*{fig:AltAdbFncs}} shows the
+impact of using the `EF' functions. On the left, \texttt{AFNumber\_Format} is
+used to format a number field that uses gray hints using the code
\begin{Verbatim}[xleftmargin=\parindent]
AFNumber_Format(0,1,0,0,"",true)\r\FmtToGray
\end{Verbatim}
@@ -461,9 +521,147 @@ be needed, but when \app{Adobe Distiller} is used, \app{Acrobat} throws an
exception when the file is first created. The \texttt{try/\penalty0catch} suppresses
(catches) the exception.
+\footnotetext{These commands are explained in \hyperref[extendGH]{Section~\ref*{extendGH}}}
+
+
+\section{Extending the functionality of \texorpdfstring{\protect\pkg{grayhints}}{grayhints}}\label{extendGH}
+
+The `gray hints' technique works well with fields that require special
+formatting such as the ones provided by built-in formats of \app{Adobe
+Acrobat}, these formats are Number, Percentage, Date, Time, Special, and
+Custom. How `gray hints' functions when one of these special formats is used
+may be acceptable, but if not, we offer an alternative. We begin by
+presenting two date text fields. The one on the left is the default, the one
+on the right is `enhanced.'\footnote{The example that follows is taken from
+\texttt{gh-fmts-forms.tex} where you will find additional
+discussion.}\medbreak
+
+\noindent\hskip-62.5pt\begingroup\advance\linewidth62.5pt
+\begin{minipage}[t]{.5\linewidth-15pt}
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}
+ \AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+% Using the Adobe Built-in functions directly
+ \AAKeystroke{AFDate_KeystrokeEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{AFDate_FormatEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield1}{1in}{11bp}\par\smallskip\noindent
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\footnotesize,commandchars={!~@},numbers=left,numbersep=8pt]
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}\AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+% !normalfont~Using the Adobe Built-in functions directly@
+ \AAKeystroke{%
+ AFDate_KeystrokeEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{AFDate_FormatEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield1}{1in}{11bp}
+\end{Verbatim}
+\footnotesize\makebox[\linewidth][c]{Figure (a): Using Adobe built-in functions}
+\end{minipage}\hfill
+\begin{minipage}[t]{.5\linewidth-15pt}
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}\AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+% using a customized version of Adobe built-in functions, with LaTeX access
+ \AAKeystroke{\DateKeyEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{\DateFmtEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield2}{1in}{11bp}\par\smallskip\noindent
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\footnotesize,commandchars={!~@},numbers=left,numbersep=8pt]
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}\AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+% !normalfont~Using a customized version of Adobe built-in@
+% !normalfont~functions, with !LaTeX access@
+ \AAKeystroke{!textbf~\DateKeyEx@("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{!textbf~\DateFmtEx@("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield2}{1in}{11bp}
+\end{Verbatim}
+\setlength{\fboxsep}{0pt}%
+\footnotesize\makebox[\linewidth][c]{Figure~(b): Using \LaTeX{} format commands}
+\end{minipage}
+\endgroup\par\medskip\noindent
+Try entering a bogus date, such as the number `17'. The two fields operate
+identically when you then commit your date by clicking your mouse outside the
+fields. However, the behavior of these two fields differ when you commit your
+bogus date by pressing the \uif{Enter} key. For Figure~(a), the template
+`yyyy/dd/mm' appears in black, whereas, for Figure~(b), the phrase `continue
+editing' appears in black. The latter is the `enhanced' behavior of the
+fields that use the gray hints code.
+
+\paragraph*{Remarks on the {\LaTeX} format commands.} The difference in the two code snippets
+(Figures~(a) and~(b)) is seen in lines~(6) and~(8) of Figure~(b). In these
+two lines we use the special \cs{DateKeyEx} and \cs{DateFmtEx} commands that
+ultimately call the \app{Adobe} built-in functions, but when these special
+commands are used, we can better manage what happens when the \uif{Enter} key
+is pressed. The document author is strongly encouraged to use the {\LaTeX}
+commands in the last column on the right of
+\hyperref[table:builtin]{Table~\ref*{table:builtin}}, instead of using the
+Adobe built-ins, as is done in Figure~(a), or their `EF'
+counterparts.\footnote{Some of these {\LaTeX} commands use the `AF' built-in
+(mostly for the formate events) while others use the `EF' versions of the
+built-ins.}
+
+The \pkg{grayhints} now defines \cs{EnterCommitFailEvent} and
+\cs{CommitSuccessEvent} to customize the user experience when \uif{Enter} key
+is pressed (as opposed to leaving the field by clicking in white space, or
+tabbing away from the field). See the sample files \texttt{gh-fmts-eforms}\marginpar{\small\slshape\raggedleft \texttt{gh-fmts-eforms} referenced}
+for instructions to use these two commands. We present a final example, where the `Enter' events have been changed.\medskip
+
+\EnterCommitFailEvent{\t
+ event.target.strokeColor=color.red;\r\t\t
+ event.target.textColor=color.red;\r\t\t
+ event.value=("weiter bearbeiten");
+% event.value=(event.target.savevalue);
+}
+\CommitSuccessEvent{\t\t
+ event.target.strokeColor=color.black;
+}
+
+%event.value=("weiter bearbeiten");
+
+\noindent
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}\AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+% using a customized version of Adobe built-in functions, with LaTeX access
+ \AAKeystroke{\DateKeyEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{\DateFmtEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield3}{1in}{11bp}\qquad(enter `17' then press enter)\medskip
+
+\EnterCommitFailEvent{}\CommitSuccessEvent{}
+
+\noindent This example appears in the \texttt{gh-fmts-eforms.tex} sample file.
+
\section{My retirement}
Now, I simply must get back to it. \dps
\end{document}
+
+\begin{minipage}{\linewidth-2in-6bp-1em-6pt}\footnotesize
+\textbf{Remark.} The underlying JS function tries hard to make a date from
+the input. You can enter a date in most any format as long it is in the order
+of the date elements YEAR MONTH DAY (yyyy/mm/dd), as determined by the
+formatting template. (For example, try 2018 Jan 10).
+\end{minipage}\medskip
diff --git a/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.pdf b/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.pdf
index add08324cd3..f726a7b9f19 100644
--- a/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.pdf
+++ b/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex b/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex
index 555e4af77c7..4f9e9f8f5b0 100644
--- a/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex
+++ b/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex
@@ -1,12 +1,15 @@
\documentclass{article}
\usepackage[designiv]{web}
-\usepackage[usealtadobe]{grayhints}\previewOff
-
+\usepackage{grayhints}\previewOff
\addtoWebHeight{1in}
\def\cs#1{\texttt{\char`\\#1}}
\parindent0pt
+%\EnterCommitFailEvent{\jsT\jsT
+% event.target.strokeColor=color.red;\jsR\jsT\jsT
+% event.value=(event.target.savevalue);}
+%\CommitSuccessEvent{event.target.strokeColor=color.black;}
\begin{document}
@@ -14,7 +17,7 @@
\large\bfseries Gray Hints
\end{center}
The `gray hint' technique requires modifications to the Format,
-Keystroke, OnFocus, and OnBlur events.\medskip
+Keystroke, OnFocus, OnBlur, and Calculate events.\medskip
\textField[\textColor{\matchGray}
\TU{Enter your first name}
@@ -22,6 +25,7 @@ Keystroke, OnFocus, and OnBlur events.\medskip
\AAKeystroke{\KeyToGray}
\AAOnFocus{\JS{\FocusToBlack}}
\AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
}]{Name.First}{2in}{11bp}\cgBdry[1em]
\textField[\textColor{\matchGray}
\TU{Enter your last name}
@@ -29,16 +33,22 @@ Keystroke, OnFocus, and OnBlur events.\medskip
\AAKeystroke{\KeyToGray}
\AAOnFocus{\JS{\FocusToBlack}}
\AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
}]{Name.Last}{2in}{11bp}\cgBdry[1em]\vcgBdry[3bp]
\textField[\textColor{\matchGray}
\TU{Enter a date of your choosing}
- \AA{\AAKeystroke{AFDate_KeystrokeEx("yyyy/mm/dd");\r\KeyToGray}
- \AAFormat{AFDate_FormatEx("yyyy/mm/dd");\r\FmtToGray{yyyy/mm/dd}}
- \AAKeystroke{\KeyToGray}
- \AAOnFocus{\JS{\FocusToBlack}}
- \AAOnBlur{\JS{\BlurToBlack}}
-}]{Datefield}{1in}{11bp}\cgBdry[1em]\vcgBdry[6bp]
-
+ \AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+ \AAKeystroke{\DateKeyEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{\DateFmtEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield}{1in}{11bp}\kern2bp\enspace$\Leftarrow$\enspace
+\parbox{\linewidth-1in-2bp-\widthof{\enspace$\Leftarrow$\enspace}}
+{\small Refer to \texttt{gh-fmts-eforms.tex} for additional discussion of
+fields requiring special formatting.}\medskip
The next three fields perform calculations, the last one is the sum of the
first two. These are fields formatted as numbers. To prevent `Total' field
@@ -50,29 +60,29 @@ of the fields listed in \texttt{cArray} has a value and returns
\textField[\TU{Enter an integer}
\textColor{\matchGray}\AA{%
- \AAKeystroke{EFNumber_Keystroke(0,1,0,0,"",true);\r\KeyToGray}
- \AAFormat{EFNumber_Format(0,1,0,0,"",true);\r\FmtToGray{First Integer}}
+ \AAKeystroke{\NumKey(0,1,0,0,"",true);\r\KeyToGray}
+ \AAFormat{\NumFmt(0,1,0,0,"",true);\r\FmtToGray{First Integer}}
\AAOnFocus{\JS{\FocusToBlack}}
- \AAOnBlur{\JS{\BlurToBlack}}}
-]{Integer.First}{1in}{11bp}\vcgBdry[3bp]
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Integer.First}{1in}{11bp}\vcgBdry[3bp]
\textField[\TU{Enter an integer}
\textColor{\matchGray}\AA{%
- \AAKeystroke{EFNumber_Keystroke(0,1,0,0,"",true);\r\KeyToGray}
- \AAFormat{EFNumber_Format(0,1,0,0,"",true);\r\FmtToGray{Second Integer}}
+ \AAKeystroke{\NumKey(0,1,0,0,"",true);\r\KeyToGray}
+ \AAFormat{\NumFmt(0,1,0,0,"",true);\r\FmtToGray{Second Integer}}
\AAOnFocus{\JS{\FocusToBlack}}
- \AAOnBlur{\JS{\BlurToBlack}}}
-]{Integer.Second}{1in}{11bp}\vcgBdry[3bp]
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Integer.Second}{1in}{11bp}\vcgBdry[3bp]
\textField[\TU{The total for first and second integers}
\textColor{\matchGray}\AA{%
- \AAKeystroke{EFNumber_Keystroke(0,1,0,0,"",true);\r\KeyToGray}
- \AAFormat{EFNumber_Format(0,1,0,0,"",true);\r\FmtToGray{Total}}
+ \AAKeystroke{\NumKey(0,1,0,0,"",true);\r\KeyToGray}
+ \AAFormat{\NumFmt(0,1,0,0,"",true);\r\FmtToGray{Total}}
\AACalculate{var cArray=new Array("Integer");\r
- if (AllowCalc(cArray)) AFSimple_Calculate("SUM", cArray );\r\CalcToGray}
+ if (AllowCalc(cArray))\SimpleCalc("SUM", cArray );\r\CalcToGray}
\AAOnFocus{\JS{\FocusToBlack}}
- \AAOnBlur{\JS{\BlurToBlack}}}
-]{TotalNumbers}{1in}{11bp}\vcgBdry[6bp]
-
-
+ \AAOnBlur{\JS{\BlurToBlack}}
+}]{TotalNumbers}{1in}{11bp}\medskip
The gray hint technique can apply to editable combo boxes as well.\vcgBdry[3bp]
\comboBox[\textColor{\matchGray}
@@ -81,18 +91,19 @@ The gray hint technique can apply to editable combo boxes as well.\vcgBdry[3bp]
\AAKeystroke{\KeyToGray}
\AAOnFocus{\JS{\FocusToBlack}}
\AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
}]{combo}{1.65in}{11bp}{(Meat)(Potatoes)(Rice)(Onions)(Pickles)}\cgBdry[1em]
\pushButton[\CA{Reset}
\TU{Press to clear to clear all fields.}
- \A{\JS{this.resetForm();}}]{reset}{}{11bp}\vcgBdry[6bp]
+ \A{\JS{this.resetForm();}}]{reset}{}{11bp}\medskip
The color scheme of the gray hints is changed using
\cs{normalGrayColors}. The initial value of \cs{textColor}, which sets the
color of the text, must match, for appearance sake, the choice for the gray
color; for this reason, the \cs{matchGray} command was developed.\vcgBdry[6bp]
-\normalGrayColors{blue}{magenta}
-%\normalGrayColors{color.blue}{color.magenta}
+%\normalGrayColors{blue}{magenta}
+\normalGrayColors{color.blue}{color.magenta}
\textField[\textColor{\matchGray}
\TU{Enter your favorite pet's name}
@@ -100,27 +111,7 @@ color; for this reason, the \cs{matchGray} command was developed.\vcgBdry[6bp]
\AAKeystroke{\KeyToGray}
\AAOnFocus{\JS{\FocusToBlack}}
\AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
}]{Pet}{1in}{11bp}
\end{document}
-
-
-\begin{document}
-\begin{center}\large\bfseries Gray Hints
-\end{center}
-The `gray hint' technique requires the modification of the Format,
-Calculate, OnFocus, and OnBlur events.\medskip
-
-\textField[\textColor{\matchGray}
- \TU{Enter your first name}\AA{%
-\AAFormat{\FmtToGray{First Name}}
- \AAKeystroke{\KeyToGray}
- \AAOnFocus{\JS{\FocusToBlack}}
- \AAOnBlur{\JS{\BlurToBlack}}}]{Name.First}{2in}{11bp}\vcgBdry[3bp]
-
-
-\pushButton[\CA{Reset}
- \TU{Press to clear to clear all fields.}
- \A{\JS{this.resetForm();}}]{reset}{}{11bp}
-
-\end{document}
diff --git a/Master/texmf-dist/doc/latex/grayhints/examples/gh-fmts-eforms.tex b/Master/texmf-dist/doc/latex/grayhints/examples/gh-fmts-eforms.tex
new file mode 100644
index 00000000000..cf6186da19a
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/grayhints/examples/gh-fmts-eforms.tex
@@ -0,0 +1,273 @@
+\documentclass{article}
+\usepackage[designiv]{web}
+\usepackage{grayhints}\previewOff
+\usepackage{fancyvrb}
+
+\addtoWebHeight{1in}
+\def\cs#1{\texttt{\char`\\#1}}
+\let\app\textsf
+\let\pkg\textsf
+\let\uif\textsf
+\parindent0pt
+
+%\EnterCommitFailEvent{\jsT\jsT
+% event.target.strokeColor=color.red;\jsR\jsT\jsT
+% event.value=(event.target.savevalue);}
+%\CommitSuccessEvent{event.target.strokeColor=color.black;}
+
+\begin{document}
+
+\begin{center}
+ \large\bfseries Gray Hints - Formats
+\end{center}
+The `gray hints' technique works well with fields that require special
+formatting such as the ones provided by built-in formats of \app{Adobe
+Acrobat}, these formats are Number, Percentage, Date, Time, Special, and
+Custom. How `gray hints' functions when one of these special formats is
+used may be acceptable, but if not, we offer an alternative. First we compare
+two date fields. The one on the left is the default, the one on the right is
+`enhanced.'\medskip
+
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}
+ \AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+% Using the Adobe Built-in functions directly
+ \AAKeystroke{AFDate_KeystrokeEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{AFDate_FormatEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield1}{1in}{11bp}\kern2bp\quad
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}
+ \AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+% using a customized version of Adobe built-in functions, with LaTeX access
+ \AAKeystroke{\DateKeyEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{\DateFmtEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield2}{1in}{11bp}\hfill\begin{minipage}{\linewidth-2in-6bp-1em-6pt}\footnotesize
+The underlying JS function tries hard to make a date from the input. You can enter a date
+in most any format as long it is in the order of the date elements YEAR MONTH DAY (yyyy/mm/dd), as determined by the
+formatting template. (For example, try 2018 Jan 10).
+\end{minipage}\medskip
+
+
+\textbf{Note:} In the discussion that follows, we assume you are using
+\app{Adobe Acrobat DC} (or prior), \app{Adobe Reader DC} (or prior) or
+\app{PDF-XChange Editor}. These PDF viewers support the JavaScript used
+by this package.\medskip
+
+\textbf{Discussion:} Enter an \emph{invalid date} into each field (such as
+the number 17), and \emph{commit} that number to the field. There are several
+ways of committing form data: (1) press the \uif{Enter} key; (2) tab out of the
+field; (3) click or tap outside the field; and (4) move to another
+page.\footnote{Apparently, \app{PDF-XChange Editor} does not commit field
+data when the page is turned, unlike the Adobe PDF viewer.} The behavior of
+the field is the same for cases (2)--(4); in those cases, the field loses
+focus (or is blurred). In the first case, the data is committed, but
+\emph{not blurred}. This latter case is a bit of a problem because the blur
+event has JavaScript that sets the field text color, as appropriate.\medskip
+
+In the above two fields, enter the number 17 (or any invalid date) and commit
+the data using method (2) or (3); now repeat the exercise for the two fields,
+but commit using method (1). Do you notice a difference?\medskip
+
+\textbf{Discussion of (2) and (3):} This is the usual case; after the alert
+dialog box is dismissed, the fields are grayed out again. That's the effect
+desired by this package.\medskip
+
+\textbf{Discussion of (1):} When the data is committed by pressing the
+\uif{Enter} key and the alert box is dismissed, for the field on the left
+`yyyy/mm/dd' appears in black, whereas, for the field on the right, the
+string `continue editing' appears in black. In each case, you can click
+within the field and continue editing the date. Use methods (2) or (3) to
+commit your final response. Of the two fields, the behavior of the field on
+the right is the preferred one.\medskip
+
+The behavior of the field on the right requires some special code.
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\small,numbers=left,numbersep=9pt,commandchars={!~@}]
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}
+ \AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+ \AAKeystroke{\DateKeyEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{\DateFmtEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray} % <-!normalfont~ required for !app~PDF-XChange Editor@@
+}]{Datefield2}{1in}{11bp}
+\end{Verbatim}
+The code above is identical to that of the left-hand field with two
+exceptions, marked above by (5) and~(7). On these lines, the commands
+\cs{DateKeyEx} and \cs{DateFmtEx} are used (instead of the Adobe built-in
+functions directly). When these two are inserted, then we get the behavior of
+the field on the right on page 1.\medskip
+
+
+
+When the changes shown in lines~(5) and~(7) are made, you can customize the
+behavior of the field when the date is committed by pressing the \uif{Enter}
+key.\medskip
+
+\EnterCommitFailEvent{event.value=("weiter bearbeiten");}
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}
+ \AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+ \AAKeystroke{\DateKeyEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{\DateFmtEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield3}{1in}{11bp}\medskip
+
+Here, we use \cs{EnterCommitFailEvent} and declare,
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\small]
+\EnterCommitFailEvent{event.value=("weiter bearbeiten");}
+\end{Verbatim}
+which changes the text string that appears when \uif{Enter} is pressed for an invalid date.\medskip
+
+\EnterCommitFailEvent{%
+ event.target.strokeColor=color.red;
+ event.value=(event.target.savevalue);}
+\CommitSuccessEvent{event.target.strokeColor=color.black;}
+We can get a different effect with
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\small]
+\EnterCommitFailEvent{%
+ event.target.strokeColor=color.red;
+ event.value=(event.target.savevalue);}
+\CommitSuccessEvent{event.target.strokeColor=color.black;}
+\end{Verbatim}
+The action declared by \cs{EnterCommitFailEvent} is to change the border
+color to red, and secondly, to set the value of the field to the saved value
+(\texttt{event.target.savevalue}). The property \texttt{savevalue} is defined
+through the use of the special commands \cs{DateKeyEx} and \cs{DateFmtEx}.
+The action of \cs{CommitSuccessEvent} returns the fields border color to
+black.\medskip
+
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}
+ \AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+ \AAKeystroke{\DateKeyEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{\DateFmtEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield4}{1in}{11bp}\medskip
+
+Now, when an invalid date is entered using the \uif{Enter} key, the border
+color of the field is changed to red to indicate to the user that the date
+in invalid and needs to be modified. Tabbing or clicking outside the field, as
+usual, blurs the field; any invalid date is removed and the grayed hint
+appears.\medskip
+
+To return to the default declarations, expand \verb!\EnterCommitFailEvent{}! and
+\verb!\CommitSuccessEvent{}!. The underlying default actions are,
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\small]
+\newcommand\FailStringDef{continue editing}
+\newcommand\EnterCommitFailDef{event.value=("\FailStringDef");}
+\end{Verbatim}
+A localization of language can be performed by redefining
+\cs{FailStringDef}
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\small]
+\renewcommand\FailStringDef{weiter bearbeiten}
+\end{Verbatim}
+
+The next example changes the border, the text color, and the error message.\medskip
+
+\EnterCommitFailEvent{\t
+ event.target.strokeColor=color.red;\r\t\t
+ event.target.textColor=color.red;\r\t\t
+ event.value=("needs editing");
+}
+\CommitSuccessEvent{\t\t
+ event.target.strokeColor=color.black;
+}
+
+\noindent
+\textField[\textColor{\matchGray}
+ \TU{Enter a date of your choosing}\AA{%
+ \AAOnFocus{\JS{\FocusToBlack}}
+% using a customized version of Adobe built-in functions, with LaTeX access
+ \AAKeystroke{\DateKeyEx("yyyy/mm/dd");\r
+ \KeyToGray}
+ \AAFormat{\DateFmtEx("yyyy/mm/dd");\r
+ \FmtToGray{yyyy/mm/dd}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Datefield5}{1in}{11bp}\qquad(enter `17' then press enter)\medskip
+
+This same scheme should work for all the built-in Acrobat formats, let's look
+at the number format.\medskip
+
+\EnterCommitFailEvent{}\CommitSuccessEvent{}
+\textField[\TU{Enter an integer}
+ \textColor{\matchGray}\AA{%
+ \AAKeystroke{\NumKey(0,1,0,0,"",true);\r\KeyToGray}
+ \AAFormat{\NumFmt(0,1,0,0,"",true);\r
+ \FmtToGray{Enter an Integer}}
+ \AAOnFocus{\JS{\FocusToBlack}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Integer}{1in}{11bp}\medskip
+
+\textbf{Creating a Percent text field.}\medskip
+
+\textField[\textColor{\matchGray}\AA{%
+ \AAKeystroke{\PercentKey(2,1);\r
+ \KeyToGray}
+ \AAFormat{\PercentFmt(2,1);\r
+ \FmtToGray{Enter a number}}
+ \AAOnFocus{\JS{\FocusToBlack}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Percent}{2in}{11bp} (don't enter the percent symbol \%)\medskip
+
+\textbf{Creating a Phone Number text field.}\medskip
+
+Enter a phone number: \textField[\textColor{\matchGray}\AA{%
+ \AAKeystroke{\SpecialKey(2);\r
+ \KeyToGray}
+ \AAFormat{\SpecialFmt(2);\r
+ \FmtToGray{(123) 456-7890}}
+ \AAOnFocus{\JS{\FocusToBlack}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Phone}{2in}{11bp}\medskip
+
+The underlying JS function tries hard to make a phone number out of the input. The phone number can
+be entered in any recognized format; even something like 1234567890 is formatted.\medbreak
+
+\textbf{Creating a Custom time format text field.}\medskip
+
+\def\parentt{(tt)} % necessary to insert within arg of \TimeFmtEx
+\textField[\textColor{\matchGray}\AA{%
+ \AAKeystroke{\TimeKey(0);\r
+ \KeyToGray}
+ \AAFormat{\TimeFmtEx("h:MM \parentt");\r
+ \FmtToGray{Enter a time}}
+ \AAOnFocus{\JS{\FocusToBlack}}
+ \AAOnBlur{\JS{\BlurToBlack}}
+ \AACalculate{\CalcToGray}
+}]{Time}{2in}{11bp}\kern1bp\pushButton[\TU{Push to Use Current Time}
+\CA{UCT}\A{\JS{%
+ var cTime=util.printd("h:MM",new Date());\r
+ var f=this.getField("Time");\r
+ f.value=cTime;
+}}]{pbTime}{}{11bp}\medskip
+
+Detailed information on formatting with the built-in functions of \app{Acrobat} may be found at
+the \href{http://blog.acrotex.net}{Acro\negthinspace\TeX\space Blog}; in particular, see the article
+\url{http://www.acrotex.net/blog/?p=218}.
+
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/grayhints/examples/gh-fmts-hyperref.tex b/Master/texmf-dist/doc/latex/grayhints/examples/gh-fmts-hyperref.tex
new file mode 100644
index 00000000000..ea8f2337ac2
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/grayhints/examples/gh-fmts-hyperref.tex
@@ -0,0 +1,257 @@
+\documentclass{article}
+\usepackage[designiv]{web}
+\usepackage[usehyforms]{grayhints}
+\usepackage{fancyvrb}
+
+
+\addtoWebHeight{1in}
+\def\cs#1{\texttt{\char`\\#1}}
+\let\app\textsf
+\let\pkg\textsf
+\let\uif\textsf
+\parindent0pt
+
+%\EnterCommitFailEvent{\jsT\jsT
+% event.target.strokeColor=color.blue;\jsR\jsT\jsT
+% event.value=(event.target.savevalue);}
+%\CommitSuccessEvent{event.target.strokeColor=color.red;}
+
+
+\begin{document}
+\begin{Form}
+\begin{center}\large\bfseries Gray Hints - Formats
+\end{center}
+The `gray hint' technique requires modifications to the Format,
+Keystroke, OnFocus, OnBlur, and Calculate events. Refer to \texttt{gh-fmts-eforms} for a more
+discussion of these fields.\medskip
+
+\renewcommand\LayoutTextField[2]{#2}
+\renewcommand\LayoutChoiceField[2]{#2}
+
+\TextField[%
+ name={Datefield1},
+ height=11bp,
+ width=1in,
+ color={\matchGray},
+ keystroke={AFDate_KeystrokeEx("yyyy/mm/dd");\jsR
+ \KeyToGray},
+ format={AFDate_FormatEx("yyyy/mm/dd");\jsR
+ \FmtToGray{yyyy/mm/dd}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{}\kern2bp\quad
+\TextField[%
+ name={Datefield2},
+ height=11bp,
+ width=1in,
+ color={\matchGray},
+ keystroke={\DateKeyEx("yyyy/mm/dd");\jsR
+ \KeyToGray},
+ format={\DateFmtEx("yyyy/mm/dd");\jsR
+ \FmtToGray{yyyy/mm/dd}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{}\medskip
+
+\textbf{Note:} In the discussion that follows, we assume you are using
+\app{Adobe Acrobat DC} (or prior), \app{Adobe Reader DC} (or prior) or
+\app{PDF-XChange Editor}. These PDF viewers support the JavaScript used
+by this package.\medskip
+
+The behavior of the field on the right requires some special code.
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\small,numbers=left,numbersep=9pt,commandchars={!~@}]
+\TextField[%
+ name={Datefield2},
+ height=11bp,width=1in,charsize=9bp,
+ color={\matchGray},
+ keystroke={\DateKeyEx("yyyy/mm/dd");\jsR
+ \KeyToGray},
+ format={\DateFmtEx("yyyy/mm/dd");\jsR
+ \FmtToGray{yyyy/mm/dd}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray} % <-!normalfont~ required for !app~PDF-XChange Editor@@
+]{}\end{Verbatim}
+The code above is identical to that of the left-hand field with two
+exceptions, marked above by (5) and~(7). On these lines, the commands
+\cs{DateKeyEx} and \cs{DateFmtEx} are used (instead of the Adobe built-in
+functions directly). When these two are inserted, then we get the behavior of
+the field on the right on page 1.\medskip
+
+When the changes shown in lines~(5) and~(7) are made, you can customize the
+behavior of the field when the date is committed by pressing the \uif{Enter}
+key.\medskip
+
+\EnterCommitFailEvent{event.value=("weiter bearbeiten");}
+\TextField[%
+ name={Datefield3},
+ height=11bp,width=1in,charsize=9bp,
+ color={\matchGray},
+ keystroke={\DateKeyEx("yyyy/mm/dd");\jsR
+ \KeyToGray},
+ format={\DateFmtEx("yyyy/mm/dd");\jsR
+ \FmtToGray{yyyy/mm/dd}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{}\medskip
+
+Here, we use \cs{EnterCommitFailEvent} and declare,
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\small]
+\EnterCommitFailEvent{event.value=("weiter bearbeiten");}
+\end{Verbatim}
+which changes the text string that appears when \uif{Enter} is pressed for an invalid date.\medskip
+
+\EnterCommitFailEvent{%
+ event.target.strokeColor=color.blue;
+ event.value=(event.target.savevalue);}
+\CommitSuccessEvent{event.target.strokeColor=color.red;}
+We can get a different effect with
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\small]
+\EnterCommitFailEvent{%
+ event.target.strokeColor=color.blue;
+ event.value=(event.target.savevalue);}
+\CommitSuccessEvent{event.target.strokeColor=color.black;}
+\end{Verbatim}
+The action declared by \cs{EnterCommitFailEvent} is to change the border
+color to blue, and secondly, to set the value of the field to the saved value
+(\texttt{event.target.savevalue}). The property \texttt{savevalue} is defined
+through the use of the special commands \cs{DateKeyEx} and \cs{DateFmtEx}.
+The action of \cs{CommitSuccessEvent} returns the fields border color to
+black.\medskip
+
+\TextField[%
+ name={Datefield4},
+ height=11bp,width=1in,charsize=9bp,
+ color={\matchGray},
+ keystroke={\DateKeyEx("yyyy/mm/dd");\jsR
+ \KeyToGray},
+ format={\DateFmtEx("yyyy/mm/dd");\jsR
+ \FmtToGray{yyyy/mm/dd}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{}\medskip
+
+Now, when an invalid date is entered using the \uif{Enter} key, the border
+color of the field is changed to blue to indicate to the user that the date
+in invalid and needs to be modified. Tabbing or clicking outside the field, as
+usual, blurs the field; any invalid date is removed and the grayed hint
+appears.\medskip
+
+To return to the default declarations, expand \verb!\EnterCommitFailEvent{}! and
+\verb!\CommitSuccessEvent{}!. The underlying default actions are,
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\small]
+\newcommand\FailStringDef{continue editing}
+\newcommand\EnterCommitFailDef{event.value=("\FailStringDef");}
+\end{Verbatim}
+A localization of language can be performed by redefining
+\cs{FailStringDef}
+\begin{Verbatim}[xleftmargin=15pt,fontsize=\small]
+\renewcommand\FailStringDef{weiter bearbeiten}
+\end{Verbatim}
+
+The next example changes the border, the text color, and the error message.\medskip
+
+\EnterCommitFailEvent{\jsT
+ event.target.strokeColor=color.blue;\jsR\jsT\jsT
+ event.target.textColor=color.blue;\jsR\jsT\jsT
+ event.value=("needs editing");
+}
+\CommitSuccessEvent{\jsT\jsT
+ event.target.strokeColor=color.red;
+}
+
+\noindent
+\TextField[%
+ name={Datefield5},
+ height=11bp,width=1in,charsize=9bp,
+ color={\matchGray},
+ keystroke={\DateKeyEx("yyyy/mm/dd");\jsR
+ \KeyToGray},
+ format={\DateFmtEx("yyyy/mm/dd");\jsR
+ \FmtToGray{yyyy/mm/dd}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{}\qquad(enter `17' then press enter)\medskip
+
+
+
+This same scheme should work for all the built-in Acrobat formats, let's look
+at the number format.\medskip
+
+\EnterCommitFailEvent{}\CommitSuccessEvent{}
+\TextField[%
+ name=Integer,
+ height=11bp,width=1in,charsize=9bp,
+ color={\matchGray},
+ keystroke={\NumKey(0,1,0,0,"",true);\jsR\KeyToGray},
+ format={\NumFmt(0,1,0,0,"",true);\jsR
+ \FmtToGray{Enter an Integer}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{}\smallskip
+
+\textbf{Creating a Percent text field.}\medskip
+
+\TextField[%
+ name=Percent,
+ height=11bp,width=2in,charsize=9bp,
+ color=\matchGray,
+ keystroke={\PercentKey(2,1);\jsR
+ \KeyToGray},
+ format={\PercentFmt(2,1);\jsR
+ \FmtToGray{Enter a number}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{} (don't enter the percent symbol \%)\medskip
+
+\textbf{Creating a Phone Number text field.}\medskip
+
+Enter a phone number: \TextField[%
+ name=Phone,
+ height=11bp,width=2in,charsize=9bp,
+ color=\matchGray,
+ keystroke={\SpecialKey(2);\jsR
+ \KeyToGray},
+ format={\SpecialFmt(2);\jsR
+ \FmtToGray{(123) 456-7890}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{}\medskip
+
+The underlying JS function tries hard to make a phone number out of the input. The phone number can
+be entered in any recognized format; even something like 1234567890 is recognized and formatted.\medbreak
+
+\textbf{Creating a Custom time format text field.}\medskip
+
+\def\parentt{(tt)} % necessary to insert within arg of \TimeFmtEx
+\TextField[%
+ name=Time,
+ height=11bp,width=2in,charsize=9bp,
+ color=\matchGray,
+ keystroke={\TimeKey(0);\jsR
+ \KeyToGray},
+ format={\TimeFmtEx("h:MM \parentt");\jsR
+ \FmtToGray{Enter a time}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{}\quad\PushButton[%
+ height=11bp,
+ name=pbtime,
+ onclick={var cTime=util.printd("h:MM",new Date());\jsR
+ var f=this.getField("Time");\jsR
+ f.value=cTime;}]{UCT}\medskip
+
+Detailed information on formatting with the built-in functions of \app{Acrobat} may be found at
+the \href{http://blog.acrotex.net}{Acro\negthinspace\TeX\space Blog}; in particular, see the article \url{http://www.acrotex.net/blog/?p=218}.
+
+\end{Form}
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/grayhints/examples/gh-hyperref.tex b/Master/texmf-dist/doc/latex/grayhints/examples/gh-hyperref.tex
index dcb240477ab..862b9d30dcd 100644
--- a/Master/texmf-dist/doc/latex/grayhints/examples/gh-hyperref.tex
+++ b/Master/texmf-dist/doc/latex/grayhints/examples/gh-hyperref.tex
@@ -6,16 +6,21 @@
\def\cs#1{\texttt{\char`\\#1}}
\parindent0pt
+%\EnterCommitFailEvent{\jsT\jsT
+% event.target.strokeColor=color.blue;\jsR\jsT\jsT
+% event.value=(event.target.savevalue);}
+%\CommitSuccessEvent{event.target.strokeColor=color.red;}
+
\begin{document}
\begin{Form}
\begin{center}\large\bfseries Gray Hints
\end{center}
The `gray hint' technique requires modifications to the Format,
-Keystroke, OnFocus, and OnBlur events.\medskip
+Keystroke, OnFocus, OnBlur, and Calculate events.\medskip
-\renewcommand\LayoutTextField[2]{#2}
-\renewcommand\LayoutChoiceField[2]{#2}
+\renewcommand\LayoutTextField[2]{\mbox{#2}}
+\renewcommand\LayoutChoiceField[2]{\mbox{#2}}
\TextField[%
name={Name.First},
@@ -25,7 +30,9 @@ Keystroke, OnFocus, and OnBlur events.\medskip
keystroke=\KeyToGray,
format={\FmtToGray{First Name}},
onfocus={\FocusToBlack},
- onblur={\BlurToBlack}]{First Name:}\quad
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{First Name:}\quad
\TextField[%
name={Name.Laat},
height=11bp,
@@ -34,17 +41,24 @@ Keystroke, OnFocus, and OnBlur events.\medskip
keystroke=\KeyToGray,
format={\FmtToGray{Last Name}},
onfocus={\FocusToBlack},
- onblur={\BlurToBlack}]{}\medskip
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{}\medskip
\TextField[%
name=Datefield,
height=11bp,
width=1in,
color={\matchGray},
- keystroke={AFDate_KeystrokeEx("yyyy/mm/dd");\KeyToGray},
- format={AFDate_FormatEx("yyyy/mm/dd");\FmtToGray{yyyy/mm/dd}},
+ keystroke={\DateKeyEx("yyyy/mm/dd");\jsR\KeyToGray},
+ format={\DateFmtEx("yyyy/mm/dd");\jsR\FmtToGray{yyyy/mm/dd}},
onfocus={\FocusToBlack},
- onblur={\BlurToBlack}]{}\medskip
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
+]{}\enspace$\Leftarrow$\enspace
+\parbox{\linewidth-1in-\widthof{\enspace$\Leftarrow$\enspace}}
+{\small Refer to \texttt{gh-fmts-hyperref.tex} for additional discussion of
+fields requiring special formatting.}\medskip
The next three fields perform calculations, the last one is the sum of the
first two. These are fields formatted as numbers. To prevent `Total' field
@@ -59,34 +73,37 @@ of the fields listed in \texttt{cArray} has a value and returns
height=11bp,
width=1in,
color={\matchGray},
- keystroke={AFNumber_Keystroke(0,1,0,0,"",true);\KeyToGray},
- format={AFNumber_Format(0,1,0,0,"",true); \FmtToGray{First Integer}},
- onfocus=\FocusToBlack,
- onblur=\BlurToBlack
+ keystroke={\NumKey(0,1,0,0,"",true);\KeyToGray},
+ format={\NumFmt(0,1,0,0,"",true); \FmtToGray{First Integer}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
]{}\smallskip
\TextField[%
name=Integer.Second,
height=11bp,
width=1in,
- color=\matchGray,
- keystroke={AFNumber_Keystroke(0,1,0,0,"",true); \KeyToGray},
- format={AFNumber_Format(0,1,0,0,"",true); \FmtToGray{Second Integer}},
- onfocus=\FocusToBlack,
- onblur=\BlurToBlack
+ color={\matchGray},
+ keystroke={\NumKey(0,1,0,0,"",true); \KeyToGray},
+ format={\NumFmt(0,1,0,0,"",true); \FmtToGray{Second Integer}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
]{}\smallskip
+% The use of \jsR (\jsT) is for editing purposes, should you have Acrobat or PDF-XChange Pro; otherwise, they are optional
\TextField[%
name=TotalNumber,
height=11bp,
width=1in,
- color=\matchGray,
- keystroke={AFNumber_Keystroke(0,1,0,0,"",true);\KeyToGray},
- format={AFNumber_Format(0,1,0,0,"",true); \FmtToGray{Total}},
- calculate={var cArray=new Array("Integer");
- if (AllowCalc(cArray))AFSimple_Calculate("SUM", cArray ); \CalcToGray},
- onfocus=\FocusToBlack,
- onblur=\BlurToBlack
+ color={\matchGray},
+ keystroke={\NumKey(0,1,0,0,"",true);\jsR\KeyToGray},
+ format={\NumFmt(0,1,0,0,"",true);\jsR\FmtToGray{Total}},
+ calculate={var cArray=new Array("Integer");\jsR
+ if (AllowCalc(cArray))\SimpleCalc("SUM", cArray );\jsR\CalcToGray},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack}
]{}\medskip
The gray hint technique can apply to editable combo boxes as well.\smallskip
@@ -96,12 +113,13 @@ The gray hint technique can apply to editable combo boxes as well.\smallskip
combo,
width=1.65in,
height=11bp,
- color={\matchGray},
edit,
- keystroke=\KeyToGray,
+ color={\matchGray},
+ keystroke={\KeyToGray},
format={\FmtToGray{Enter your favorite food}},
- onfocus=\FocusToBlack,
- onblur=\BlurToBlack
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
]{}{Meat,Potatoes,Rice,Onions,Pickles}\medskip
The color scheme of the gray hints can be changed using
@@ -109,23 +127,25 @@ The color scheme of the gray hints can be changed using
color of the text, must match, for appearance sake, the choice for the gray
color; for this reason, the \cs{matchGray} command was developed.\smallskip
+
\normalGrayColors{color.blue}{color.magenta}
\TextField[%
name=Pet,
width=1in,
height=11bp,
- color=\matchGray,
- keystroke=\KeyToGray,
- format=\FmtToGray{Pet's name},
- onfocus=\FocusToBlack,
- onblur=\BlurToBlack
+ color={\matchGray},
+ keystroke={\KeyToGray},
+ format={\FmtToGray{Pet's name}},
+ onfocus={\FocusToBlack},
+ onblur={\BlurToBlack},
+ calculate={\CalcToGray}
]{Pet}\medskip
\PushButton[%
height=11bp,
name=reset,
- onclick={this.resetForm();}]{Reset}\medskip
+ onclick={this.resetForm();}]{Reset}
\end{Form}
\end{document}