1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
%D \module
%D [ file=s-pre-60,
%D version=2004.03.15,
%D title=\CONTEXT\ Style File,
%D subtitle=Presentation Environment 60,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
\newcounter\StepCounter
\newcounter\StepMaximum
\useJSscripts[stp]
\startsetups[set-stepper]
\ifnum\getvariable{stepper}{nofsteps}>\StepMaximum
\dostepwiserecurse {\numexpr(\StepMaximum+1)} {\getvariable{stepper}{nofsteps}} {1}
{\doifnotmode{nosteps,nostep}
{\expanded{\defineproperty[step:\recurselevel][layer][state=stop,global=yes]}}}
\xdef\StepMaximum{\getvariable{stepper}{nofsteps}}
\fi
\stopsetups
\setvariables
[stepper]
[set=\setups{set-stepper},
nofsteps=50]
\defineproperty[step:busy][layer][state=start]
\definereference [SetupStepper] [JS(SetupStepper{step,\StepMaximum})]
\definereference [ResetStepper] [JS(ResetStepper)]
\definereference [CheckStepper] [JS(CheckStepper{\StepCounter})]
\definereference [InvokeStepper] [JS(InvokeStepper)]
\def\ResetStep {\doglobal\newcounter\StepCounter}
\def\NextStep {\doglobal\increment \StepCounter}
\def\PrevStep {\doglobal\decrement \StepCounter}
% todo: roll back blank
\def\StepLayer{step:\StepCounter}
\def\StartStep
{\ifvmode
\scratchskip\lastskip
\vskip-\scratchskip
\startproperty[\StepLayer]%
\vskip\scratchskip
\else
\startproperty[\StepLayer]%
\fi
\ignorespaces}
\def\StopStep
{\removeunwantedspaces
\stopproperty}
\def\StartSteps{\iftrialtypesetting\else\ResetStep\NextStep\StartStep\fi}
\def\StopSteps {\iftrialtypesetting\else\StopStep\PrevStep\fi}
\def\FlushStep {\iftrialtypesetting\else\StopStep\NextStep\StartStep\fi}
\appendtoks
\ResetStep
\to \everyaftershipout
\def\StartBusy{\startproperty[step:busy]\ignorespaces}
\def\StopBusy {\removeunwantedspaces\stopproperty}
\setupinteraction
[openaction=SetupStepper,
openpageaction=CheckStepper,
closepageaction=ResetStepper]
\defineoverlay[invoke][\overlaybutton{InvokeStepper}]
\setupbackgrounds
[text]
[background=invoke]
% bonus
\useMPlibrary[nav]
\definepalet
[navplus]
[attach=interactioncolor,
comment=interactioncolor]
\setupcomment
[symbol={comment-normal,comment-down},
textlayer=\StepLayer,
option=buffer,
height=\textheight,
width=\textwidth,
margin=0pt]
\setupattachments
[symbol={attach-normal,attach-down},
textlayer=\StepLayer]
\endinput
|