ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Fielstack and Layers for Presentation
@ 2006-10-12 17:58 Renaud AUBIN
  2006-10-13 13:38 ` Peter Rolf
  2006-10-13 21:54 ` Renaud AUBIN
  0 siblings, 2 replies; 6+ messages in thread
From: Renaud AUBIN @ 2006-10-12 17:58 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 2337 bytes --]

Hi all,

I would use fieldstack with \getbuffer and overlays... Why the following
code doesn't work ? Is there another way to do that ?

TIA


Renaud

%%%%%%% stack.tex

\setupcolors[state=start]
\usemodule[pre-original]

\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][frame=off,background=FunnyFrame]
\def\StartFrame{\startFunnyText}
\def\StopFrame {\stopFunnyText }
\def\FrameTitle#1%
{\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}}
\setMPtext{FunnyFrame}{} % initialize the text variable
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt(\MPstring{FunnyFrame}) ;
a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ;
o := BodyFontSize ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
b := a randomized (o/2) ;
fill b withcolor .85white ; draw b ;
c := center p ;
c := b intersectionpoint (c shifted (0,-o)--c shifted(0,o)) ;
p := p shifted (c-center p) ;
b := (boundingbox p) randomized (o/8) ;
fill b withcolor .85white ; draw b ;
draw p withcolor black;
setbounds currentpicture to a ;
\stopuseMPgraphic

\definelayer[bglayer][position=yes]
\setupbackgrounds[text][background=bglayer]
\setuplayer[bglayer][position=no,corner=bottom,height=\paperheight]


\starttext

\startbuffer[first]
  \setlayer[bglayer][x=.55\textwidth,y=.9\textheight,location=b]{
    \FrameTitle{Knuth}
    \StartFrame[width=.75\textwidth]
      \input knuth
    \StopFrame
  }
\stopbuffer
 
\startbuffer[second]
  \setlayer[bglayer][x=.625\textwidth,y=.8\textheight,location=b]{
    \FrameTitle{Zapf}
    \StartFrame[width=.75\textwidth]
      \input zapf
    \StopFrame
  }
\stopbuffer

\startbuffer[third]
  \setlayer[bglayer][x=.70\textwidth,y=.7\textheight,location=b]{
    \FrameTitle{Tufte}
    \StartFrame[width=.75\textwidth]
      \input tufte
    \StopFrame
  }
\stopbuffer

  \definesymbol[empty][]
  \definesymbol[one][{\getbuffer[first]}]
  \definesymbol[two][{\getbuffer[first,second]}]
  \definesymbol[three][{\getbuffer[first,second,third]}]


\Topic{Stacks \& Layers}

{\setupbodyfont[12pt]

\definefieldstack[sequence]
  [one,two,three]
  [frame=off,
   offset=none,
   clickin=JS(Walk_Field{sequence})]

{\fieldstack[sequence]}

\goto{next}[JS(Walk_Field{sequence})]
}

\stoptext

[-- Attachment #1.2: Type: text/html, Size: 3317 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-15 20:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-12 17:58 Fielstack and Layers for Presentation Renaud AUBIN
2006-10-13 13:38 ` Peter Rolf
2006-10-13 21:54 ` Renaud AUBIN
2006-10-14 10:12   ` Peter Rolf
2006-10-15 20:14     ` Renaud AUBIN
2006-10-14 17:40   ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).