summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-12-17 23:02:36 +0000
committerKarl Berry <karl@freefriends.org>2010-12-17 23:02:36 +0000
commitf51d0af7ed4d2b504e2bff7402ac9934879e842e (patch)
treee3cda1e2973a23627f5b2a7ddf202d2e4aa27fec
parentdbf35b048ee6685fbdf772fa0186fef710cbc068 (diff)
ocgtools 0.8a (18dec10)
git-svn-id: svn://tug.org/texlive/trunk@20780 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/README3
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/fancytipmark.pdfbin0 -> 1245 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-article.pdfbin74406 -> 74325 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer-Hannover.pdfbin501399 -> 501064 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer-Marburg.pdfbin501657 -> 501284 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer.pdfbin494997 -> 494659 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-fancytooltips.pdfbin273527 -> 283669 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-minimal.pdfbin83176 -> 82989 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen-nopanel.pdfbin405679 -> 405284 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen-panelleft.pdfbin449607 -> 447072 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen.pdfbin449699 -> 447155 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web-leftpanel.pdfbin477633 -> 477934 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web-rightpanel.pdfbin477890 -> 478167 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web.pdfbin451254 -> 451533 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-preview.pdfbin467749 -> 475764 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-scrartcl.pdfbin74284 -> 74203 bytes
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/examples/pdfscreen.cfg0
-rw-r--r--Master/texmf-dist/doc/latex/ocgtools/ocgtools.pdfbin283270 -> 284313 bytes
-rw-r--r--Master/texmf-dist/source/latex/ocgtools/ocgtools.dtx76
-rw-r--r--Master/texmf-dist/tex/latex/ocgtools/ocgtools.sty58
20 files changed, 91 insertions, 46 deletions
diff --git a/Master/texmf-dist/doc/latex/ocgtools/README b/Master/texmf-dist/doc/latex/ocgtools/README
index 3165849ad39..e39a13d65ee 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/README
+++ b/Master/texmf-dist/doc/latex/ocgtools/README
@@ -14,5 +14,8 @@ The package is distributed with examples build from one source using
several presentation packages (beamer, web, pdfscreen). All necessary
files are on CATN and Texlive 2009.
+Supported by the grant 131/2010 of Higher Education Development Fund
+(www.frvs.cz).
+
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/fancytipmark.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/fancytipmark.pdf
new file mode 100644
index 00000000000..6bc49497e42
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/fancytipmark.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-article.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-article.pdf
index c041720a34f..339d308b85f 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-article.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-article.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer-Hannover.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer-Hannover.pdf
index 3e389fe2d89..1396ebc3dc8 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer-Hannover.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer-Hannover.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer-Marburg.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer-Marburg.pdf
index 2d437bb4adb..f5777ee95bb 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer-Marburg.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer-Marburg.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer.pdf
index ac1c8e94b6f..0da1459d953 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-beamer.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-fancytooltips.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-fancytooltips.pdf
index e43a7529189..cfdf07241d5 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-fancytooltips.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-fancytooltips.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-minimal.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-minimal.pdf
index 69a75d2c0db..e28ada5f3a7 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-minimal.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-minimal.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen-nopanel.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen-nopanel.pdf
index 6ec28b9c7a1..25b2042ff83 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen-nopanel.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen-nopanel.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen-panelleft.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen-panelleft.pdf
index 6dfe9da4b9f..2e8b1d182e9 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen-panelleft.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen-panelleft.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen.pdf
index 0f891e23598..8e09643792d 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-pdfscreen.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web-leftpanel.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web-leftpanel.pdf
index 6e35b8911a5..28b3e683178 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web-leftpanel.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web-leftpanel.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web-rightpanel.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web-rightpanel.pdf
index 234f6ababf6..bc062d63d36 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web-rightpanel.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web-rightpanel.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web.pdf
index a23dad1c4ec..36fba04f3ab 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-example-web.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-preview.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-preview.pdf
index b79c120646b..973a4a1015f 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-preview.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-preview.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-scrartcl.pdf b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-scrartcl.pdf
index 07999fcd8b9..258131ee939 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-scrartcl.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/examples/ocgtools-scrartcl.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/ocgtools/examples/pdfscreen.cfg b/Master/texmf-dist/doc/latex/ocgtools/examples/pdfscreen.cfg
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/Master/texmf-dist/doc/latex/ocgtools/examples/pdfscreen.cfg
+++ /dev/null
diff --git a/Master/texmf-dist/doc/latex/ocgtools/ocgtools.pdf b/Master/texmf-dist/doc/latex/ocgtools/ocgtools.pdf
index 57936d45508..9efccb2901e 100644
--- a/Master/texmf-dist/doc/latex/ocgtools/ocgtools.pdf
+++ b/Master/texmf-dist/doc/latex/ocgtools/ocgtools.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/ocgtools/ocgtools.dtx b/Master/texmf-dist/source/latex/ocgtools/ocgtools.dtx
index 3dd5a7a77fd..2949d0be269 100644
--- a/Master/texmf-dist/source/latex/ocgtools/ocgtools.dtx
+++ b/Master/texmf-dist/source/latex/ocgtools/ocgtools.dtx
@@ -22,7 +22,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{ocgtools}
%<*package>
- [2010/05/10 v0.8 ocgtools.dtx file]
+ [2010/11/19 v0.8a ocgtools.dtx file]
%</package>
%
%<*driver>
@@ -40,7 +40,7 @@
%</driver>
% \fi
%
-% \CheckSum{1067}
+% \CheckSum{1082}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -66,6 +66,7 @@
% can get its own colors, fixed layerHshift and layerVshift macros,
% options \texttt{inactive} and \texttt{active}}
% \changes{v0.8}{2010/05/10}{Minor fix related to fancytooltips package}
+% \changes{v0.8a}{2010/11/19}{Minor fix related to color in new eforms package}
%
% \GetFileInfo{ocgtools.dtx}
%
@@ -278,15 +279,20 @@
% \subsection{Layer with text (or whatever) in its natural size}
% \DescribeMacro{\ocgminitext} The macro
% |\ocgminitext[width=|\meta{width}, |bg=|\meta{color1},
-% |fg=|\meta{color2}|]|\marg{text1}\marg{text2} is used to create
-% layer containing \meta{text2} which is placed near the right top
-% corner of \meta{text1}. \meta{text2} is placed into |\hbox| or
-% |\vbox| with given |\hsize| according to the value of \meta{width}
-% and other optional parameters, as has been explained at |\ocgtext|
+% |fg=|\meta{color2}|]|\marg{text1}\marg{text2} is used to create layer
+% containing \meta{text2} which is placed near the right top corner of
+% \meta{text1}. \meta{text2} is placed into |\hbox| or |\vbox| with
+% given |\hsize| according to the value of \meta{width} and other
+% optional parameters, as has been explained at |\ocgtext|
% macro. Macros |\ocgminitextrb|, |\ocgminitextlt| and
% |\ocgminitextlb| can be used to place the minilayer to the right
% bottom, left to and left bottom corner.
%
+% Starting from version 0.9 you can use keywords
+% |jsopen=|\meta{openaction} and |jsclose=|\meta{closeaction} to
+% define JavaScript action which is performed when the layer is opened
+% and closed, respectively.
+%
% \subsection{Fine-tuning, customizing}
% \DescribeMacro{\ocgtextstart}\DescribeMacro{\ocgtextend} Macros
% |\ocgtextstart| and |\ocgtextend| are used to denote the start and
@@ -460,7 +466,7 @@
\newif\ifocg@hide@button\ocg@hide@buttontrue
\DeclareOption{nobutton}{\ocg@hide@buttonfalse}
\def\ocgtools@progressmsg{\lower \layerVshift\hbox to 0 pt{ %space
- \textField[\V{OCGtools: processing OCG's ...}\BG{1}
+ \textField[\V{OCGtools: processing OCG's ...}\BG{1 1 1}
\textColor{1 0 0} \textSize{10}]%
{ocgtoolsmsg}{6cm}{20pt}\hss}}%
\DeclareOption{noprogressmsg}{\let\ocgtools@progressmsg\relax}
@@ -677,21 +683,22 @@
% of each minilayer and can be used to hide the corresponding minilayer.
% \begin{macrocode}
\ifx\ocgtools@AfterHideMiniLayer\undefined\def\ocgtools@AfterHideMiniLayer{}\fi
-\newcommand\ocgtools@HideMiniLayer[1]
+\newcommand\ocgtools@HideMiniLayer[2][]
{\setbox\ocgtools@box@a=\hbox{{\ocgclosechar}}%
\hbox to \wd\ocgtools@box@a%
{\hbox{{\ocgclosechar}}\hss%
\hbox{\pushButton[\W{0}\S{S}\BG{}\BC{}\H{N}%
\F{\FHidden}\A{\ocgtools@JS{
- for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++)
- {
- if(ocgtoolsOCGs[i].name == "ocgtools#1")
- ocgtoolsOCGs[i].state = false;
- }
- this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden = true;
- \ocgtools@AfterHideMiniLayer
- }}]%
- {OcgtoolsBtn.HideButton.mini.#1}{\wd\ocgtools@box@a}{\ht\ocgtools@box@a}}}}
+ for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++)
+ {
+ if(ocgtoolsOCGs[i].name == "ocgtools#2")
+ ocgtoolsOCGs[i].state = false;
+ }
+ this.getField("OcgtoolsBtn.HideButton.mini.#2").hidden = true;
+ \ocgtools@AfterHideMiniLayer
+ #1
+ }}]%
+{OcgtoolsBtn.HideButton.mini.#2}{\wd\ocgtools@box@a}{\ht\ocgtools@box@a}}}}
% \end{macrocode}
% We create buttons which are attached to the bottom right corner
% of the screen and can be used to hide all layers.
@@ -773,9 +780,11 @@
\pdfendlink%
}
-\newcommand{\ocgtools@ToggleMiniLayer}[2]{%
+\newcommand{\ocgtools@ToggleMiniLayer}[4]{%
% #1: layer name,
% #2: link text
+ % #3: js action if the layer is opened
+ % #4: js action if the layer is closed
\leavevmode%
\pdfstartlink user {
/Subtype /Link
@@ -788,7 +797,18 @@
for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++)
{
if(ocgtoolsOCGs[i].name == "ocgtools#1")
- ocgtoolsOCGs[i].state = !ocgtoolsOCGs[i].state;
+ {
+ if (ocgtoolsOCGs[i].state)
+ {
+ #4
+ ocgtoolsOCGs[i].state = false;
+ }
+ else
+ {
+ #3
+ ocgtoolsOCGs[i].state = true;
+ }
+ }
}
this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden =
!this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden;
@@ -808,7 +828,7 @@
{
var OpenedByMouseEnter#1=true;
if(ocgtoolsOCGs[i].name == "ocgtools#1")
- ocgtoolsOCGs[i].state = true;
+ {#3 ocgtoolsOCGs[i].state = true;}
}
this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden = false;
}}
@@ -818,7 +838,7 @@
for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++)
{
if(ocgtoolsOCGs[i].name == "ocgtools#1")
- ocgtoolsOCGs[i].state = false;
+ {#4 ocgtoolsOCGs[i].state = false; }
}
this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden = true;
}
@@ -866,6 +886,8 @@
\define@key{ocg@key}{bg}[ocgpaper]{\def\ocgt@@ls@bg{#1}}
\define@key{ocg@key}{color}[ocgfontcolor]{\def\ocgt@@ls@fg{#1}}
\define@key{ocg@key}{fg}[ocgfontcolor]{\def\ocgt@@ls@fg{#1}}
+\define@key{ocg@key}{jsopen}[]{\def\ocgt@@ls@jsopen{#1}}
+\define@key{ocg@key}{jsclose}[]{\def\ocgt@@ls@jsclose{#1}}
\newtoks\ocg@pdflastxpos\ocg@pdflastxpos{\the\pdflastxpos}
\newtoks\ocg@pdflastypos\ocg@pdflastypos{\the\pdflastypos}
@@ -877,7 +899,9 @@
% \begin{macrocode}
\def\ocgtools@setdefault{\def\ocgt@@ls@bg{\defaultocgpapercolor}%
\def\ocgt@@ls@fg{\defaultocgfontcolor}%
-\def\ocgt@@ls@width{0pt}}
+\def\ocgt@@ls@width{0pt}\def\ocgt@@ls@jsopen{}%
+\def\ocgt@@ls@jsclose{}%
+}
\newcommand\ocgtext[3][0pt]{%
\ocgtools@setdefault
@@ -920,7 +944,7 @@
\fi
\fi
\ocgtools@ToggleMiniLayer{\the\ocgtools@layercount}%
-{{\ocgtextstart #2\ocgtextend}}%
+{{\ocgtextstart #2\ocgtextend}}{\ocgt@@ls@jsopen}{\ocgt@@ls@jsclose}%
\ifocg@minitext@left\else
\ifocg@minitext@bottom
\vbox to 0 pt{\kern 0.7\baselineskip\pdfsavepos\vss}%
@@ -928,7 +952,7 @@
\vbox to 0 pt{\vss\pdfsavepos\kern 0.7\baselineskip}%
\fi
\fi
-\edef\ocgtools@act{\write\posHandle{\noexpand\string\noexpand\ocgtoolsplaceminitext{\the\ocgtools@layercount}{\the\ocg@pagetoks}{\the\ocg@pdflastxpos}{\the\ocg@pdflastypos}{}{width=\ocgt@@ls@width,bg=\ocgt@@ls@bg,fg=\ocgt@@ls@fg}{#4}}}%
+\edef\ocgtools@act{\write\posHandle{\noexpand\string\noexpand\ocgtoolsplaceminitext{\the\ocgtools@layercount}{\the\ocg@pagetoks}{\the\ocg@pdflastxpos}{\the\ocg@pdflastypos}{}{width=\ocgt@@ls@width,bg=\ocgt@@ls@bg,fg=\ocgt@@ls@fg,jsopen={\ocgt@@ls@jsopen},jsclose={\ocgt@@ls@jsclose}}{#4}}}%
\ocgtools@act
\expandafter\global\expandafter\def
\csname ocgtools@minitextcontent@\the\ocgtools@layercount\endcsname{#3}%
@@ -1083,7 +1107,7 @@
\else
\hbox{\copy\ocgtools@box@a\raise\ht\ocgtools@box@a
\vbox to 0 pt{\hbox to 0 pt{\hss
-\ocgtools@HideMiniLayer{#3}}\vss}}%
+\ocgtools@HideMiniLayer[\ocgt@@ls@jsclose]{#3}}\vss}}%
\fi
\@ocgtools@insideminilayerfalse
}
diff --git a/Master/texmf-dist/tex/latex/ocgtools/ocgtools.sty b/Master/texmf-dist/tex/latex/ocgtools/ocgtools.sty
index 02cc7c0e961..e49d4b67603 100644
--- a/Master/texmf-dist/tex/latex/ocgtools/ocgtools.sty
+++ b/Master/texmf-dist/tex/latex/ocgtools/ocgtools.sty
@@ -22,7 +22,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{ocgtools}
- [2010/05/10 v0.8 ocgtools.dtx file]
+ [2010/11/19 v0.8a ocgtools.dtx file]
\def\ocgtools@msg{If this message does not disappear after a short time, the
author either did not compile the \LaTeX{} file three times, or your
PDF viewer does not support OCG. Use Adobe Reader!}
@@ -57,7 +57,7 @@
\newif\ifocg@hide@button\ocg@hide@buttontrue
\DeclareOption{nobutton}{\ocg@hide@buttonfalse}
\def\ocgtools@progressmsg{\lower \layerVshift\hbox to 0 pt{ %space
- \textField[\V{OCGtools: processing OCG's ...}\BG{1}
+ \textField[\V{OCGtools: processing OCG's ...}\BG{1 1 1}
\textColor{1 0 0} \textSize{10}]%
{ocgtoolsmsg}{6cm}{20pt}\hss}}%
\DeclareOption{noprogressmsg}{\let\ocgtools@progressmsg\relax}
@@ -204,21 +204,22 @@
\ocgtools@AfterHideBtn
}}]{OcgtoolsBtn.HideButton.main}{\paperwidth}{\paperheight}}
\ifx\ocgtools@AfterHideMiniLayer\undefined\def\ocgtools@AfterHideMiniLayer{}\fi
-\newcommand\ocgtools@HideMiniLayer[1]
+\newcommand\ocgtools@HideMiniLayer[2][]
{\setbox\ocgtools@box@a=\hbox{{\ocgclosechar}}%
\hbox to \wd\ocgtools@box@a%
{\hbox{{\ocgclosechar}}\hss%
\hbox{\pushButton[\W{0}\S{S}\BG{}\BC{}\H{N}%
\F{\FHidden}\A{\ocgtools@JS{
- for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++)
- {
- if(ocgtoolsOCGs[i].name == "ocgtools#1")
- ocgtoolsOCGs[i].state = false;
- }
- this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden = true;
- \ocgtools@AfterHideMiniLayer
- }}]%
- {OcgtoolsBtn.HideButton.mini.#1}{\wd\ocgtools@box@a}{\ht\ocgtools@box@a}}}}
+ for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++)
+ {
+ if(ocgtoolsOCGs[i].name == "ocgtools#2")
+ ocgtoolsOCGs[i].state = false;
+ }
+ this.getField("OcgtoolsBtn.HideButton.mini.#2").hidden = true;
+ \ocgtools@AfterHideMiniLayer
+ #1
+ }}]%
+{OcgtoolsBtn.HideButton.mini.#2}{\wd\ocgtools@box@a}{\ht\ocgtools@box@a}}}}
\ifx\ocgtools@AfterHideLayers\undefined\def\ocgtools@AfterHideLayers{}\fi
\newcommand\ocgtools@HideLayers[1]{%
\setbox\ocgtools@box@a=\hbox{{\ocgclosechar}}%
@@ -292,9 +293,11 @@
\pdfendlink%
}
-\newcommand{\ocgtools@ToggleMiniLayer}[2]{%
+\newcommand{\ocgtools@ToggleMiniLayer}[4]{%
% #1: layer name,
% #2: link text
+ % #3: js action if the layer is opened
+ % #4: js action if the layer is closed
\leavevmode%
\pdfstartlink user {
/Subtype /Link
@@ -307,7 +310,18 @@
for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++)
{
if(ocgtoolsOCGs[i].name == "ocgtools#1")
- ocgtoolsOCGs[i].state = !ocgtoolsOCGs[i].state;
+ {
+ if (ocgtoolsOCGs[i].state)
+ {
+ #4
+ ocgtoolsOCGs[i].state = false;
+ }
+ else
+ {
+ #3
+ ocgtoolsOCGs[i].state = true;
+ }
+ }
}
this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden =
!this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden;
@@ -327,7 +341,7 @@
{
var OpenedByMouseEnter#1=true;
if(ocgtoolsOCGs[i].name == "ocgtools#1")
- ocgtoolsOCGs[i].state = true;
+ {#3 ocgtoolsOCGs[i].state = true;}
}
this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden = false;
}}
@@ -337,7 +351,7 @@
for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++)
{
if(ocgtoolsOCGs[i].name == "ocgtools#1")
- ocgtoolsOCGs[i].state = false;
+ {#4 ocgtoolsOCGs[i].state = false; }
}
this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden = true;
}
@@ -373,6 +387,8 @@
\define@key{ocg@key}{bg}[ocgpaper]{\def\ocgt@@ls@bg{#1}}
\define@key{ocg@key}{color}[ocgfontcolor]{\def\ocgt@@ls@fg{#1}}
\define@key{ocg@key}{fg}[ocgfontcolor]{\def\ocgt@@ls@fg{#1}}
+\define@key{ocg@key}{jsopen}[]{\def\ocgt@@ls@jsopen{#1}}
+\define@key{ocg@key}{jsclose}[]{\def\ocgt@@ls@jsclose{#1}}
\newtoks\ocg@pdflastxpos\ocg@pdflastxpos{\the\pdflastxpos}
\newtoks\ocg@pdflastypos\ocg@pdflastypos{\the\pdflastypos}
@@ -380,7 +396,9 @@
\def\ocgtools@setdefault{\def\ocgt@@ls@bg{\defaultocgpapercolor}%
\def\ocgt@@ls@fg{\defaultocgfontcolor}%
-\def\ocgt@@ls@width{0pt}}
+\def\ocgt@@ls@width{0pt}\def\ocgt@@ls@jsopen{}%
+\def\ocgt@@ls@jsclose{}%
+}
\newcommand\ocgtext[3][0pt]{%
\ocgtools@setdefault
@@ -423,7 +441,7 @@
\fi
\fi
\ocgtools@ToggleMiniLayer{\the\ocgtools@layercount}%
-{{\ocgtextstart #2\ocgtextend}}%
+{{\ocgtextstart #2\ocgtextend}}{\ocgt@@ls@jsopen}{\ocgt@@ls@jsclose}%
\ifocg@minitext@left\else
\ifocg@minitext@bottom
\vbox to 0 pt{\kern 0.7\baselineskip\pdfsavepos\vss}%
@@ -431,7 +449,7 @@
\vbox to 0 pt{\vss\pdfsavepos\kern 0.7\baselineskip}%
\fi
\fi
-\edef\ocgtools@act{\write\posHandle{\noexpand\string\noexpand\ocgtoolsplaceminitext{\the\ocgtools@layercount}{\the\ocg@pagetoks}{\the\ocg@pdflastxpos}{\the\ocg@pdflastypos}{}{width=\ocgt@@ls@width,bg=\ocgt@@ls@bg,fg=\ocgt@@ls@fg}{#4}}}%
+\edef\ocgtools@act{\write\posHandle{\noexpand\string\noexpand\ocgtoolsplaceminitext{\the\ocgtools@layercount}{\the\ocg@pagetoks}{\the\ocg@pdflastxpos}{\the\ocg@pdflastypos}{}{width=\ocgt@@ls@width,bg=\ocgt@@ls@bg,fg=\ocgt@@ls@fg,jsopen={\ocgt@@ls@jsopen},jsclose={\ocgt@@ls@jsclose}}{#4}}}%
\ocgtools@act
\expandafter\global\expandafter\def
\csname ocgtools@minitextcontent@\the\ocgtools@layercount\endcsname{#3}%
@@ -572,7 +590,7 @@
\else
\hbox{\copy\ocgtools@box@a\raise\ht\ocgtools@box@a
\vbox to 0 pt{\hbox to 0 pt{\hss
-\ocgtools@HideMiniLayer{#3}}\vss}}%
+\ocgtools@HideMiniLayer[\ocgt@@ls@jsclose]{#3}}\vss}}%
\fi
\@ocgtools@insideminilayerfalse
}