% http://livedocs.adobe.com/flex/3/html/help.html?content=controls_12.html
% http://livedocs.adobe.com/flex/3/html/help.html?content=formatters_4.html
% http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/formatters/DateFormatter.html
% http://blog.flexexamples.com/2008/02/12/changing-the-next-and-previous-year-navigation-icons-on-a-datechooser-control-in-flex/
% http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf626ae-7feb.html
% http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/formatters/DateBase.html
% http://blog.flexexamples.com/2007/12/11/using-the-datebase-class-in-flex/
% http://blog.flexexamples.com/2008/11/07/adding-custom-context-menu-items-to-a-flex-application/
% http://flexdevtips.blogspot.com/2010/01/flex-context-menus.html
% http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d9b.html
% http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/DateChooser.html
% http://www.adobe.com/devnet/flash-builder.html
\documentclass{article}
\usepackage[fleqn]{amsmath}
\usepackage[%
    web={centertitlepage,usetemplates,designv,
        forcolorpaper,tight*,latextoc,pro},%usesf,
    eforms,uselayers,graphicxsp={showembeds},aebxmp
]{aeb_pro}
\usepackage{xbmks}
%\usepackage{myriadpro} %[usecmtt]
\usepackage[altbullet]{lucidbry}
\usepackage{datepicker-pro}
\usepackage{aeb_mlink}
\definePath{\dppPath}{C:/Users/Public/Documents/My TeX Files/%
    tex/latex/aeb/aebpro/datepicker-pro/swf}
\setpickerIcon{../icons/dp_icon1.pdf}{date1,PickADate}
\setpickerIcon{../icons/dp_icon2.pdf}{GERDate}
\setlength{\marginparwidth}{1.25in}
%\usepackage{array}

\DeclareInitView{layoutmag={navitab:UseOutlines}}
\xbmksetup{colors={int=red},styles={intbf}}


%\usepackage{makeidx}
%\makeindex
\usepackage{acroman}
\usepackage[active]{srcltx}
\urlstyle{rm}

\def\anglemeta#1{$\langle\textit{\texttt{#1}}\rangle$}
\def\meta#1{\textit{\texttt{#1}}}
\def\darg#1{\{#1\}}
\def\oarg#1{[#1]}

\def\DM#1{\marginpar{\raggedleft\small\cs{#1}}}

\DeclareDocInfo
{
    university={\AcroTeX.Net},
    title={\texorpdfstring{The \textsf{datepicker-pro} Package\\[1em]}
        {datepicker-pro: }Picking a date using Flash},
    author={D. P. Story},
    email={dpstory@acrotex.net},
    subject={Documentation of datepicker-pro from for AeB Pro},
    talksite={\url{www.acrotex.net}},
    version={1.4, 2020/08/07},
    keywords={AeB, Adobe Acrobat, JavaScript, datepicker, FLEX},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL={http://www.acrotex.net}
}

\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}%
   \kern-.6em \hbox{$\mathcal S$}}$}

\universityLayout{fontsize=Large}
\titleLayout{fontsize=LARGE}
\authorLayout{fontsize=Large}
\tocLayout{fontsize=Large,color=aeb}
\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb}
\subsectionLayout{indent=-31.25pt,color=aeb}
\subsubsectionLayout{indent=0pt,color=aeb}
\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}}

%\pagestyle{empty}
%\parindent0pt\parskip\medskipamount

\optionalPageMatter{\begin{center}
\fbox{\begin{minipage}{.67\linewidth}
\textbf{\color{red}End of Life of Software:}
As of \textbf{December 2020}, Adobe no longer supports Flash Player (SWF, FLV files).
This package uses a custom SWF file
(\texttt{datepicker3.swf} or \texttt{datepicker4.swf}); as a result this package will no longer function
in \app{Adobe Acrobat Reader DC} (dated Dec.~2020 or later). The package will continue to produce
PDFs as designed, \emph{but only if built using \emph{\textsf{Acrobat XI} (or a
version \textsf{Acrobat DC} prior to December 2020)} and viewed in \emph{\textsf{Adobe
Acrobat Reader XI} (or a version of \textsf{Reader DC} prior to December
2020)}. }\newtopic\noindent\textbf{\color{red}Important Note:}
In recent versions of \app{AA/AR}, a date field now has built-in date picker.
\hfill\dps
\end{minipage}}
\end{center}}

\chngDocObjectTo{\newDO}{doc}
\begin{docassembly}
var titleOfManual="The Datepicker Pro Manual";
var manualfilename="Manual_BG_Print_ddp.pdf";
var manualtemplate="Manual_BG_Blue.pdf"; // Blue, Green, Brown
var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate;
var doc;
var buildIt=false;
if ( buildIt ) {
    console.println("Creating new " + manualfilename + " file.");
    doc = \appopenDoc({cPath: _pathToBlank, bHidden: true});
    var _path=this.path;
    var pos=_path.lastIndexOf("/");
    _path=_path.substring(0,pos)+"/"+manualfilename;
    \docSaveAs\newDO ({ cPath: _path });
    doc.closeDoc();
    doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true});
    f=doc.getField("ManualTitle");
    f.value=titleOfManual;
    doc.flattenPages();
    \docSaveAs\newDO({ cPath: manualfilename });
    doc.closeDoc();
} else {
    console.println("Using the current "+manualfilename+" file.");
}
var _path=this.path;
var pos=_path.lastIndexOf("/");
_path=_path.substring(0,pos)+"/"+manualfilename;
\addWatermarkFromFile({
    bOnTop:false,
    bOnPrint:false,
    cDIPath:_path
});
\executeSave();
\end{docassembly}

\begin{document}

\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}

\section{Introduction}\label{s:intro}

% ff, fi, fl, ffl

Development for this work occurred in July 2013.\footnote{Then I forgot about it.} At that time a
cyber-colleague, G\"{u}nther F\"{u}llerer, sent me a \emph{date picker} he
had written using form fields. It was a very impressive work but created a
large number of form fields, one for each date in a calendar month. However,
instead of working on it myself, improving and generalizing it, I decided to
write a date picker package using a Flash window to display the dates, and
that is what I did. Below is the date picker without any options; it is set
up for English-style dates (MM/DD/YYYY).
\begin{quote} %\previewtrue
    Enter a date: \kern1bp\datepicker{date1}{1in}{11bp}\\[3bp]
    \phantom{Enter a date:} \kern1bp\verb!\datepicker{date1}{1in}{11bp}!
\end{quote}
Each use of the \cs{datepicker} command creates four PDF objects: (1) a
visible text field that displays the formatted date; (2) a visible push
button with an icon appearance; (3) a small hidden text field that
holds a ``shadow'' date, more on that later; and (4) a hidden rich media
annotation (RMA) which when activated creates a floating window that
displays a calendar.

The \cs{datepicker} command takes four arguments, the first of which is
optional. The first argument is used to modify the date picker, the second
is a unique name (\texttt{date1} in the above example), these are followed
by the width and height of the text input field.

\paragraph*{Evolution of date picking.} It has been several years since I first issued
the \pkg{datepicker-pro} package. Over that period, two events impact this package:
\begin{enumerate}
    \item Adobe has finally provided native support for date picking
        through its \app{Acrobat Reader DC} application (and in
        \app{Acrobat} itself, of course). Experience the date field below.
\begin{quote}%\previewOn
    \textField[\AA{%
      \AAKeystroke{AFDate_KeystrokeEx("m/d/yy")}
      \AAFormat{AFDate_FormatEx("m/d/yy")}
    }]{goNatDate}{1in}{11bp}\quad
\begin{minipage}[t]{2in}\small
\begin{Verbatim}
\textField[\AA{%
  \AAKeystroke{AFDate_KeystrokeEx("m/d/yy")}
  \AAFormat{AFDate_FormatEx("m/d/yy")}
}]{goNatDate}{1in}{11bp}
\end{Verbatim}
\end{minipage}
\end{quote}
This feature has been long in coming and is finally here. Of course, this
date picking feature is not supported in any other PDF viewer, but then,
these non-Adobe PDF viewers do not support the approach taken by this package
either.

To my knowledge, there is no way to control the design of the calendar that
appears as a popup; for example, a calendar in the German language cannot
be specified. Going under the assumption that the calendar will be in the
language of the \app{Reader DC} being used, I downloaded the German version
of \app{Reader DC} and determined that the calendar is not
localized to the viewer language. That's not good.

\item This package uses \app{Flash} technology, which is still supported by
    Adobe, but it has drawn some of the (user-interface) features offered
    to \app{Acrobat} users. \app{Flash} is probably not supported by any
    other PDF viewer.
\end{enumerate}
To take full advantage of this package, the end-user must use \app{Reader DC}
or higher.

\section{Requirements}

This package belongs to the high-class family of
\textsf{\textcolor{blue}{AeB~Pro}}, hence, the major requirement of this
package is that the PDF be created using \app{Adobe Distiller}, see
\hyperref[ss:PDFCreator]{Section~\ref*{ss:PDFCreator}} for details. Of course, if you have
\app{Distiller}, surely you have \app{Adobe Acrobat}, which is also
required in the workflow.

\subsection{{\LaTeX} package requirements}

 The package builds on packages developed as part of \textsf{AeB} or \textsf{AeB~Pro}:
\begin{itemize}
 \item\textsf{aeb\_pro}: supplies code to create icon appearances for the
 date picker push buttons.
 \item\textsf{rmannot}: the package for creating rich media annotations
 (SWF, FLV, etc); \textsf{rmannot} uses the \textsf{graphicxsp} package.
 \item\textsf{eforms}: used to create Acrobat form buttons and text
 fields, both hidden and visible. It also supplies JavaScript support as
 it imports the \textsf{insdljs} package.
\end{itemize}


\reversemarginpar

\subsection{PDF creator requirements}\label{ss:PDFCreator}

The big restriction on this package is the requirement to use
\app{Adobe Distiller} (version 6.0 or later). The package supports the
creation of PostScript using \textsf{dvips} and
\textsf{dvipsone}\marginpar{\raggedleft \textsf{dvipsone}\textsf{\\dvips}}. These
``drivers'' are defined through the required package \textsf{aeb\_pro}.

\subsection{Transparency requirements}

Transparency is only required to make the \EXT{RMA} transparent; unlike a form
field, a \EXT{RMA} does not have a hidden property, so we try to make it
transparent.

To get the transparency effect, you must distill using a \EXT{JOBOPTIONS} file
that supports transparency. The \pkg{datepicker-pro} package comes with an
\app{Distiller} job options file named
\texttt{Standard\_transparency.joboptions}. Instead of going through
the above rather tedious instructions, drop this file in the place
where \app{Distiller} expects to find its own \EXT{JOBOPTIONS}
files.\footnote{Go to \textsf{Settings > Edit Adobe PDF Settings}
in the \app{Distiller} application window, then click the \textsf{SaveAs}
button. A \textsf{Save Adobe PDF Settings As} dialog box opens and
you can then see where \app{Distiller} likes to save its
\texttt{.joboptions} file. Copy the provided \texttt{.joboptions} to
the folder and restart Distiller, the \texttt{Standard\_transparency}
should now be visible in the drop down \textsf{Default Settings}
list.}

If you distill without this \texttt{Standard\_transparency}, you get an
error message in the \textbf{Distiller} log that reads like this:
\begin{small}
\begin{Verbatim}
%%[Error: The PostScript contains Transparency pdfmark, job aborted.]%%
%%[ /AllowTransparency is false in job option settings.]%%
%%[ Error: undefined; OffendingCommand: pdfmark;
    ErrorInfo: Transparency Group ]%%
\end{Verbatim}
\end{small}%
This suggests that you should use a \EXT{JOBOPTIONS} file that supports
transparency! Look for the \texttt{Standard\_transparency.joboptions} file in
the \texttt{joboptions} folder of this distribution.

\subsection{Viewing requirements}

As with any document that contains more than just text content, \app{Adobe
Acrobat Reader} or \app{Adobe Acrobat} is required to actually see the
effects of the \pkg{datepicker-pro} package. Most third-party PDF readers do
not support interactive form fields, rich-media annotations, and Acrobat JavaScript API. Consumers
of your document need to use \app{Adobe Reader} or \app{Acrobat}.

%\section{Options of this package}
%There are no options for this package.

\section{The \texorpdfstring{\protect\pkg{datepicker-pro}}{datepicker-pro} commands}

We document the commands required in the preamble, the configuration file, and one that can
be placed in the preamble or the body of the document.

\subsection{Commands for the preamble}

A typical preamble would contain the necessary packages required by
\pkg{datepicker-pro}:
\begin{minipage}[t]{\linewidth}\kern0pt
\begin{minipage}[t]{.5\linewidth}\kern0pt
\begin{Verbatim}[fontsize=\small,commandchars=!()]
\documentclass{article}
\usepackage[%
    driver=dvips,
    web={extended,tight*,usesf},
    eforms,graphicxsp={showembeds}
]{aeb_pro}
\usepackage{rmannot}
\usepackage{datepicker-pro}
\end{Verbatim}
\end{minipage}\hfill
\begin{minipage}[t]{.5\linewidth}\kern0pt
\begin{Verbatim}[fontsize=\small,commandchars=!()]
\documentclass{article}
\usepackage[%
    driver=dvips,
    web={extended,tight*,usesf},
    eforms,graphicxsp={showembeds},
    rmannot
]{aeb_pro}
\usepackage{datepicker-pro}
\end{Verbatim}
\end{minipage}
\end{minipage}
\newtopic\newtopic The use of the \pkg{web} package is optional. On the left is the
traditional way of using the \pkg{rmannot} package, followed by the
\pkg{datepicker-pro} package. More recently (2013/08/05), I've made
the \pkg{rmannot} an option of the \pkg{aeb\_pro} package. Shown on the right
is the \texttt{rmannot} option for \pkg{aeb\_pro}.


\bVerb\takeMeasure{\string\definePath\darg{\string\dppPath}\darg{\meta{path}}}%
\begin{dCmd}[commandchars=!()]{\bxSize}
\useFLEXVer{3|4}
\definePath{\dppPath}{!meta(path)}
\setpickerIcon{!meta(path)}{!meta(list)}
\end{dCmd}
\endgroup\noindent
The \cs{useFLEXVer}\DM{useFLEXVer} command declare what version of \EXT{FLEX}
is to be used,\footnote{Adobe has since re-branded \EXT{FLEX} to \app{Adobe
Flash Builder}.}  choices are 3 or 4, corresponding to \EXT{FLEX~3.6} and
\EXT{FLEX~4.5}, respectively. I've found the version~4 is very slow in
loading; not recommended. If \cs{useFLEXVer} is not present in the preamble,
version~3 is used by default.

The \cs{definePath\darg{\cs{dppPath}}}\DM{dppPath}
charts out the path to the date picker SWF file; there are two versions
\texttt{datepicker3.swf} and \texttt{datepicker4.swf}. The \cs{definePath}
command is defined in \pkg{eforms} is simply allows you construct paths
with normally forbidden characters. The \cs{dppPath} command is expected
by \pkg{datepicker-pro} to be defined; otherwise, the file will not
compile. The \meta{path} needs to be an \emph{absolute path} on your file
system that points to the location of the \EXT{SWF} files. The declaration
of the path \cs{dppPath} may be moved to the configuration file\marginpar{\small\raggedleft{config file}},
the topic of \hyperref[s:config]{Section~\ref*{s:config}}

Finally, the \cs{setpickerIcon}\DM{setpickerIcon} declares the \meta{path} to
the date picker icon; this is a relative (or absolute) path and includes the
icon file in the path. The argument \meta{list} is a comma-delimited list of
names of each of the date picker fields created in the document. If you want
to have several date picker fields, some of which have different date picker
icons, then you need to declare additional icons using \cs{setpickerIcon}.
The dimensions of the icon are determined by the command declarations
\cs{setpickerIconWidth} and \cs{setpickerIconHeight}, these are discussed in
\hyperref[s:PB]{Section~\ref*{s:PB}}. These latter two commands may be
declared in the preamble or in the body of the document. This package
distribution provides to icon files \texttt{dp\_icon1.pdf},
\texttt{dp\_icon2.pdf}, \dots, \texttt{dp\_icon7.pdf}, found in the \texttt{icons} folder.\footnote{My thanks to
J\"{u}rgen Gilg for providing additional icon files.}


\newtopic\noindent
The following illustrates the above three commands.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()]
%\useFLEXVer{4} % 3 or 4
\definePath{\dppPath}{C:/Users/Public/Documents/My TeX Files/%
    tex/latex/aeb/aebpro/datepicker-pro/swf}
\setpickerIcon{../icons/dp_icon2.pdf}{date1,PickADate,GERDate}
\end{Verbatim}
In this example, there are three date fields created, each of them is
given the appearance of the icon file \texttt{dp\_icon2.pdf}.
Or, we can declare,
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()]
% !normalfont!texttt(\dppPath) moved to !texttt(dp-pro.cfg), see !hyperref[s:config](Section !ref(s:config)).
\setpickerIcon{../icons/dp_icon1.pdf}{date1,PickADate}
\setpickerIcon{../icons/dp_icon2.pdf}{GERDate}
\end{Verbatim}
where a different icon is used for the \texttt{GerDate} date picker.

\subsection{The configuration file}\label{s:config}

Rather than placing the path to the \texttt{swf} folder of this distribution in each
file, you can place the declared path in the package configuration file, \texttt{dp-pro.cfg}.
The file is found in the root directory of the package distribution. An example of its contents
is given below.
\begin{Verbatim}
%
% datepicker-pro configuration file
%
\definePath{\dppPath}{C:/Users/Public/Documents/My TeX Files/%
    tex/latex/aeb/aebpro/datepicker-pro/swf}
\end{Verbatim}
Edit this file to reflect the absolute path to the \texttt{swf} folder of
this distribution on your file system.

\subsection{Commands for the body of the document}

Within the body of the document, there is only one command, \cs{datepicker}:
\bVerb\takeMeasure{\cs{datepicker}[\meta{options}]\darg{\meta{name}}\darg{\meta{width}}\darg{\meta{height}}}%
\begin{dCmd}[commandchars=!()]{\bxSize}
\datepicker[!meta(options)]{!meta(name)}{!meta(width)}{!meta(height)}
\end{dCmd}
\endgroup\noindent
The \meta{name} argument should consist only of letters or numbers
(however, a number must not be the first character in the name); for
example, \texttt{date1} or \texttt{PickADate} is acceptable. The
\meta{name} argument is used to build names for the components of
the date picker field. The input text field, which is set to read only, is
named \texttt{txt\anglemeta{name}}, the push button is named
\texttt{btn\anglemeta{name}}, the hidden text field is named
\texttt{htxt\anglemeta{name}}, and finally, the RMA has a name of
\meta{name}. The \meta{width} and \meta{height} arguments are standard
to form fields, as defined by \pkg{eforms}. These two dimensions are applied
to the input text field only.

Now for the \meta{options} argument of \cs{datepicker}. The options consist
of key-value pairs (\texttt{key=value}) and are rather numerous.
\begin{itemize}\def\DescribeMacro#1{}
\item \textbf{Format date string}\vskip-.5\baselineskip\kern0pt
    \begin{itemize}
    \item\texttt{formatstring}: The value of the \texttt{formatstring} key
        uses various combinations of \texttt{M}, \texttt{D}, \texttt{Y},
        and possible \texttt{E} as well as spaces and delimiters to format
        the date string. The following table was extracted from the page:
\begin{quote}\raggedright\urlstyle{tt}
\mlurl{http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/formatters/DateFormatter.html}
\end{quote}\bigskip
\item[]\begin{tabular}{cp{1.4in}cp{1.4in}}
 \multicolumn{4}{c}{\bfseries Table of Formatting Patterns}\\\hline
 \textbf{Pattern} & \textbf{Examples} &\textbf{Pattern} & \textbf{Examples}\\
 \texttt{Y} & \texttt{YY = 05}\par \texttt{YYY=2005}\par\texttt{YYY=02005}&
 \texttt{D} &\texttt{D = 4}\par \texttt{DD=04}\\
 \texttt{M} &  \texttt{M = 7}\par \texttt{MM=07}\par\texttt{MMM=Jul}\par\texttt{MMMM=July}&
 \texttt{E} & \texttt{E = 1}\par \texttt{EE=01}\par\texttt{EEE=Mon}\par\texttt{EEEE=Monday}\\
\end{tabular}\bigskip
\item[] One example is \verb!formatstring={EEEE, DD. MMMM YYYY}!. The default
formatting string is \verb!formatstring={MM/DD/YYYY}!.
 \end{itemize}
\item \textbf{Formatting the calendar.} The \textsf{dateChooser} control that
    is used in the \EXT{SWF} file contains the name of the month at the top
    and the names of the days of the week just below it. By default, the
    usual English month names are used (January, February, \dots,December)
    and the usual English days of the week names are used (Sunday, Monday,
    \dots,Saturday). However, these can be changed through the use of
    \texttt{monthnames} and \texttt{daynames} key.

    \textbf{A note on Unicode.} Any glyph outside the range of Basic Latin (U0020-U007F), unicode notation may
    be used. For example the German word for March is M\"{a}rz; it must be
    specified as \verb~M\u00E4rz~, see the example of German dates presented below.
    \begin{itemize}
        \item \texttt{daynames}: The names of the days that appear on the
            popup calendar. The value of \texttt{daynames} is a
            comma-delimited list of seven names for the days. The default
            is \verb!daynames={S,M,T,W,T,F,S}!. These labels appear if the
            \texttt{daynames} key is not used.
        \item \texttt{monthnames}: The names of the months
            that appear on the popup calendar. The value for
            \texttt{monthnames} is a comma-delimited list of twelve names
            of the months. The default is
            \verb!monthnames={January,February,...,December}!. These
            labels appear if the \texttt{monthnames} key is not used.
    See the initial date picker example on page~\pageref*{s:intro} for an
    example of these default values.
    \item[] Other possible values for these, in the English language, are
\begin{Verbatim}[xleftmargin=20pt]
monthnames={Jan,Feb,Mar,Apr,May,June,July,Aug,Sept,Oct,%
    Nov,Dec}.
daynames={Su,M,Tu,W,Th,F,Sa}
\end{Verbatim}
There should be no spurious spaces in the values of any of these keys; in
the listing above, I've wrapped the months around to a new line, and
inserted a comment character (\texttt{\%}) to kill any space that may be
generated.
\item[] The order must be the first month of the year (January, or the
    equivalent in another language) and the first day of the week (Sunday,
    or its equivalent). Some calendars consider Monday as the first day of
    the week, if this is so, \emph{still} place Sunday, or its local
    equivalent, as the first entry in the list. A different starting day
    is set using the \texttt{firstday} key.
    Setting \texttt{firstday=1} puts Monday as the first day of the week
    on the calendar.
\item \texttt{firstday}: The value of the key \texttt{firstday} is an integer, 0\dots7.
The default is~0.
\end{itemize}
\item[] Next is an example of some German names.
\begin{Verbatim}[xleftmargin=\amtIndent]
daynames={So,Mo,Di,Mi,Do,Fr,Sa},
monthnames={Jan,Febr,Mrz,Apr,Mai,Jun,Jul,Aug,Sept,Okt,%
    Nov,Dez},
firstday=1
\end{Verbatim}
On the German calendar, \emph{Montag} (\emph{Mo}) is the first day of the week.
 \item \textbf{Formatting the Month and Day in the return value.} When the
     date string is returned to the input text field it is formatted
     according to the value of the key \texttt{formatstring}. The keys is
     this section are useful only if your \texttt{formatstring} contains
     any of the formatting combinations \texttt{MMM}, \texttt{MMMM},
     \texttt{DDD}, or \texttt{DDDD}. These indicate you want the month or
     day word-names returned, rather than a numerical value.

     \item[] The four keys below take as a value of comma-delimited list of names.

%     These should be consistent with
%     the calendar headings as well. You don't want English days of the
%     week on a German calendar. The key
    \begin{itemize}
     \item\texttt{monthnamesLong}: The long name of the months and is used with
     \texttt{MMMM} formatting pattern.
     \item \texttt{monthnamesShort}: The short name of the months, used
     when \texttt{MMM} is the formatting pattern.
     \item \texttt{daynamesLong}: The long names for the days of the week,
         used for formatting \texttt{DDDD}.
     \item \texttt{daynamesShort}: The short names for the days of the
         week and is used with \texttt{DDD}.
    \end{itemize}
    \item[] The defaults are the English counterparts: January/Jan, Sunday/Sun.
    \item[] For the German language, we can set these values as follows:
\begin{Verbatim}[xleftmargin=20pt]
daynamesLong={Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,%
    Freitag,Samstag},
daynamesShort={So,Mo,Di,Mi,Do,Fr,Sa},
monthnamesLong={Januar,Februar,M\u00E4rz,April,Mai,Juni,%
  Juli,August,September,Oktober,November,Dezember},
monthnamesShort={Jan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,%
  Okt,Nov,Dez},
\end{Verbatim}
\item[] Again, always list January (\textsl{Januar}/\textsl{Jan}) and
    Sunday (\textsl{Sonntag}/\textsl{So}) first.
\item \textbf{Positioning the floating window}.
 These keys determine the positioning of the floating windows when it
 opens. The default is the center of the window (for versions > 9), for
 version~9, this key is ignored and the window appears in the upper-right
 of the application window. See the documentation of the \texttt{rmannot}
 package for more detail.
 \begin{itemize}
    \item \texttt{halign}: The horizontal positioning of the floating
        window, permissible values are \texttt{near}, \texttt{center}, and
        \texttt{far}. The default is \texttt{center}.
    \item \texttt{valign}: The vertical positioning of the floating
        window, permissible values are \texttt{near}, \texttt{center}, and
        \texttt{far}. The default is \texttt{center}.
    \item \texttt{hoffset}: The amount of horizontal offset from the initial horizontal
    alignment (\texttt{halign}). See the documentation of the
 \texttt{rmannot} package for more detail. Measured in default user space
 units (pixels). The default is~0.
    \item \texttt{voffset}: The amount of vertical offset from the initial
        vertical alignment (\texttt{valign}). See the documentation of the
        \texttt{rmannot} package for more detail.  Measured in default
        user space units (pixels). The default is~0.
 \end{itemize}
\item \textbf{Setting the dimensions of the window.}
\begin{itemize}
    \item \texttt{widthOfWindow}: The width of the floating window as
        measured in default user space units (pixels). The default
    for this package is~180.
    \item \texttt{heightOfWindow}: The height of the floating window as
        measured in default user space units (pixels). The default
    for this package is~180.
\end{itemize}
\end{itemize}
Options can be bundled into a command and passed as the first argument, as this example
of the German calendar illustrates.

\newcommand{\germanDates}
{%
%    formatstring=DD.MM.YYYY,
    formatstring={EEEE, DD. MMMM YYYY},
    daynames={So,Mo,Di,Mi,Do,Fr,Sa},
    monthnames={Jan,Febr,Mrz,Apr,Mai,Jun,Jul,Aug,Sept,%
        Okt,Nov,Dez},
    daynamesLong={Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,%
        Freitag,Samstag},
    daynamesShort={So,Mo,Di,Mi,Do,Fr,Sa},
    monthnamesLong={Januar,Februar,M\u00E4rz,April,Mai,Juni,Juli,%
        August,September,Oktober,November,Dezember},
    monthnamesShort={Jan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,%
        Sep,Okt,Nov,Dez},
    firstday=1,
    widthOfWindow=200,heightOfWindow=200,
}
\begin{flushleft}%\previewtrue
Wählen Sie ein Datum:\ \kern1bp\datepicker[\germanDates]{GERDate}{2in}{11bp}\quad
(EEEE, DD. MMMM YYYY)
\end{flushleft}

The verbatim listing of this last field is given below.
\begin{Verbatim}[xleftmargin=20pt,fontsize=\small]
\newcommand{\germanDates}
{%
%    formatstring=DD.MM.YYYY,
    formatstring={EEEE, DD. MMMM YYYY},
    daynames={So,Mo,Di,Mi,Do,Fr,Sa},
    monthnames={Jan,Febr,Mrz,Apr,Mai,Jun,Jul,Aug,Sept,%
        Okt,Nov,Dez},
    daynamesLong={Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,%
        Freitag,Samstag},
    daynamesShort={So,Mo,Di,Mi,Do,Fr,Sa},
    monthnamesLong={Januar,Februar,M\u00E4rz,April,Mai,Juni,Juli,%
        August,September,Oktober,November,Dezember},
    monthnamesShort={Jan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,%
        Sep,Okt,Nov,Dez},
    firstday=1,
    widthOfWindow=200,heightOfWindow=200
}
\begin{flushleft}
Wählen Sie ein Datum:\ \kern1bp
\datepicker[\germanDates]{GERDate}{2in}{11bp}\quad(EEEE, DD. MMMM YYYY)
\end{flushleft}
\end{Verbatim}

\subsection{Commands for the preamble or the body}\label{s:PB}

\def\lp{(}\def\rp{)}

There are a few other commands to mention, the declaration or definition take effect
with the next date picker command \cs{datepicker}.
\bVerb\takeMeasure{\string\renewcommand\darg{\string\pickersep}\darg{\meta{length}}}%
\setlength\textscreenwidth{\bxSize-2\fboxsep}%
\def\1{\rlap{\hspace*{\textscreenwidth}\quad\normalfont(\texttt{3pt}\normalfont)}}%
\def\2{\rlap{\hspace*{\textscreenwidth}\quad\normalfont(\texttt{10pt}\normalfont)}}%
\def\3{\rlap{\hspace*{\textscreenwidth}\quad\normalfont(\texttt{12pt}\normalfont)}}%
\takeMeasure{\string\renewcommand\darg{\string\pickersep}\darg{\meta{length}}%
\quad\normalfont({\texttt{12bp}\normalfont)}}%
\begin{dCmd}[commandchars=!()]{\bxSize}
\dppToolTip{!meta(text)}
\pickerOpts{!meta(key-values)}
\pickerInputOpts{!meta(key-values)}
!1\renewcommand{\pickersep}{!meta(length)}
!2\pickerIconWidth{!meta(length)}
!3\pickerIconHeight{!meta(length)}
\end{dCmd}
\endgroup\noindent
The \cs{dppToolTip}\DM{dppToolTip} command is used to create a tool tip, text the user sees when
he/she rolls over the push button icon. The default is
\begin{Verbatim}[xleftmargin=20pt,commandchars=!()]
\dppToolTip{Date Picker\n Click to toggle open and close\n
    Shift-click to clear and close}
\end{Verbatim}
When the user click on the icon, and the calendar is not open, the floating window opens.
If the window is open and the user clicks on the icon, the window is closed. If the user
shift-clicks and the window, the date field is cleared and the window is closed, if open.

The \cs{pickerOpts}\DM{pickerOpts} command lets you
pass additional options to the RMAs created by this package. The default
is \cs{pickerOpts\darg{}}. See the documentation of the \pkg{rmannot}
package for more details.

The \cs{pickerInputOpts}\DM{pickerInputOpts} allows
you to pass additional options to the input text field. The default is
\cs{pickerInputOpts\darg{}}. See the documentation of the \pkg{eforms}
package for details. We illustrate this last feature:
\begin{quote}
    \pickerInputOpts{\BC{red}\textColor{blue}\Q{1}}%
    Pick a date: \kern1bp\datepicker{PickADate}{1in}{11bp}\\[3bp]
    \phantom{Enter a date:} \kern1bp\verb!\datepicker{PickADate}{1in}{11bp}!
\end{quote}
\begin{Verbatim}[xleftmargin=20pt]
\pickerInputOpts{\BC{red}\textColor{blue}\Q{1}}%
Pick a date: \kern1bp\datepicker{PickADate}{1in}{11bp}
\end{Verbatim}
Here, we use a red boundary, blue text color, and center the date.

Any changes to \cs{pickerOpts} and \cs{pickerInputOpts} are global unless expanded
within a group. Of course, you can bring these options back to their defaults by expanding
\cs{pickerOpts\darg{}} and \cs{pickerInputOpts\darg{}}.

The command \cs{pickersep}\DM{pickersep} sets the amount spacing between the right edge of the input
text field and the left edge of the picker push button. The default is \texttt{3bp}.

Finally, the command declarations, \cs{pickerIconWidth}\DM{pickerIconWidth} and
\cs{pickerIconHeight}\DM{pickerIconHeight}, determine the width and the height of the date
picker icon. The defaults for are shown in parentheses above.


\newtopic\noindent
That's all for now, I simply must get back to my retirement. \dps

\end{document}
