On Mar 8, 2007, at 4:06 PM, Johan Sandblom wrote:

> I am trying to make a presentation with a progress bar. I want it
> along the right edge of the screen. I remember seeing something like
> that but cannot find it now, and all the alternatives for
> interactionbar seem to require a horizontal one.
>
> How can I make a vertical progress bar?
>
> Regards, Johan

I'm not sure if there is an option to have an actual progress bar  
along the right edge, but for a presentation I had to do recently, I  
also wanted something like this and came up with this code. Maybe  
this can inspire you a bit:

\definecolor[outer][r=0,g=0,b=.92]
\definecolor[current][r=0,g=0,b=.4]
\definecolor[inner][s=.98]

\defineoverlay[mybackground][\useMPgraphic{left}]

\startuseMPgraphic{left}
StartPage ;
fill Page withcolor \MPcolor{inner} ;
z1 = ulcorner Page ;
z5 = llcorner Page ;
path q ;
q = z1 -- z5 ;
t = arclength (q) ;
u = t/15 ;
v = (PageNumber/NOfPages) ;
z4 = (x1+1cm, y1-1cm) ;
z3 = (x4, y1) ;
z2 = (x1, y4) ;
path m[] ;
m[1] = z1 -- z2 -- z4 -- z3 -- cycle ;
m[2] = m[1] shifted (0, -2*u) ;
m[3] = m[1] shifted (0, -4*u) ;
m[4] = m[1] shifted (0, -6*u) ;
m[5] = m[1] shifted (0, -8*u) ;
m[6] = m[1] shifted (0, -10*u) ;
m[7] = m[1] shifted (0, -12*u) ;
m[8] = m[1] shifted (0, (-14*u-0.5mm)) ;
for i=1 upto 8:
         fill m[i] withcolor\MPcolor{outer} ;
endfor;
if PageNumber=1:
         fill m[1] withcolor \MPcolor{current} ;
elseif (v>.001) and (v<.167) :
         fill m[2] withcolor \MPcolor{current} ;
elseif (v>.166) and (v<.334):
         fill m[3] withcolor \MPcolor{current} ;
elseif (v>.333) and (v<.501):
         fill m[4] withcolor \MPcolor{current} ;
elseif (v>.5) and (v<.667):
         fill m[5] withcolor \MPcolor{current} ;
elseif (v>.666) and (v<.834):
         fill m[6] withcolor \MPcolor{current} ;
elseif (v>.833) and (v<1):
         fill m[7] withcolor \MPcolor{current} ;
elseif v=1:
         fill m[8] withcolor \MPcolor{current} ;
fi ;
StopPage ;

\stopuseMPgraphic

\setupbackgrounds[page][background={mybackground}]

HTH

Thomas


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

Reply via email to