summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fancytooltips
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-06 15:01:56 +0000
committerKarl Berry <karl@freefriends.org>2009-05-06 15:01:56 +0000
commit6534ce0ba0f2e405c4bbe618499e235d5830f5a2 (patch)
tree6ba687710248189e71bc06d7767e68bc1374c4fe /Master/texmf-dist/source/latex/fancytooltips
parent8ff84fe02cc02e3ce7131188816307c51f9ee3d8 (diff)
fancytooltips update (4may09)
git-svn-id: svn://tug.org/texlive/trunk@12946 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/fancytooltips')
-rw-r--r--Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx164
1 files changed, 84 insertions, 80 deletions
diff --git a/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx b/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx
index 9381e87ca4e..1ec6dbf244c 100644
--- a/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx
+++ b/Master/texmf-dist/source/latex/fancytooltips/fancytooltips.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
-% Copyright (C) 2004 by Robert Marik <marik@mendelu.cz>
-% -----------------------------------------------------
+% Copyright (C) 2004-2009 by Robert Marik <marik@mendelu.cz>
+% ----------------------------------------------------------
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
@@ -22,7 +22,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{fancytooltips}
%<*package>
- [2007/07/28 v1.3a fancytooltips.dtx file]
+ [2009/05/05 v1.5 fancytooltips.dtx file]
%</package>
%
%<*driver>
@@ -31,7 +31,7 @@
\CodelineIndex
\RecordChanges
\usepackage[pdftex]{color}
-\usepackage[filename=tip,movetips]{fancytooltips}
+\usepackage[filename=tip,mouseover,movetips]{fancytooltips}
\buttontipwidth=2cm
\buttontipheight=2cm
\begin{document}
@@ -43,7 +43,7 @@
%</driver>
% \fi
%
-% \CheckSum{441}
+% \CheckSum{445}
%
% \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
@@ -78,12 +78,12 @@
% Improved documentation -- added a note about the required version
% of eforms.sty}
%
-% \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.}
+% \changes{v1.4}{2009/04/29}{Added support for presentations (like
+% |pause| command for texpower).}
%
+% \changes{v1.5}{2009/05/05}{Handling number of pages via aux file
+% (fixes some problems issued by previous modification and page
+% break near tooltip).}
%
% \GetFileInfo{fancytooltips.dtx}
%
@@ -91,8 +91,10 @@
%
%
% \title{The \textsf{fancytooltips} package\thanks{This document
-% corresponds to \textsf{fancytooltips}~\fileversion, dated \filedate.}}
-% \author{Robert Marik \\ \texttt{marik@mendelu.cz}}
+% corresponds to \textsf{fancytooltips}~\fileversion, dated
+% \filedate.} \thanks{Supported by grants 18/2006 and 99/2008 of Higher
+% Education Development Fund (FRV\v S) }} \author{Robert Ma\v r\'\i k \\
+% \texttt{marik@mendelu.cz}}
%
% \maketitle
%
@@ -109,11 +111,11 @@
%
% The \color{black}tooltips are activated by clicking the active area
% on the screen and deactivated after closing page or by moving mouse
-% outside the link. You can try the links \tooltip{here}{1}
+% outside the link. You can try the links \tooltip{here}{1}
% (Einstein's formula) and also \tooltipanim{here}{2}{7} (animation --
% numbers from 1 to 6). You have to use the free Adobe Reader or
% nonfree Adobe Acrobat to see the effect (xpdf, evince and others
-% fail to work with JavaScripts). For more examples how the
+% fail to work with JavaScripts). For more examples how the
% presentation may look like see the |example.pdf| and
% |example-min.pdf| files in the |examples| subdirectory.
%
@@ -123,22 +125,20 @@
% \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|. If you use option |mouseover|, the tooltips are
-% activated by mouseover action.
+% |fancytips.tex|.
%
% \subsection{The file with presentation -- pdf\LaTeX users}
% In the file with presentation, the user is responsible
@@ -168,6 +168,10 @@
% page of the file with tooltips has dimensions of the box with
% tooltip. See the \texttt{examples} subdirectory.}.
%
+% \DescribeMacro{mouseover option} If you use |mouseover| option, then
+% tooltip appears if you move the mouse pointer to the active area (no
+% clicking is necessary).
+%
% \DescribeMacro{\tooltip} The user can put the tooltip into her or
% his presentation using the command
% \texttt{\string\tooltip}{\marg{stuff}\marg{keyword-or-pagenumber}}
@@ -343,80 +347,82 @@
% the file |example.tex| from the examples directory.
% \begin{macrocode}
\definecolor{tooltipcolor}{rgb}{0,0,1}
-\def\TooltipPage#1{\expandafter\gdef\csname TooltipPage#1\endcsname{#1}}
-\ifmouseover
+
+\newcount\tooltip@count
+\newtoks\tooltip@toks
+\newtoks\tooltip@pagetoks
+\tooltip@pagetoks={\thepage}
+\def\tooltippage{}
+
+\def\TooltipPage#1#2{%
+\expandafter\gdef\csname TooltipPage#2\endcsname{#2}%
+\expandafter\gdef\csname Tooltipcount2page#1\endcsname{#2}%
+}
+
\def\tooltip#1#2{%
- \write\@auxout{\noexpand\TooltipPage{\thepage}}%
+ \global\advance\tooltip@count by 1%
+ \edef\act{\write\@auxout{\noexpand\string\noexpand\TooltipPage{\the\tooltip@count}{\the\tooltip@pagetoks}}}\act
+ \edef\tooltippage{\csname Tooltipcount2page\the\tooltip@count \endcsname}%
\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;
+ \def\tempfancytooltips{}%
+ \ifmovetips\edef\tempfancytooltips{nastav(\TipNumber,\tooltippage);}\fi
+ \pushButton[\BC{}\BG{}\S{}\AA{\AAMouseExit{\JS{CloseTooltips();}}%
+ \ifmouseover
+ \AAMouseEnter{\JS{this.getField("ikona."+(\tooltippage)).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}}%
- \leavevmode
- \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\hbox to 0 pt{{\copy0\TooltipExtratext\hss}}%
- \pushButton[\BC{}\BG{}\S{}\AA{\AAMouseExit{\JS{CloseTooltips();}}}
- \A{\JS{this.getField("ikona."+(this.pageNum+1)).hidden=false;
+ \tempfancytooltips
+ zobraz(\TipNumber,\tooltippage);
+ }}
+ \fi}
+ \A{\JS{this.getField("ikona."+(\tooltippage)).hidden=false;
try {app.clearInterval(animace);}catch (e) {}
- \ifmovetips nastav(\TipNumber);\fi
- zobraz(\TipNumber);
+ \tempfancytooltips
+ zobraz(\TipNumber,\tooltippage);
}}]
{TooltipField}{\wd0}{\ht0}}
-\fi
\def\delayinterval{200}
-\ifmouseover
\def\tooltipanim#1#2#3{%
- \write\@auxout{\noexpand\TooltipPage{\thepage}}%
+ \global\advance\tooltip@count by 1%
+ \edef\act{\write\@auxout{\noexpand\string\noexpand\TooltipPage{\the\tooltip@count}{\the\tooltip@pagetoks}}}\act
+ \edef\tooltippage{\csname Tooltipcount2page\the\tooltip@count \endcsname}%
\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}}%
+ \def\tempfancytooltips{}%
+ \ifmovetips\edef\tempfancytooltips{nastav(\TipNumberA,\tooltippage);}\fi
\pushButton[\BC{}\BG{}\S{}\AA{\AAMouseExit{\JS{CloseTooltips();}}
+ \ifmouseover
\AAMouseEnter{\JS{
try {app.clearInterval(animace);}catch (e) {}
var cislo=\TipNumberA;
- \ifmovetips nastav(\TipNumberA);\fi
+ \tempfancytooltips
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());
+ if (cislo<\TipNumberB) cislo=cislo+1;
+ this.getField('ikona.'+(\tooltippage)).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;
+ this.getField('ikona.'+(\tooltippage)).buttonSetIcon(this.getField("animtiph."+\TipNumberA).buttonGetIcon());
+ this.getField("ikona."+(\tooltippage)).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}}%
- \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();}}}
+ }}
+ \fi}
\A{\JS{
try {app.clearInterval(animace);}catch (e) {}
var cislo=\TipNumberA;
- \ifmovetips nastav(\TipNumberA);\fi
+ \tempfancytooltips
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());
+ if (cislo<\TipNumberB) cislo=cislo+1;
+ this.getField('ikona.'+(\tooltippage)).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;
+ this.getField('ikona.'+(\tooltippage)).buttonSetIcon(this.getField("animtiph."+\TipNumberA).buttonGetIcon());
+ this.getField("ikona."+(\tooltippage)).hidden=false;
animace=app.setInterval('animuj();', \delayinterval);
}}
]{TooltipField}{\wd0}{\ht0}}
-\fi
% \end{macrocode}
% This code closes tooltip if the page is closed.
% \begin{macrocode}
@@ -439,7 +445,6 @@
\ifTooltip@usepdftex
\begin{insDLJS}[fancyTooltipsLoaded]{Tooltipsdljs}{DLJS for Tooltips}
var animace;
- app.focusRect = false;
var fancyTooltipsLoaded = true;
function CloseTooltips()
@@ -448,9 +453,9 @@
try {app.clearInterval(animace);}catch (e) {}
}
- function nastav(cislo)
+ function nastav(cislo,strana)
{
- var f=this.getField("ikona."+(this.pageNum+1));
+ var f=this.getField("ikona."+(strana));
var g=this.getField("animtiph."+cislo);
var sourf=f.rect;
var sourg=g.rect;
@@ -467,9 +472,9 @@
f.buttonAlignY=percY;
}
- function zobraz(cislo)
+ function zobraz(cislo,strana)
{
- var f=this.getField("ikona."+(this.pageNum+1));
+ var f=this.getField("ikona."+(strana));
var g=this.getField("animtiph."+cislo);
f.hidden=false;
f.buttonSetIcon(g.buttonGetIcon());
@@ -478,7 +483,6 @@
\else
\begin{insDLJS}[fancyTooltipsLoaded]{Tooltipsdljs}{DLJS for Tooltips}
var animace;
- app.focusRect = false;
var fancyTooltipsLoaded = true;
function CloseTooltips()
@@ -504,9 +508,9 @@
return(1);
}
- function nastav(cislo)
+ function nastav(cislo,strana)
{
- var f=this.getField("ikona."+(this.pageNum+1));
+ var f=this.getField("ikona."+(strana));
var g=this.getField("animtiph."+cislo);
var sourf=f.rect;
var sourg=g.rect;
@@ -523,9 +527,9 @@
f.buttonAlignY=percY;
}
- function zobraz(cislo)
+ function zobraz(cislo,strana)
{
- var f=this.getField("ikona."+(this.pageNum+1));
+ var f=this.getField("ikona."+(strana));
var g=this.getField("animtiph."+cislo);
f.hidden=false;
f.buttonSetIcon(g.buttonGetIcon());