summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fancytooltips
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-05-10 15:43:58 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-05-10 15:43:58 +0000
commit8e5c31b85843119a31e4359278ebb9a2bd29a161 (patch)
tree701a22a46a1ea44c23f05efcf994c98ae0844c90 /Master/texmf-dist/source/latex/fancytooltips
parent35fe4021407d6a93576f080c8958e37aafecb0db (diff)
fancytooltips update (2008/05/10)
git-svn-id: svn://tug.org/texlive/trunk@8025 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/fancytooltips')
-rw-r--r--Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx73
1 files changed, 60 insertions, 13 deletions
diff --git a/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx b/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx
index ee56735f0cd..9381e87ca4e 100644
--- a/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx
+++ b/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx
@@ -43,7 +43,7 @@
%</driver>
% \fi
%
-% \CheckSum{355}
+% \CheckSum{441}
%
% \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
@@ -81,6 +81,9 @@
% \changes{v1.3a}{2007/07/28}{Fixed app.focusRect, thanks to Lud\v{e}k
% Nechv\'atal.}
%
+% \changes{v1.4}{2008/05/10}{Added mouseover option. Fixed the end of
+% animation.}
+%
%
% \GetFileInfo{fancytooltips.dtx}
%
@@ -120,20 +123,22 @@
% \section{Usage}
% \subsection{The file with tooltips}
% The file with tooltips is an ordinary pdf file, one tooltip per
-% page, tooltips should be in the top right corner at the page, in a
-% colored box and the rest of the page should be transparent. If you
+% page, tooltips should be in the top right corner at the page, in
+% a colored box and the rest of the page should be transparent. If you
% consider to use |movetips| option (see below), then every page
% should have the dimensions equal to the dimensions of the colored
-% box with tooltip\footnote{Look at the files \texttt{tooltipy.tex} and
-% \texttt{tooltipy.pdf} from |examples| subdirectory for a simple example
-% how to meet this condition under pdf\LaTeX}. We also provide
-% simple cross referencing mechanism to reffer to the tooltips. If the
-% pdf file is created by \LaTeX, \DescribeMacro{\keytip} you can
-% define keywords to reffer to the pages using |\keytip| command.
-% Simply put |\usepackage[createtips]{fancytooltips}| into preamble
-% and write \texttt{\string\keytip}\marg{foo} in document. This writes
+% box with tooltip\footnote{Look at the files \texttt{tooltipy.tex}
+% and \texttt{tooltipy.pdf} from |examples| subdirectory for
+% a simple example how to meet this condition under pdf\LaTeX}. We
+% also provide simple cross referencing mechanism to reffer to the
+% tooltips. If the pdf file is created by \LaTeX,
+% \DescribeMacro{\keytip} you can define keywords to reffer to the
+% pages using |\keytip| command. Simply put
+% |\usepackage[createtips]{fancytooltips}| into preamble and write
+% \texttt{\string\keytip}\marg{foo} in document. This writes
% information about keyword \meta{foo} and the pagenumber into file
-% |fancytips.tex|.
+% |fancytips.tex|. If you use option |mouseover|, the tooltips are
+% activated by mouseover action.
%
% \subsection{The file with presentation -- pdf\LaTeX users}
% In the file with presentation, the user is responsible
@@ -237,6 +242,9 @@
\newif\ifmovetips\movetipsfalse
\DeclareOptionX{movetips}{\movetipstrue}
+\newif\ifmouseover\mouseoverfalse
+\DeclareOptionX{mouseover}{\mouseovertrue}
+
\DeclareOptionX{filename}{\xdef\TooltipFilename{#1}}
\DeclareOptionX{pages}{\xdef\TooltipPages{#1}}
@@ -336,6 +344,20 @@
% \begin{macrocode}
\definecolor{tooltipcolor}{rgb}{0,0,1}
\def\TooltipPage#1{\expandafter\gdef\csname TooltipPage#1\endcsname{#1}}
+\ifmouseover
+\def\tooltip#1#2{%
+ \write\@auxout{\noexpand\TooltipPage{\thepage}}%
+ \checkTipNumber{#2}\edef\TipNumber{\FindTipNumber{#2}}%
+ \leavevmode
+ \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\hbox to 0 pt{{\copy0\TooltipExtratext\hss}}%
+ \pushButton[\BC{}\BG{}\S{}\AA{\AAMouseExit{\JS{CloseTooltips();}}
+ \AAMouseEnter{\JS{this.getField("ikona."+(this.pageNum+1)).hidden=false;
+ try {app.clearInterval(animace);}catch (e) {}
+ \ifmovetips nastav(\TipNumber);\fi
+ zobraz(\TipNumber);
+ }}}]
+ {TooltipField}{\wd0}{\ht0}}
+\else
\def\tooltip#1#2{%
\write\@auxout{\noexpand\TooltipPage{\thepage}}%
\checkTipNumber{#2}\edef\TipNumber{\FindTipNumber{#2}}%
@@ -348,7 +370,31 @@
zobraz(\TipNumber);
}}]
{TooltipField}{\wd0}{\ht0}}
+\fi
\def\delayinterval{200}
+\ifmouseover
+\def\tooltipanim#1#2#3{%
+ \write\@auxout{\noexpand\TooltipPage{\thepage}}%
+ \checkTipNumber{#2}\edef\TipNumberA{\FindTipNumber{#2}}%
+ \checkTipNumber{#3}\edef\TipNumberB{\FindTipNumber{#3}}%
+ \leavevmode
+ \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\hbox to 0 pt{{\copy0\TooltipExtratext\hss}}%
+ \pushButton[\BC{}\BG{}\S{}\AA{\AAMouseExit{\JS{CloseTooltips();}}
+ \AAMouseEnter{\JS{
+ try {app.clearInterval(animace);}catch (e) {}
+ var cislo=\TipNumberA;
+ \ifmovetips nastav(\TipNumberA);\fi
+ function animuj()
+ {
+ if (cislo<\TipNumberB) cislo=cislo+1; else {try {app.clearInterval(animace);}catch (e) {};}
+ this.getField('ikona.'+(this.pageNum+1)).buttonSetIcon(this.getField("animtiph."+cislo).buttonGetIcon());
+ };
+ this.getField('ikona.'+(this.pageNum+1)).buttonSetIcon(this.getField("animtiph."+\TipNumberA).buttonGetIcon());
+ this.getField("ikona."+(this.pageNum+1)).hidden=false;
+ animace=app.setInterval('animuj();', \delayinterval);
+ }}}
+ ]{TooltipField}{\wd0}{\ht0}}
+\else
\def\tooltipanim#1#2#3{%
\write\@auxout{\noexpand\TooltipPage{\thepage}}%
\checkTipNumber{#2}\edef\TipNumberA{\FindTipNumber{#2}}%
@@ -362,7 +408,7 @@
\ifmovetips nastav(\TipNumberA);\fi
function animuj()
{
- if (cislo<\TipNumberB) cislo=cislo+1;
+ if (cislo<\TipNumberB) cislo=cislo+1; else {try {app.clearInterval(animace);}catch (e) {};}
this.getField('ikona.'+(this.pageNum+1)).buttonSetIcon(this.getField("animtiph."+cislo).buttonGetIcon());
};
this.getField('ikona.'+(this.pageNum+1)).buttonSetIcon(this.getField("animtiph."+\TipNumberA).buttonGetIcon());
@@ -370,6 +416,7 @@
animace=app.setInterval('animuj();', \delayinterval);
}}
]{TooltipField}{\wd0}{\ht0}}
+\fi
% \end{macrocode}
% This code closes tooltip if the page is closed.
% \begin{macrocode}