diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/grayhints/examples/gh-eforms.tex | 89 |
1 files changed, 40 insertions, 49 deletions
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} |