diff options
author | Karl Berry <karl@freefriends.org> | 2017-03-20 23:05:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-03-20 23:05:30 +0000 |
commit | 3ab396090f30955eb1ece56905cb5bda36e7b22b (patch) | |
tree | 8accb43050d4b3f1b19306486e8266b5cdcaf789 /Master/texmf-dist/doc/latex/grayhints/examples | |
parent | 9629eb95a35b6c79d6d31ff27653d3a006b25b9b (diff) |
grayhints (20mar17)
git-svn-id: svn://tug.org/texlive/trunk@43561 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/grayhints/examples')
-rw-r--r-- | Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.pdf | bin | 0 -> 37442 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex | 126 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/grayhints/examples/gh-hyperref.tex | 131 |
3 files changed, 257 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.pdf b/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.pdf Binary files differnew file mode 100644 index 00000000000..add08324cd3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.pdf diff --git a/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex b/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex new file mode 100644 index 00000000000..555e4af77c7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex @@ -0,0 +1,126 @@ +\documentclass{article} +\usepackage[designiv]{web} +\usepackage[usealtadobe]{grayhints}\previewOff + + +\addtoWebHeight{1in} +\def\cs#1{\texttt{\char`\\#1}} +\parindent0pt + + +\begin{document} + +\begin{center} + \large\bfseries Gray Hints +\end{center} +The `gray hint' technique requires modifications to the Format, +Keystroke, 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}\cgBdry[1em] +\textField[\textColor{\matchGray} + \TU{Enter your last name} + \AA{\AAFormat{\FmtToGray{Last Name}} + \AAKeystroke{\KeyToGray} + \AAOnFocus{\JS{\FocusToBlack}} + \AAOnBlur{\JS{\BlurToBlack}} +}]{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] + + +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 +from displaying a zero (0) when the dependent fields are empty (and to +display its gray hint instead), a document JavaScript function was developed, +named \texttt{AllowCalc(cArray)}. This function returns \texttt{true} if any +of the fields listed in \texttt{cArray} has a value and returns +\texttt{false}, otherwise.\vcgBdry[6bp] + +\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}} + \AAOnFocus{\JS{\FocusToBlack}} + \AAOnBlur{\JS{\BlurToBlack}}} +]{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}} + \AAOnFocus{\JS{\FocusToBlack}} + \AAOnBlur{\JS{\BlurToBlack}}} +]{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}} + \AACalculate{var cArray=new Array("Integer");\r + if (AllowCalc(cArray)) AFSimple_Calculate("SUM", cArray );\r\CalcToGray} + \AAOnFocus{\JS{\FocusToBlack}} + \AAOnBlur{\JS{\BlurToBlack}}} +]{TotalNumbers}{1in}{11bp}\vcgBdry[6bp] + + + +The gray hint technique can apply to editable combo boxes as well.\vcgBdry[3bp] +\comboBox[\textColor{\matchGray} + \TU{Enter or choose your favorite food}\Ff{\FfEdit} + \AA{\AAFormat{\FmtToGray{Enter your favorite food}} + \AAKeystroke{\KeyToGray} + \AAOnFocus{\JS{\FocusToBlack}} + \AAOnBlur{\JS{\BlurToBlack}} +}]{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] + +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} + +\textField[\textColor{\matchGray} + \TU{Enter your favorite pet's name} + \AA{\AAFormat{\FmtToGray{Pet's name}} + \AAKeystroke{\KeyToGray} + \AAOnFocus{\JS{\FocusToBlack}} + \AAOnBlur{\JS{\BlurToBlack}} +}]{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-hyperref.tex b/Master/texmf-dist/doc/latex/grayhints/examples/gh-hyperref.tex new file mode 100644 index 00000000000..dcb240477ab --- /dev/null +++ b/Master/texmf-dist/doc/latex/grayhints/examples/gh-hyperref.tex @@ -0,0 +1,131 @@ +\documentclass{article} +\usepackage[designiv]{web} +\usepackage[usehyforms]{grayhints} + +\addtoWebHeight{1in} +\def\cs#1{\texttt{\char`\\#1}} +\parindent0pt + + +\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 + +\renewcommand\LayoutTextField[2]{#2} +\renewcommand\LayoutChoiceField[2]{#2} + +\TextField[% + name={Name.First}, + height=11bp, + width=2in, + color={\matchGray}, + keystroke=\KeyToGray, + format={\FmtToGray{First Name}}, + onfocus={\FocusToBlack}, + onblur={\BlurToBlack}]{First Name:}\quad +\TextField[% + name={Name.Laat}, + height=11bp, + width=2in, + color={\matchGray}, + keystroke=\KeyToGray, + format={\FmtToGray{Last Name}}, + onfocus={\FocusToBlack}, + onblur={\BlurToBlack}]{}\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}}, + onfocus={\FocusToBlack}, + onblur={\BlurToBlack}]{}\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 +from displaying a zero (0) when the dependent fields are empty (and to +display its gray hint instead), a document JavaScript function was developed, +named \texttt{AllowCalc(cArray)}. This function returns \texttt{true} if any +of the fields listed in \texttt{cArray} has a value and returns +\texttt{false}, otherwise.\smallskip + +\TextField[% + name=Integer.First, + 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 +]{}\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 +]{}\smallskip + +\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 +]{}\medskip + +The gray hint technique can apply to editable combo boxes as well.\smallskip + +\ChoiceMenu[% + name=combo, + combo, + width=1.65in, + height=11bp, + color={\matchGray}, + edit, + keystroke=\KeyToGray, + format={\FmtToGray{Enter your favorite food}}, + onfocus=\FocusToBlack, + onblur=\BlurToBlack +]{}{Meat,Potatoes,Rice,Onions,Pickles}\medskip + +The color scheme of the gray hints can be 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.\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 +]{Pet}\medskip + +\PushButton[% + height=11bp, + name=reset, + onclick={this.resetForm();}]{Reset}\medskip + +\end{Form} +\end{document} |