s-pre-12.tex /size: 5469 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [      file=s-pre-12,
3%D        version=1999.08.20,
4%D          title=\CONTEXT\ Style File,
5%D       subtitle=Presentation Environment 12,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\setuppapersize
15  [S6][S6]
16
17\setuplayout
18  [topspace=0cm,
19   backspace=0cm,
20   header=0pt,
21   footer=0pt,
22   width=middle,
23   height=middle]
24
25\setupbodyfont
26  [14.4pt,lbr]
27
28\setupcolors
29  [state=start]
30
31\setupinteraction
32  [click=no,
33   display=new,
34   state=start]
35
36\setupinteractionscreen
37  [option=max]
38
39\def\SomeShape%
40  {\resetMPdrawing
41   \startMPdrawing
42     path p ; pair a, b ;
43     ahlength := .375cm ;
44     StartPage ;
45     draw Page %unitsquare
46       %xscaled PaperWidth yscaled PaperHeight
47       withpen pencircle scaled .5cm
48       withcolor \MPcolor{EdgeColor} ;
49   \stopMPdrawing
50   \dorecurse{\CurrentTopic}
51     {\startMPdrawing
52        initialize_box(\MPpos{topic-\realfolio-\recurselevel}) ;
53        p := tensecircle (wxy,hxy,.25cm) shifted cxy ;
54        fill p withcolor .9white  ;
55        pickup pencircle scaled .25cm ;
56        \ifnum\recurselevel=\CurrentTopic
57          draw p withcolor \MPcolor{ShowColor} ;
58          a := bot point 7 of p ;
59        \else
60          draw p withcolor \MPcolor{DoneColor} ;
61        \fi
62      \stopMPdrawing}
63   \dorecurse{\CurrentMaxItem}
64     {\startMPdrawing
65        initialize_box(\MPpos{item-\realfolio-\recurselevel}) ;
66        linewidth := .25cm ;
67        p := tensecircle (wxy,hxy,linewidth) shifted cxy ;
68        fill p withcolor .9white  ;
69        pickup pencircle scaled linewidth ;
70        b := rt point 3 of p ;
71        \ifnum\recurselevel=\CurrentMaxItem
72          draw p withcolor \MPcolor{ShowColor} ;
73        \else
74          draw p withcolor \MPcolor{DoneColor} ;
75        \fi
76        dxab := xpart a-xpart b ;
77        dyab := ypart a-ypart b ;
78        sign := if dyab>0 : - fi 1 ;
79        drawarrow
80          a --
81          a shifted (+2linewidth-dxab/2,0) {left} ..
82          if abs(dyab)>4linewidth :
83            a shifted (-dxab/2,+sign*2linewidth) --
84            b shifted (+dxab/2,-sign*2linewidth) ..
85          fi
86          {left} b shifted (-2linewidth+dxab/2,0) --
87          b
88          withcolor \MPcolor{ArrowColor} ;
89      \stopMPdrawing}%
90   \startMPdrawing
91     StopPage ;
92   \stopMPdrawing
93   \MPdrawingdonetrue
94   \getMPdrawing}
95
96\definecolor[PageColor][r=.5,g=.4,b=.3]
97\definecolor[LineColor][r=.7,g=.6,b=.5]
98
99\definecolor[PageColor]  [s=.60]
100\definecolor[ShowColor]  [r=.40]
101\definecolor[EdgeColor]  [g=.40]
102\definecolor[DoneColor]  [r=.40,g=.40]
103\definecolor[ArrowColor] [b=.40]
104\definecolor[LineColor]  [r=.60,g=.60]
105\definecolor[GotoColor]  [ArrowColor]
106
107\setupinteraction[color=GotoColor,contrastcolor=GotoColor]
108
109\defineoverlay [shape] [\SomeShape]
110\defineoverlay [next]  [\overlaybutton{forward}]
111
112\setupbackgrounds
113  [page]
114  [background={color,next,shape},
115   backgroundcolor=PageColor]
116
117\doglobal\newcounter\CurrentItem
118\doglobal\newcounter\CurrentTopic
119\doglobal\newcounter\CurrentMaxItem
120
121\def\StartIdea%
122  {\doglobal\newcounter\CurrentItem}
123
124\def\StartTopic%
125  {\doglobal\increment\CurrentTopic
126   \dostartbuffer[topic-\CurrentTopic][StartTopic][StopTopic]}
127
128\def\StopIdea%
129  {\dorecurse{\CurrentItem}
130     {\let\CurrentMaxItem\recurselevel
131      \doStopIdea}}
132
133\def\IdeaWidth {.6\makeupwidth} % .5
134\def\TopicWidth{.2\makeupwidth} % .3
135
136\def\doStopIdea%
137  {\startstandardmakeup
138   \dontcomplain
139   \vbox to \makeupheight
140     {\vskip.75cm \relax % \vfill
141      \dorecurse{\CurrentMaxItem}
142        {\edef\Item{item-\realfolio-\recurselevel}
143         \hbox to \makeupwidth
144           {\hskip.75cm
145            \hpos
146              {\Item}
147              {\framed
148                 [width=\IdeaWidth,frame=off,
149                  align=middle,offset=.125cm]
150                 {\getbuffer[item-\recurselevel]}}}
151         \vskip.875cm}
152      \vfill}
153   \vskip-\makeupheight
154   \vbox to \makeupheight
155     {\vskip.75cm \relax
156      \dorecurse{\CurrentTopic}
157        {\edef\Topic{topic-\realfolio-\recurselevel}
158         \hbox to \makeupwidth
159           {\hfill
160            \hpos
161              {\Topic}
162              {\framed
163                 [width=\TopicWidth,frame=off,
164                  align=middle,offset=.25cm]
165                 {\getbuffer[topic-\recurselevel]}}%
166            \hskip.75cm}
167         \vskip.875cm}
168      \vfill}
169   \stopstandardmakeup}
170
171\def\StartItem%
172  {\doglobal\increment\CurrentItem
173   \dostartbuffer[item-\CurrentItem][StartItem][StopItem]}
174
175\lefthyphenmin =\maxdimen
176\righthyphenmin=\maxdimen
177
178\def\TitlePage#1%
179  {\startstandardmakeup
180     \setupalign[middle]
181     \def\\{\vfil\bfb\setupinterlinespace}
182     \bfd\setupinterlinespace
183     \vfil#1\vfil\vfil
184   \stopstandardmakeup}
185
186\doifnotmode{demo}{\endinput}
187
188\starttext
189
190\StartIdea
191  \StartTopic
192     What a topic
193  \StopTopic
194  \StartItem
195    \input reich \relax
196  \StopItem
197  \StartItem
198    \input reich \relax
199  \StopItem
200  \StartItem
201    \input reich \relax
202  \StopItem
203\StopIdea
204
205\StartIdea
206  \StartTopic
207     One More Nice Idea
208  \StopTopic
209  \StartItem
210    \input reich \relax
211 \StopItem
212  \StartItem
213    \input reich \relax
214  \StopItem
215\StopIdea
216
217\StartIdea
218  \StartTopic
219     The Last Idea
220  \StopTopic
221  \StartItem
222    \input tufte \relax
223  \StopItem
224\StopIdea
225
226\stoptext
227