ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: vertical interactionbar?
Date: Thu, 8 Mar 2007 19:51:17 +0100	[thread overview]
Message-ID: <74F71148-593A-4DDE-B90F-AC9E01A93388@uni-bonn.de> (raw)
In-Reply-To: <97a06f070703080706p7debf2a3tbd70799d578bc5e9@mail.gmail.com>


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

  reply	other threads:[~2007-03-08 18:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-08 15:06 Johan Sandblom
2007-03-08 18:51 ` Thomas A. Schmitz [this message]
2007-03-09 14:33 ` Willi Egger
2007-03-11 21:55 ` Hans Hagen
2007-03-12 13:36   ` Johan Sandblom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74F71148-593A-4DDE-B90F-AC9E01A93388@uni-bonn.de \
    --to=thomas.schmitz@uni-bonn.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).