diff options
author | Karl Berry <karl@freefriends.org> | 2010-04-08 23:38:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-04-08 23:38:12 +0000 |
commit | 6cae3a9e4038f488584a8d9469802f9376cba64e (patch) | |
tree | dd61cead0ef2670f4fd63488a2ca0cec25351d14 /Master/texmf-dist/source/latex/ocgtools | |
parent | 8ff11e49578310a0c3428113e92191f2cfb6a817 (diff) |
ocgtools 0.6 (8apr10)
git-svn-id: svn://tug.org/texlive/trunk@17759 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/ocgtools')
-rw-r--r-- | Master/texmf-dist/source/latex/ocgtools/ocgtools.dtx | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/latex/ocgtools/ocgtools.dtx b/Master/texmf-dist/source/latex/ocgtools/ocgtools.dtx index 4d9a399a154..af5abccad5b 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/04/01 v0.5 ocgtools.dtx file] + [2010/04/10 v0.6 ocgtools.dtx file] %</package> % %<*driver> @@ -40,7 +40,7 @@ %</driver> % \fi % -% \CheckSum{821} +% \CheckSum{824} % % \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 @@ -60,6 +60,7 @@ % % % \changes{v0.5}{2010/04/01}{First public version} +% \changes{v0.6}{2010/04/10}{Keeping document's dirty for Adobe Acrobat users} % % \GetFileInfo{ocgtools.dtx} % @@ -205,7 +206,11 @@ % placed on the right bottom corner of the text or picture which % opens the layer. More details: MouseOver opens the layer and % MouseExit hides this layer again. If mouse button is clicked, the -% layer remains opened after exiting the button. +% layer remains opened after exiting the button and can be closed by +% hovering and exiting minibutton, clicking the active area outside +% the minibutton or clicking the red cross. The field with red cross +% gets focus after opening the layer and hence pressing Enter key +% also hides the layer or minilayer. % \item[\texttt{minimouseover}] As mouseover, but restricted to % minilayers. % \item[\texttt{noocg}] The package and its commands are ignored. @@ -287,6 +292,9 @@ % code for default settings). % % \section{Possible future development and known problems} +% The source code is in Mercurial repository at +% \url{http://bitbucket.org/robert.marik/ocgtools/}. You can also +% report problems and issues in the forum at this site. % \begin{enumerate} % \item Test and support more packages for slides than current % web.sty, pdfscreen.sty and beamer.sty? Which ones? @@ -297,7 +305,8 @@ % clicking moves the user to the page with this equation % (figure). Or would |fancytooltips| produce better results in this % case (smaller PDF file)? See also the paper by Ross More at -% \url{http://www.tug.org/TUGboat/Articles/tb29-3/tb93moore.pdf}. See +% \url{http://www.tug.org/TUGboat/Articles/tb29-3/tb93moore.pdf} and +% the demo |examples/fancy-preview| in fancytooltips directory. See % the |ocgtools-preview.*| files for some initial attempts in this % direction. % \item Introduce draft mode, which prints all layers at the end of @@ -370,6 +379,13 @@ \newif\if@ocgtools@pageclose \@ocgtools@pageclosetrue \DeclareOption{nopageclose}{\@ocgtools@pageclosefalse} \ProcessOptions + +% \end{macrocode} +% We use the hack for Adobe Acrobat suggested by DPS and Jorg at +% http://www.acrotex.net/forum/showthread.php?tid=78. +% \begin{macrocode} +\def\ocgtools@JS#1{\JS{DirtyBeforeOCGtools=this.dirty; #1 + this.dirty=DirtyBeforeOCGtools;}} % \end{macrocode} % We insert JavaScripts which are evaluated when the file is opened at % the first page. @@ -399,7 +415,8 @@ % \end{macrocode} % No dotted rectangle for buttons which have focus. % \begin{macrocode} - app.focusRectg = false; + app.focusRect = false; + var DirtyBeforeOCGtools=this.dirty; % \end{macrocode} % The OCG objects inserted by ocgtools are stored in variable % |ocgtoolsOCGs| when the PDF document is opened on the first page. @@ -420,10 +437,12 @@ iniocgtoolsOCGs[0].state=false; \ifx\ocgtools@progressmsg\relax\relax\else this.getField("ocgtoolsmsg").hidden=true; + this.dirty=false; \fi } \ifocg@hide@button this.getField("OcgtoolsBtn.HideButton.main").hidden = true; + this.dirty=false; \fi ) >> >> @@ -518,7 +537,7 @@ % buttons, we keep possibility to make them hidden, in contrast to % links). % \begin{macrocode} -\def\ocgtools@HideBtn{\pushButton[\W{0}\BG{}\S{S}\BC{}\H{N}\F{\FHidden}\A{\JS{ +\def\ocgtools@HideBtn{\pushButton[\W{0}\BG{}\S{S}\BC{}\H{N}\F{\FHidden}\A{\ocgtools@JS{ for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) { ocgtoolsOCGs[i].state = false; @@ -534,7 +553,7 @@ \hbox to \wd\ocgtools@box@a% {\hbox{{\color{red}\ocgclosechar}}\hss% \hbox{\pushButton[\W{0}\S{S}\BG{}\BC{}\H{N}% -\F{\FHidden}\A{\JS{ +\F{\FHidden}\A{\ocgtools@JS{ for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) { if(ocgtoolsOCGs[i].name == "ocgtools#1") @@ -552,7 +571,7 @@ \hbox to \wd\ocgtools@box@a% {\hbox{{\color{red}\ocgclosechar}}\hss% \hbox{\pushButton[\W{0}\S{S}\BG{}\BC{}\H{N}% -\F{\FHidden}\A{\JS{ +\F{\FHidden}\A{\ocgtools@JS{ for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) { ocgtoolsOCGs[i].state = false; @@ -577,6 +596,7 @@ /A << /S/JavaScript /JS ( + DirtyBeforeOCGtools=this.dirty; for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) { if(ocgtoolsOCGs[i].name == "ocgtools#1") @@ -587,18 +607,19 @@ \ifocg@hide@button this.getField("OcgtoolsBtn.HideButton.main").hidden = false;\fi this.getField("OcgtoolsBtn.HideButton.corner").hidden = false; this.getField("OcgtoolsBtn.HideButton.corner.#1").setFocus(); + this.dirty=DirtyBeforeOCGtools; ) >> }#2% \if@ocgtools@mouseover \hbox to 0 pt{\hss\pushButton[\W{0}\S{S}\BG{}\BC{}\H{N}% - \A{\JS{ + \A{\ocgtools@JS{ var OpenedByMouseEnter#1=false; \ifocg@hide@button this.getField("OcgtoolsBtn.HideButton.main").hidden = false;\fi this.getField("OcgtoolsBtn.HideButton.corner").hidden = false; this.getField("OcgtoolsBtn.HideButton.corner.#1").setFocus(); }} - \AA{\AAMouseEnter{\JS{ for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) + \AA{\AAMouseEnter{\ocgtools@JS{ for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) { var OpenedByMouseEnter#1=true; if(ocgtoolsOCGs[i].name == "ocgtools#1") @@ -607,7 +628,7 @@ ocgtoolsOCGs[i].state = false; } }} - \AAMouseExit{\JS{ + \AAMouseExit{\ocgtools@JS{ if (OpenedByMouseEnter#1) {for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) { @@ -631,6 +652,7 @@ /A << /S/JavaScript /JS ( + DirtyBeforeOCGtools=this.dirty; for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) { if(ocgtoolsOCGs[i].name == "ocgtools#1") @@ -640,16 +662,17 @@ !this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden; if (!this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden) {this.getField("OcgtoolsBtn.HideButton.mini.#1").setFocus();} + this.dirty=DirtyBeforeOCGtools; ) >> }#2% \if@ocgtools@minimouseover \hbox to 0 pt{\hss\pushButton[\W{0}\S{S}\BG{}\BC{}\H{N}% - \A{\JS{ + \A{\ocgtools@JS{ var OpenedByMouseEnter#1=false; this.getField("OcgtoolsBtn.HideButton.mini.#1").setFocus(); }} - \AA{\AAMouseEnter{\JS{for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) + \AA{\AAMouseEnter{\ocgtools@JS{for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) { var OpenedByMouseEnter#1=true; if(ocgtoolsOCGs[i].name == "ocgtools#1") @@ -657,7 +680,7 @@ } this.getField("OcgtoolsBtn.HideButton.mini.#1").hidden = false; }} - \AAMouseExit{\JS{ + \AAMouseExit{\ocgtools@JS{ if (OpenedByMouseEnter#1) { for(var i=0; ocgtoolsOCGs && i<ocgtoolsOCGs.length;i++) |