* interactive content in header
@ 2003-01-19 17:48 Patrick Gundlach
2003-01-20 10:08 ` Hans Hagen
0 siblings, 1 reply; 5+ messages in thread
From: Patrick Gundlach @ 2003-01-19 17:48 UTC (permalink / raw)
Dear ConTeXt users,
I'd like to have an interactive table of content in the header (at
least somewhere at the top of the page). It should have the current
section highlighted.
First I have defined an overlay and used it with \setupbackgrounds:
\defineoverlay[toc][{\coloredcontent}]
\setupbackgrounds[header][text][background=toc,frame=on,state=repeat]
But the \coloredcontent behaves weired. \def\coloredcontent{A\par BB} gets
typeset as ABB, \currentheadnumber always displays the same number
(even with \determineheadnumber[section] before
\getcurrentheadnumber) and \placecontent is completely ignored.
It should look like this:
--------------
section1 | section 2 | section 3 section 4
------------- ----------------------------
the current page holds some paragraphs of section 2. Now you click on
"section 4" and the display changes to:
-------------
section1 section 2 section 3 | section 4 |
---------------------------------------- --
I hope it is clear what I'd like to get. How could this be done?
Patrick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: interactive content in header
2003-01-19 17:48 interactive content in header Patrick Gundlach
@ 2003-01-20 10:08 ` Hans Hagen
2003-01-20 11:17 ` Patrick Gundlach
0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2003-01-20 10:08 UTC (permalink / raw)
At 06:48 PM 1/19/2003 +0100, Patrick Gundlach wrote:
>Dear ConTeXt users,
>
>I'd like to have an interactive table of content in the header (at
>least somewhere at the top of the page). It should have the current
>section highlighted.
>
>First I have defined an overlay and used it with \setupbackgrounds:
>
>\defineoverlay[toc][{\coloredcontent}]
>\setupbackgrounds[header][text][background=toc,frame=on,state=repeat]
>
>But the \coloredcontent behaves weired. \def\coloredcontent{A\par BB} gets
>typeset as ABB, \currentheadnumber always displays the same number
>(even with \determineheadnumber[section] before
>\getcurrentheadnumber) and \placecontent is completely ignored.
>
>
>It should look like this:
>
> --------------
> section1 | section 2 | section 3 section 4
>------------- ----------------------------
>
>
>the current page holds some paragraphs of section 2. Now you click on
>"section 4" and the display changes to:
>
>
> -------------
> section1 section 2 section 3 | section 4 |
>---------------------------------------- --
>
>
>I hope it is clear what I'd like to get. How could this be done?
since you're a programmer and mp lover, let's go for the hard way:
beware" \par in an hbox is ignored (so in case of an framed thing, set the
align variable)
conforming s-pre-19 and metafun:
\setupinteractionmenu
[top]
[state=start,
frame=off,
color=,
contrastcolor=blue,
position=yes]
\setupbackgrounds
[page]
[background=highlight]
\defineoverlay
[highlight]
[\useMPgraphic{highlight}]
\startusableMPgraphic{highlight} % walking box
StartPage ;
def top_menu_button (expr nn, rr, pp, xx, yy, ww, hh, dd) =
if (pp>0) and (rr>0) :
if rr = 2 : % the current active link
path q ; q := unitsquare xyscaled (ww,hh) shifted (xx,yy) ;
fill q withcolor red ;
draw q withpen pencircle scaled 1.5pt withcolor .5red ;
fi ;
fi ;
enddef ;
\MPmenubuttons{top}
StopPage ;
\stopusableMPgraphic
\startusableMPgraphic{highlight} % your email drawing
StartPage ;
path p ; p := origin -- cycle ;
def top_menu_button (expr nn, rr, pp, xx, yy, ww, hh, dd) =
if (pp>0) and (rr>0) :
if rr = 2 : % the current active link
p := unitsquare xyscaled (ww,hh) shifted (xx,yy) ;
fi ;
fi ;
enddef ;
\MPmenubuttons{top}
draw
llcorner Field[Text][Top] --
(xpart llcorner p,ypart llcorner Field[Text][Top]) --
(xpart ulcorner p,ypart ulcorner Field[Text][Top]) --
(xpart urcorner p,ypart ulcorner Field[Text][Top]) --
(xpart lrcorner p,ypart llcorner Field[Text][Top]) --
lrcorner Field[Text][Top]
% dashed evenly scaled 2
withpen pencircle scaled 2pt
withcolor .5red ;
StopPage ;
\stopusableMPgraphic
\setupcolors
so, use the top area, and in case of backgrounds make sure that they are
calculated each page (which is default for page backgrounds); search for
'repeat' in s-pre-*.tex files
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
information: http://www.pragma-ade.com/roadmap.pdf
documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: interactive content in header
2003-01-20 10:08 ` Hans Hagen
@ 2003-01-20 11:17 ` Patrick Gundlach
2003-01-20 11:53 ` Hans Hagen
2003-01-20 13:29 ` Hans Hagen
0 siblings, 2 replies; 5+ messages in thread
From: Patrick Gundlach @ 2003-01-20 11:17 UTC (permalink / raw)
Hans Hagen <pragma@wxs.nl> writes:
Hello Hans,
> conforming s-pre-19 and metafun:
well s-pre-19 does not get any useable results with the current
beta. The colors etc. are ok, but the output is shifted to the right
and no menu appears. With context/2002.05.15 this looks ok.
> \setupinteractionmenu
> [top]
> [state=start,
> frame=off,
> color=,
> contrastcolor=blue,
> position=yes]
[...]
I guess I have to use: \startinteractionmenu[top] ...
\stopinteractionmenu but the \placelist is ignored inside this group.
Patrick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: interactive content in header
2003-01-20 11:17 ` Patrick Gundlach
@ 2003-01-20 11:53 ` Hans Hagen
2003-01-20 13:29 ` Hans Hagen
1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2003-01-20 11:53 UTC (permalink / raw)
At 12:17 PM 1/20/2003 +0100, you wrote:
>Hans Hagen <pragma@wxs.nl> writes:
>
>Hello Hans,
>
> > conforming s-pre-19 and metafun:
>
>well s-pre-19 does not get any useable results with the current
>beta. The colors etc. are ok, but the output is shifted to the right
>and no menu appears. With context/2002.05.15 this looks ok.
hm, stange, will look into it asap,
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
information: http://www.pragma-ade.com/roadmap.pdf
documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: interactive content in header
2003-01-20 11:17 ` Patrick Gundlach
2003-01-20 11:53 ` Hans Hagen
@ 2003-01-20 13:29 ` Hans Hagen
1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2003-01-20 13:29 UTC (permalink / raw)
At 12:17 PM 1/20/2003 +0100, you wrote:
>Hans Hagen <pragma@wxs.nl> writes:
>
>Hello Hans,
>
> > conforming s-pre-19 and metafun:
>
>well s-pre-19 does not get any useable results with the current
>beta. The colors etc. are ok, but the output is shifted to the right
>and no menu appears. With context/2002.05.15 this looks ok.
has to do with catching an inconsistent spec of layout; so i'll remove the
check -)
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
information: http://www.pragma-ade.com/roadmap.pdf
documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-01-20 13:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-19 17:48 interactive content in header Patrick Gundlach
2003-01-20 10:08 ` Hans Hagen
2003-01-20 11:17 ` Patrick Gundlach
2003-01-20 11:53 ` Hans Hagen
2003-01-20 13:29 ` 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).