diff options
author | Karl Berry <karl@freefriends.org> | 2007-02-22 19:55:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-02-22 19:55:16 +0000 |
commit | 2f5894cda3e5c9c65f3a7c15097ccab670381247 (patch) | |
tree | 53c749decfdbb74760a33b4861a93d3cc0562458 /Master/texmf-dist/tex/latex | |
parent | 7144b710518294eb640d7f28ff4ff08b656fd35d (diff) |
new latex package fancytooltips, 19feb07
git-svn-id: svn://tug.org/texlive/trunk@3982 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/fancytooltips/fancytooltips.sty | 255 |
1 files changed, 255 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/fancytooltips/fancytooltips.sty b/Master/texmf-dist/tex/latex/fancytooltips/fancytooltips.sty new file mode 100644 index 00000000000..63e25d98e78 --- /dev/null +++ b/Master/texmf-dist/tex/latex/fancytooltips/fancytooltips.sty @@ -0,0 +1,255 @@ +%% +%% This is file `fancytooltips.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fancytooltips.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2007 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 of this license +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.2 or later is part of all distributions of LaTeX version +%% 1999/12/01 or later. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{fancytooltips} + [2007/02/20 v1.1 fancytooltips.dtx file] +\RequirePackage{everyshi} +\RequirePackage{graphicx} +\RequirePackage{xkeyval} + +\newif\ifcreatetips\createtipsfalse +\DeclareOptionX{createtips}{\createtipstrue} + +\newif\ifTooltip@usepdftex\Tooltip@usepdftextrue +\DeclareOptionX{dvips}{\Tooltip@usepdftexfalse} + +\newif\ifextratext\extratexttrue +\DeclareOptionX{noextratext}{\extratextfalse} + +\DeclareOptionX{filename}{\xdef\TooltipFilename{#1}} +\DeclareOptionX{pages}{\xdef\TooltipPages{#1}} + +\ProcessOptionsX + +\ifx\TooltipFilename\undefined +\PackageWarning{fancytooltips}{** The filename with tooltips is not given. **} +\fi + +\ifTooltip@usepdftex +\def\TooltipExtratext{\hbox to 0 pt{\smash + {\raisebox{0.5em}{\includegraphics[width=1em]% + {fancytooltipsmark.pdf}}}\hss}} +\else +\def\TooltipExtratext{\hbox to 0 pt{\smash + {\raisebox{0.5em}{\includegraphics[width=1em]% + {fancytooltipsmark.eps}}}\hss}} +\fi%\ifTooltip@usepdftex +\ifextratext\else\let\TooltipExtratext\relax\fi + +\ifcreatetips +\newwrite\tipfile +\immediate\openout\tipfile fancytips.tex +\def\keytip#1{\write\tipfile{\string\tooltipname{#1}{\arabic{page}}}} +\else +\ifTooltip@usepdftex\else +\ifx\everyeqIcon\undefined +\newcommand\everyeqIcon[1]{\def\every@eqIcon{#1}} +\def\every@eqIcon{} +\newcommand\eqIcon[4][] +{% + \push@@Button{#1}{#2}{#3}{#4}{}{\eq@setButtonProps\eq@Button@driver}% + {\eqIconDefaults\every@ButtonField\every@eqIcon}% +} +\fi%\ifx\everyeqIcon\undefined +\def\eqIconDefaults +{% + \rawPDF{}\S{}\mkIns{/TP 1 /IF<</A[1.0 1.0]/SW/B>>}\R{270} + \CA{}\RC{}\AC{}\BC{}\BG{}\H{B} + \textColor{0 g}\Ff{\FfReadOnly} +} +\fi%\ifTooltip@usepdftex +\def\frametip{\vbox to 0 pt{\hbox to 0 pt{\hss\buttontip}\vss}} +\newdimen\buttontipwidth \buttontipwidth=5in +\newdimen\buttontipheight \buttontipheight=5in +\ifTooltip@usepdftex +\def\buttontip{% +\pdfstartlink user{% + /Subtype /Widget + /F 6 + /T (ikona) + /FT /Btn + /Ff 65536 + /H /N + /BS << /W 1 /S /S >> + /MK << /TP 1 /IF <</SW /B>> >> +}% +\vbox to \buttontipheight {\vss\hbox to \buttontipwidth{\hss}}\pdfendlink} +\else +\def\buttontip{% + \eqIcon[\BC{}\BG{}\F{\FHidden}]{ikona}{\buttontipwidth}{\buttontipheight} + } +\fi%\ifTooltip@usepdftex +\definecolor{tooltipcolor}{rgb}{0,0,1} +\def\tooltip#1#2{\checkTipNumber{#2}% + \edef\TipNumber{\FindTipNumber{#2}}% + \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) {} + if (event.shift) {this.getField("ikona").hidden=false; + this.getField('ikona').buttonSetIcon(this.getField("animtiph\TipNumber").buttonGetIcon());}}} + } + \A{\JS{this.getField("ikona").hidden=false; + try {app.clearInterval(animace);}catch (e) {} + this.getField('ikona').buttonSetIcon(this.getField("animtiph\TipNumber").buttonGetIcon());}}] + {TooltipField}{\wd0}{\ht0}} +\def\delayinterval{200} +\def\tooltipanim#1#2#3{% + \checkTipNumber{#2}\edef\TipNumberA{\FindTipNumber{#2}}% + \checkTipNumber{#3}\edef\TipNumberB{\FindTipNumber{#3}}% + \setbox0=\hbox{{\color{tooltipcolor}{#1}}}\hbox to 0 pt{{\copy0\TooltipExtratext\hss}}% + \pushButton[\BC{}\BG{}\S{}\AA{ + \AAMouseExit{\JS{CloseTooltips();}} + \AAMouseEnter{\JS{ + var cislo=\TipNumberA; + try {app.clearInterval(animace);}catch (e) {} + function animuj() + { + if (cislo<\TipNumberB) cislo=cislo+1; + this.getField('ikona').buttonSetIcon(this.getField("animtiph"+cislo).buttonGetIcon()); + }; + if (event.shift) { + this.getField('ikona').buttonSetIcon(this.getField("animtiph"+\TipNumberA).buttonGetIcon()); + this.getField("ikona").hidden=false; + animace=app.setInterval('animuj();', \delayinterval); + } + }} + } + \A{\JS{ + try {app.clearInterval(animace);}catch (e) {} + var cislo=\TipNumberA; + function animuj() + { + if (cislo<\TipNumberB) cislo=cislo+1; + this.getField('ikona').buttonSetIcon(this.getField("animtiph"+cislo).buttonGetIcon()); + }; + this.getField('ikona').buttonSetIcon(this.getField("animtiph"+\TipNumberA).buttonGetIcon()); + this.getField("ikona").hidden=false; + animace=app.setInterval('animuj();', \delayinterval); + }} + ]{TooltipField}{\wd0}{\ht0}} +\ifTooltip@usepdftex +\def\TooltipPageopencloseJS{ \global\pdfpageattr{% + /AA << /O << /S /JavaScript /JS (CloseTooltips();) >> >>}% +} +\pdfximage{\TooltipFilename.pdf}% +\edef\TooltipPages{\the\pdflastximagepages}% +\else +\def\TooltipPageopencloseJS{ +\literalps@out{% + [ {ThisPage} << /AA << + /O << /S /JavaScript /JS (CloseTooltips();) >> + >> >> /PUT pdfmark}} +\OpenAction{/S /JavaScript /JS (CloseTooltips();)} +\fi%\ifTooltip@usepdftex +\EveryShipout{\TooltipPageopencloseJS}% + +\ifTooltip@usepdftex +\begin{insDLJS}[clearTooltips]{Tooltipsdljs}{My Private DLJS for Tooltips} + var animace; + function CloseTooltips() + { + this.getField("ikona").hidden=true; + try {app.clearInterval(animace);}catch (e) {} + } +\end{insDLJS} +\else +\begin{insDLJS}[clearTooltips]{Tooltipsdljs}{My Private DLJS for Tooltips} + var animace; + function CloseTooltips() + { + this.getField("ikona").hidden=true; + try {app.clearInterval(animace);}catch (e) {} + } + function ImportTooltips() + { + for (var i=1;i<=\TooltipPages;i++) + {this.getField("animtiph"+i).buttonImportIcon("\TooltipFilename.pdf",(i-1));} + return(1); + } +\end{insDLJS} +\fi +\newcount\tooltip@count +\ifTooltip@usepdftex +\newcommand*{\TooltipHidden}{% + \count@=0 + \@whilenum\count@<\TooltipPages \do{% + \tooltip@count=\count@ + \advance \tooltip@count by 1 + \bgroup + \immediate\pdfximage + width 0 pt height 0 pt depth 0 pt + page \the\tooltip@count{\TooltipFilename.pdf}% + \mbox{\leavevmode + \pdfstartlink user{ + /Subtype /Widget + /F 6 + /T (animtiph\the\tooltip@count) + /FT /Btn + /Ff 65536 + /H /N + /BS << /W 1 /S /S >> + /MK << + /TP 1 + /I \the\pdflastximage\space 0 R + /IF << /SW /A >> + >> + }% + \pdfendlink}% + \egroup + \advance\count@\@ne}% +} +\else +\def\TooltipHidden{% + \count@=0 + \@whilenum\count@<\TooltipPages \do{% + \tooltip@count=\count@ + \advance \tooltip@count by 1 + \bgroup + \eqIcon[\BC{}\BG{}\F{\FHidden}] + {animtiph\the\tooltip@count}{0cm}{0cm}% + \egroup + \advance\count@\@ne}% +} +\fi +\AtBeginDocument{\IfFileExists{fancytips.tex}{\input{fancytips.tex} +\PackageInfo{fancytooltips}{Inputting fancytips.tex.}}% + {\PackageWarning{fancytooltips}{No file fancytips.tex! + Your keywords for tooltips will not work!}}} + +\def\tooltipname#1#2{\expandafter\xdef\csname FancyToolTip@#1\endcsname{#2}} + +\def\FindTipNumber#1{\expandafter\ifx \csname FancyToolTip@#1\endcsname\relax + #1\else\csname FancyToolTip@#1\endcsname\fi} + +\def\checkTipNumber#1{\expandafter\ifx + \csname FancyToolTip@#1\endcsname\relax \PackageWarning{fancytooltips}{No + framenumber is assigned to keyword #1. I assume that #1 is the + number of the frame.}% + \fi} + +\fi +\endinput +%% +%% End of file `fancytooltips.sty'. |