summaryrefslogtreecommitdiff
path: root/tex/context/base/spec-fdf.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/spec-fdf.tex')
-rw-r--r--tex/context/base/spec-fdf.tex118
1 files changed, 86 insertions, 32 deletions
diff --git a/tex/context/base/spec-fdf.tex b/tex/context/base/spec-fdf.tex
index 590c203bc..ee5e75c86 100644
--- a/tex/context/base/spec-fdf.tex
+++ b/tex/context/base/spec-fdf.tex
@@ -11,6 +11,16 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D Initialization of fields is tricky. If a field has no
+%D value, it is kind of not there. If ResetForm is used, the
+%D default is assigned, but pushbuttons are spoiled. Adding a
+%D \type {/MK} dictionary helps, but gives ugly down
+%D appearances (displaced with background). What a mess.
+%D Also, in order to get at least something, the \type {/AS}
+%D key should be provided.
+
+% to do : /IF << /SW /N >> == no scaling / clipping of widget
+
\unprotect
%D \macros
@@ -161,6 +171,10 @@
\ScaledPointsToWholeBigPoints{\number\!!heighta}\bottom
\ScaledPointsToWholeBigPoints{\number\!!widtha }\width
\ScaledPointsToWholeBigPoints{\number\!!heightb}\height
+% \ScaledPointsToBigPoints{#2}\left
+% \ScaledPointsToBigPoints{\number\!!heighta}\bottom
+% \ScaledPointsToBigPoints{\number\!!widtha }\width
+% \ScaledPointsToBigPoints{\number\!!heightb}\height
\xdef\currentPDFcropbox% \doPDFpagesattribute
{/CropBox [\left\space\bottom\space\width\space\height]}%
\xdef\currentPDFpagemode% \doPDFaddtocatalog
@@ -433,13 +447,15 @@
%D Running programs is possible, but rather non portable, and
%D therefore ill advized.
-\def\doPDFstartrunprogram#1#2#3%
+\def\doPDFstartrunprogram#1#2#3#4% new: #3 => #3#4
{\bgroup
- \edef\string{#3}%
- \@EA\beforesplitstring\string\at{ }\to\program
- \@EA\aftersplitstring \string\at{ }\to\parameters
+ %\edef\string{#3}%
+ %\@EA\beforesplitstring\string\at{ }\to\program
+ %\@EA\aftersplitstring \string\at{ }\to\parameters
+ %\edef\action%
+ % {/S /Launch /F (\program) /P (\parameters) /D (.)}%
\edef\action%
- {/S /Launch /F (\program) /P (\parameters) /D (.)}%
+ {/S /Launch /F (#3) /P (#4) /D (.)}%
\ifsecondaryreference
\savesecondaryPDFreference\action
\else
@@ -758,19 +774,40 @@
\let\FDFactions\empty
-\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8]%
+%\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8]%
+% {\global\let\FDFactions\empty
+% \setFDFaction D#1% mousedown
+% \setFDFaction U#2% mouseup
+% \setFDFaction E#3% enterregion
+% \setFDFaction X#4% exitregion
+% \setFDFaction K#5% afterkeystroke
+% \setFDFaction F#6% formatresult
+% \setFDFaction V#7% validateresult
+% \setFDFaction C#8% calculatewhatever
+% \ifx\FDFactions\empty\else
+% \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited
+% \fi}
+%% \setFDFaction A#2}% mouseup % changed for version 5
+
+\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8,%
{\global\let\FDFactions\empty
\setFDFaction D#1% mousedown
+% \setFDFaction U#2% mouseup
\setFDFaction E#3% enterregion
\setFDFaction X#4% exitregion
\setFDFaction K#5% afterkeystroke
\setFDFaction F#6% formatresult
\setFDFaction V#7% validateresult
\setFDFaction C#8% calculatewhatever
+ \setFDFactionsmore#2,}
+
+\def\setFDFactionsmore#1,#2,#3]%
+ {\setFDFaction{Fo}#2% focusin
+ \setFDFaction{Bi}#3% focusout
\ifx\FDFactions\empty\else
\xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited
\fi
- \setFDFaction A#2}% mouseup % becomes U !
+ \setFDFaction A#1}% mouseup
%D The event handler becomes something:
%D
@@ -779,24 +816,33 @@
%D /A << /S /JavaScript /JS (...) >>
%D \stoptypen
+% \def\setFDFaction#1#2%
+% {\bgroup
+% \global\let\sanitizedJScode\empty
+% \def\setFDFaction##1%
+% {\doifreferencefoundelse{##1}
+% {\doifelse{\currentreferencespecial}{JS} % filter non-js
+% {\presetJScode
+% \currentreferenceoperation
+% \currentreferencearguments
+% \doPSsanitizeJScode\JScode\to\JScode
+% \xdef\sanitizedJScode{\sanitizedJScode\space\JScode}}
+% {\illegalreference{##1}}}
+% {\unknownreference{##1}}}%
+% \@EA\processcommalist\@EA[#2]\setFDFaction % one level expansion
+% \ifx\sanitizedJScode\empty \else
+% \xdef\FDFactions%
+% {\FDFactions /#1 << /S /JavaScript /JS (\sanitizedJScode) >> }%
+% \fi
+% \egroup}
+%
+% acrobat 5 supports other that JS actions too
+
\def\setFDFaction#1#2%
{\bgroup
- \global\let\sanitizedJScode\empty
- \def\setFDFaction##1%
- {\doifreferencefoundelse{##1}
- {\doifelse{\currentreferencespecial}{JS} % filter non-js
- {\presetJScode
- \currentreferenceoperation
- \currentreferencearguments
- \doPSsanitizeJScode\JScode\to\JScode
- \xdef\sanitizedJScode{\sanitizedJScode\space\JScode}}
- {\illegalreference{##1}}}
- {\unknownreference{##1}}}%
- \@EA\processcommalist\@EA[#2]\setFDFaction % one level expansion
- \ifx\sanitizedJScode\empty \else
- \xdef\FDFactions%
- {\FDFactions /#1 << /S /JavaScript /JS (\sanitizedJScode) >> }%
- \fi
+ \def\docommando%
+ {\xdef\FDFactions{\FDFactions /#1 << \lastPDFaction >> }}%
+ \@EA\handlereferenceactions\@EA{#2}\docommando % one level expansion
\egroup}
%D \macros
@@ -1036,7 +1082,7 @@
\doPDFannotationobject class FDF name #1 width #2 height #3 data
{/Subtype /Widget /T (#1) /FT /Tx
/MaxLen \ifcase0#5 1000 \else#5 \fi
- /DV (#4) /V () % (#4) % value added
+ /DV (#4) /V (#4) % value added
/Ff \FDFflag\space
/F \FDFplus\space
/DA (\FDFattributes)
@@ -1050,7 +1096,7 @@
{/T (#1) /FT /Tx
/MaxLen \ifcase0#5 1000 \else#5 \fi
/Kids [\FDFkids]
- /DV (#4) /V () % (#4) % value added
+ /DV (#4) /V (#4) % value added
/Ff \FDFflag\space
/F \FDFplus\space
/DA (\FDFattributes)
@@ -1093,7 +1139,7 @@
\doPDFannotationobject class FDF name #1 width #2 height #3 data
{/Subtype /Widget
/T (#1) /FT /Ch
- /DV (#4) /V ()
+ /DV (#4) /V (#4)
/Ff \FDFflag\space
/F \FDFplus\space
/DA (\FDFattributes)
@@ -1106,7 +1152,7 @@
\doPDFdictionaryobject class FDF name #1 data
{/T (#1) /FT /Ch
/Kids [\FDFkids]
- /DV (#4) /V ()
+ /DV (#4) /V (#4)
/Ff \FDFflag\space
/F \FDFplus\space
/DA (\FDFattributes)
@@ -1153,7 +1199,11 @@
\doFDFdefault{#6}{#4}%
\doPDFannotationobject class FDF name #1 width #2 height #3 data
{/Subtype /Widget /T (#1) /FT /Btn
- \ifFDFvalues /DV /\FDFdefault\space /V ()\fi
+ \ifFDFvalues
+ /DV /\FDFdefault\space
+ /V /\FDFdefault\space
+ /AS /\FDFdefault\space
+ \fi
/Ff \FDFflag\space
/F \FDFplus\space
\FDFappearance\space
@@ -1165,7 +1215,11 @@
\doPDFdictionaryobject class FDF name #1 data
{/T (#1) /FT /Btn
/Kids [\FDFkids]
- \ifFDFvalues /DV /\FDFdefault\space /V ()\fi
+ \ifFDFvalues
+ /DV /\FDFdefault\space
+ /V /\FDFdefault\space
+ /AS /\FDFdefault\space
+ \fi
/Ff \FDFflag\space
/F \FDFplus\space
\FDFactions}%
@@ -1254,7 +1308,7 @@
\setFDFactions[#5]%
\doPDFdictionaryobject class FDF name #1 data
{/Subtype /Widget /FT /Btn /T (#1) /Rect [0 0 0 0]
- /DV /#2 % /V ()
+ /DV /#2 /V /#2
/H /N
/Ff \FDFflag\space /F \FDFplus\space /Kids [\FDFkids]
\FDFactions}%
@@ -1280,7 +1334,7 @@
\ifx\commalistelement\empty\else
\doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference
\edef\D{\ifFDFvalues\D /#1 \fi\PDFobjectreference\space}%
- \def\FDFappearance{/H /P}%
+ \def\FDFappearance{/H /P }%
\fi
\fi}
@@ -1288,7 +1342,7 @@
{\ifx#1\empty\else
\dogetcommacommandelement3\from#1\to\commalistelement
\ifx\commalistelement\empty\else
- \def\FDFappearance{/H /P}%
+ \def\FDFappearance{/H /P }%
\fi
\fi}