pdfform.module: unset a PassTru

- this makes real life much easier since it saves more TeX code than with passThru
- adapt the example file accordingly
This commit is contained in:
Uwe Stöhr 2015-05-05 01:33:11 +02:00
parent 7dbf98a5e7
commit 9f3d1e7773
2 changed files with 478 additions and 182 deletions

View File

@ -390,7 +390,6 @@ Insets
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -435,7 +434,8 @@ status open
\series bold \series bold
Note: Note:
\series default \series default
All braces and brackets in form parameters must be inserted as TeX code! All braces, brackets, backslashes and quote characters in form parameters
must be inserted as TeX code!
\end_layout \end_layout
\end_inset \end_inset
@ -465,7 +465,6 @@ fields as example: Fill one and see that the other one will also be filled
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -489,7 +488,6 @@ name=identic
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -533,14 +531,46 @@ cm height and a proposed content:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
name=customer2, multiline, width=0.6 name=customer2, multiline, width=0.6
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash \backslash
textwidth, height=3cm, value={Testman} textwidth
\end_layout
\end_inset
, height=3cm, value=
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{
\end_layout
\end_inset
Testman
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
}
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -603,7 +633,6 @@ CheckBox
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -711,7 +740,6 @@ Here is an example for the radio type:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -753,7 +781,6 @@ Here is an example for the combo type:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -795,7 +822,6 @@ Here is an example for the popdown type:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -899,7 +925,6 @@ default=m
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -974,7 +999,6 @@ PushButton
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -1007,13 +1031,56 @@ onclick={}
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
onclick={app.alert("What the hell? Now you destroyed your fridge. onclick=
Congratulations.")} \begin_inset ERT
status collapsed
\begin_layout Plain Layout
{
\end_layout
\end_inset
app.alert(
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
"
\end_layout
\end_inset
What the hell? Now you destroyed your fridge.
Congratulations.
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
"
\end_layout
\end_inset
)
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
}
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -1039,40 +1106,8 @@ key "JavaScript"
\begin_layout Standard \begin_layout Standard
A common usage for pus buttons is to open a weblink. A common usage for pus buttons is to open a weblink.
Such a button is created by inserting the command Such a button is created by inserting a hyperlink into the button inset.
\series bold Here is an example:
\backslash
href
\series default
into the button inset.
\series bold
\backslash
href
\series default
is used in the scheme
\begin_inset Newline newline
\end_inset
\series bold
\backslash
href{link target}{text}
\end_layout
\begin_layout Standard
In the following button this code was used:
\begin_inset Newline newline
\end_inset
\series bold
\backslash
href{http://wiki.lyx.org}{Information how to fill out this form}
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
@ -1080,7 +1115,6 @@ href{http://wiki.lyx.org}{Information how to fill out this form}
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -1091,8 +1125,14 @@ status open
\end_inset \end_inset
\backslash \begin_inset CommandInset href
href{http://wiki.lyx.org}{Information how to fill out this form} LatexCommand href
name "Information how to fill out this form"
target "http://wiki.lyx.org"
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -1151,7 +1191,6 @@ SubmitButton
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -1253,7 +1292,6 @@ ResetButton
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -1518,7 +1556,6 @@ characters to insert:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -1605,7 +1642,6 @@ ding{55}:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -1670,7 +1706,6 @@ Combo box with dashed, colored border:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -1716,7 +1751,6 @@ entries are shown and where the last entry is preselected:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -1795,7 +1829,6 @@ Radio box with inverted bevel border and symbol number
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -1837,21 +1870,88 @@ Push button with a bevel border and colored text:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
onclick={app.alert("Why do you click this?")} onclick=
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{
\end_layout
\end_inset
app.alert(
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
"
\end_layout
\end_inset
Why do you click this?
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
"
\end_layout
\end_inset
)
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
}
\end_layout \end_layout
\end_inset \end_inset
\end_layout
\end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash \backslash
colorbox{lime}{ colorbox{lime}{
\backslash \end_layout
textcolor{red}{Don't click on this button!!!}}
\end_inset
\color red
Don't click on this button!!!
\color inherit
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
}
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -1911,23 +2011,7 @@ Colored Boxes
\emph on \emph on
EmbeddedObjects EmbeddedObjects
\emph default \emph default
manual and manual.
\series bold
\backslash
textcolor
\series default
that is used is used in the scheme
\begin_inset Newline newline
\end_inset
\series bold
\backslash
textcolor{color}{characters to color}
\series default
\begin_inset Newline newline \begin_inset Newline newline
\end_inset \end_inset
@ -1939,9 +2023,13 @@ In the button above this code was used:
\family sans \family sans
\backslash \backslash
colorbox{lime}{ colorbox{lime}{Don't click on this button!!!}
\backslash \family default
textcolor{red}{Don't click on this button!!!}}
\begin_inset Newline newline
\end_inset
and the button text was colored.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
@ -1998,7 +2086,6 @@ Submit button without border, with cyan background color and increased height:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -2009,14 +2096,62 @@ name=submit2
\end_inset \end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash \backslash
colorbox{cyan}{ colorbox{cyan}{
\end_layout
\end_inset
\begin_inset Box Frameless
position "c"
hor_pos "c"
has_inner_box 1
inner_pos "c"
use_parbox 1
use_makebox 0
width "5cm"
special "none"
height "4in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash \backslash
parbox[c][4 centering
\backslash \end_layout
totalheight]{5cm}{
\backslash \end_inset
centering Send your data via mail}}
Send your data via mail
\end_layout
\end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
}
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -2046,7 +2181,6 @@ cm:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -2057,8 +2191,38 @@ name=reset2
\end_inset \end_inset
\begin_inset Box Frameless
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 0
use_makebox 1
width "7cm"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash \backslash
makebox[7cm]{Reset the form} centering
\end_layout
\end_inset
Reset the form
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -2139,7 +2303,6 @@ Printing:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -2167,7 +2330,6 @@ as:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -2199,7 +2361,6 @@ fullscreen:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -2229,56 +2390,22 @@ name "sub:Action-button-customization"
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
Customizing the action buttons requires some complicated LaTeX code because Customizing the action buttons requires the usage of boxes because things
things like the width, height and border separation cannot be specified like the width, height and border separation cannot be specified as button
as button parameters. parameters.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
The easiest way to customize the buttons is to fill it with a custom box: The easiest way to customize the buttons is to fill it with a custom box.
\end_layout For example the button should be 4
\begin_layout Enumerate
Create a normal LyX box of your choice
\end_layout
\begin_layout Enumerate
Use the menu
\family sans
View\SpecialChar \menuseparator
Source
\begin_inset space ~
\end_inset
Pane
\family default
to show the source code window (if not already shown)
\end_layout
\begin_layout Enumerate
set the cursor into the box and copy the corresponding LaTeX code from the
source window
\end_layout
\begin_layout Enumerate
paste it t the content of the
\family sans
PDFAction
\family default
inset.
\end_layout
\begin_layout Standard
For example the button should be 4
\begin_inset space \thinspace{} \begin_inset space \thinspace{}
\end_inset \end_inset
cm wide and have the height of 2 lines. cm wide and have the height of 2 lines.
Then create this parbox: Then create this parbox:
\begin_inset Newline newline \end_layout
\end_inset
\begin_layout Standard
\begin_inset Box Frameless \begin_inset Box Frameless
position "c" position "c"
hor_pos "c" hor_pos "c"
@ -2300,17 +2427,21 @@ Save form as
\end_inset \end_inset
\begin_inset Newline newline \end_layout
\end_inset
and copy its LaTeX code to the button \begin_layout Standard
inside a
\family sans \family sans
PDFAction PDFAction
\family default \family default
inset. inset.
To center the text in the button add To center the text in the button add
\series bold
\backslash \backslash
centering right before the button text. centering
\series default
as TeX code right before the button text.
This is the result: This is the result:
\end_layout \end_layout
@ -2319,7 +2450,6 @@ centering right before the button text.
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -2330,12 +2460,38 @@ SaveAs
\end_inset \end_inset
\begin_inset Box Frameless
position "c"
hor_pos "c"
has_inner_box 1
inner_pos "c"
use_parbox 1
use_makebox 0
width "4cm"
special "none"
height "2in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash \backslash
parbox[c][2 centering
\backslash \end_layout
totalheight]{4cm}{
\backslash \end_inset
centering Save form as}
Save form as
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -2416,7 +2572,6 @@ menubordercolor={0.1 0.9 0.5}
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -2427,12 +2582,39 @@ SaveAs
\end_inset \end_inset
\begin_inset Box Frameless
position "c"
hor_pos "c"
has_inner_box 1
inner_pos "c"
use_parbox 1
use_makebox 0
width "4cm"
special "none"
height "2in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\noindent
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash \backslash
parbox[c][2 centering
\backslash \end_layout
totalheight]{4cm}{
\backslash \end_inset
centering Save form as}
Save form as
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -2500,7 +2682,6 @@ pixel thick yellow border:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -2511,12 +2692,39 @@ SaveAs
\end_inset \end_inset
\begin_inset Box Frameless
position "c"
hor_pos "c"
has_inner_box 1
inner_pos "c"
use_parbox 1
use_makebox 0
width "4cm"
special "none"
height "2in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\noindent
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash \backslash
parbox[c][2 centering
\backslash \end_layout
totalheight]{4cm}{
\backslash \end_inset
centering Save form as}
Save form as
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -2564,7 +2772,7 @@ pdfborder={0 0 0}
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
An example without a border and with a background color: An example without a border and with lime background color:
\begin_inset Newline newline \begin_inset Newline newline
\end_inset \end_inset
@ -2573,7 +2781,6 @@ An example without a border and with a background color:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -2584,14 +2791,63 @@ SaveAs
\end_inset \end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash \backslash
colorbox{lime}{ colorbox{lime}{
\end_layout
\end_inset
\begin_inset Box Frameless
position "c"
hor_pos "c"
has_inner_box 1
inner_pos "c"
use_parbox 1
use_makebox 0
width "4cm"
special "none"
height "2in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\noindent
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash \backslash
parbox[c][2 centering
\backslash \end_layout
totalheight]{4cm}{
\backslash \end_inset
centering Save form as}}
Save form as
\end_layout
\end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
}
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -2818,12 +3074,33 @@ name=contract,radio,default=tl,validate={validateTime();}
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
name=contract,radio,default=tl,validate={validateTime();} name=contract,radio,default=tl,validate=
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{
\end_layout
\end_inset
validateTime();
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
}
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -2874,7 +3151,6 @@ From:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -2936,7 +3212,6 @@ To:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
@ -3033,12 +3308,33 @@ An example text field:
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
\begin_inset Argument 1 \begin_inset Argument 1
status open status open
\begin_layout Plain Layout \begin_layout Plain Layout
name=onlyNumbers, align=1, validate={checkNumber();} name=onlyNumbers, align=1, validate=
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{
\end_layout
\end_inset
checkNumber();
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
}
\end_layout
\end_inset
\end_layout \end_layout
\end_inset \end_inset
@ -3127,7 +3423,8 @@ Submitting and applying data requires that all form fields have a name.
\end_layout \end_layout
\begin_layout Itemize \begin_layout Itemize
All braces and brackets in form parameters must be inserted as TeX code! All braces, brackets, backslashes and quote characters in form parameters
must be inserted as TeX code!
\end_layout \end_layout
\begin_layout Itemize \begin_layout Itemize

View File

@ -25,10 +25,10 @@ Style "Begin PDF Form"
LabelType Static LabelType Static
LabelString "Begin PDF Form" LabelString "Begin PDF Form"
Argument 1 Argument 1
MenuString "PDF Form Parameters" MenuString "PDF Form Parameters"
LabelString "Params" LabelString "Params"
Tooltip "Insert PDF form parameters here" Tooltip "Insert PDF form parameters here"
AutoInsert 1 AutoInsert 1
EndArgument EndArgument
LabelFont LabelFont
Series Bold Series Bold
@ -62,12 +62,11 @@ InsetLayout Flex:TextField
LatexName TextField LatexName TextField
LabelString "TextField" LabelString "TextField"
Argument 1 Argument 1
MenuString "PDF Form Parameters" MenuString "PDF Form Parameters"
LabelString "Params" LabelString "Params"
Tooltip "Insert PDF form parameters here" Tooltip "Insert PDF form parameters here"
AutoInsert 1 AutoInsert 1
EndArgument EndArgument
PassThru 1
LabelFont LabelFont
Color magenta Color magenta
Size Small Size Small
@ -86,9 +85,9 @@ InsetLayout Flex:ChoiceMenu
LatexName ChoiceMenu LatexName ChoiceMenu
LabelString "ChoiceMenu" LabelString "ChoiceMenu"
Argument 2 Argument 2
LabelString "Label" LabelString "Label"
Mandatory 1 Mandatory 1
AutoInsert 1 AutoInsert 1
ToolTip "Insert the label here" ToolTip "Insert the label here"
EndArgument EndArgument
End End
@ -120,9 +119,9 @@ InsetLayout Flex:PDFAction
LatexName Acrobatmenu LatexName Acrobatmenu
LabelString "PDFAction" LabelString "PDFAction"
Argument 1 Argument 1
LabelString "Action" LabelString "Action"
Mandatory 1 Mandatory 1
AutoInsert 1 AutoInsert 1
ToolTip "The name of the PDF action" ToolTip "The name of the PDF action"
EndArgument EndArgument
End End