From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31349 Path: news.gmane.org!not-for-mail From: Renaud AUBIN Newsgroups: gmane.comp.tex.context Subject: Fielstack and Layers for Presentation Date: Thu, 12 Oct 2006 19:58:23 +0200 Message-ID: <452E823F.6040503@nibua-r.org> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1853316736==" X-Trace: sea.gmane.org 1160676573 24642 80.91.229.2 (12 Oct 2006 18:09:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2006 18:09:33 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Oct 12 20:09:28 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1GY4ph-0000mr-Mq for gctc-ntg-context-518@m.gmane.org; Thu, 12 Oct 2006 19:59:02 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E246C1FE6A; Thu, 12 Oct 2006 19:58:59 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06037-05-5; Thu, 12 Oct 2006 19:58:49 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id F23511FE30; Thu, 12 Oct 2006 19:58:48 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BE35C1FE30 for ; Thu, 12 Oct 2006 19:58:44 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06037-05-4 for ; Thu, 12 Oct 2006 19:58:37 +0200 (CEST) Original-Received: from 26.mail-out.ovh.net (26.mail-out.ovh.net [213.186.42.179]) by ronja.ntg.nl (Postfix) with SMTP id 069331FE2D for ; Thu, 12 Oct 2006 19:58:35 +0200 (CEST) Original-Received: (qmail 12127 invoked by uid 503); 12 Oct 2006 17:58:55 -0000 Original-Received: (QMFILT: 1.0); 12 Oct 2006 17:58:55 -0000 Original-Received: from b7.ovh.net (HELO mail148.ha.ovh.net) (213.186.33.57) by 26.mail-out.ovh.net with SMTP; 12 Oct 2006 17:58:55 -0000 Original-Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 12 Oct 2006 17:58:34 -0000 Original-Received: from d83-179-99-76.cust.tele2.fr (HELO ?192.168.78.10?) (aubin@nibua-r.org@83.179.99.76) by ns0.ovh.net with SMTP; 12 Oct 2006 17:58:31 -0000 User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: fr, en Original-To: ConTeXt Mailing List X-Ovh-Remote: 83.179.99.76 (d83-179-99-76.cust.tele2.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|H 0.5/N X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:31349 Archived-At: This is a multi-part message in MIME format. --===============1853316736== Content-Type: multipart/alternative; boundary="------------010808030704090901050407" This is a multi-part message in MIME format. --------------010808030704090901050407 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 --------------010808030704090901050407 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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
--------------010808030704090901050407-- --===============1853316736== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --===============1853316736==--