ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* table and MPpositiongraphic
@ 2003-03-11 16:30 Patrick Gundlach
  2003-03-11 21:48 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Gundlach @ 2003-03-11 16:30 UTC (permalink / raw)


Hello, 

while browsing thru the source and trying some examples, I can't
sensible output of the following code. (No MP stuff is visible)

%output=pdf

\setupcolors[state=start]

\def\cw#1{\color[green]{#1}}

\def\TableShade#1#2%
  {\startMPpositiongraphic
     initialize_area(\MPpos{b:#1},\MPpos{e:#1}) ;
     show pxy;
     linear_shade(pxy,0,.4#2,.9#2) ;
     anchor_area(\MPanchor{b:#1}) ;
   \stopMPpositiongraphic}

\dosetpositionaction{b:x}{\TableShade{x}{red}}
\dosetpositionaction{b:y}{\TableShade{y}{green}}
\dosetpositionaction{b:z}{\TableShade{z}{blue}}

\starttext
\starttable[|c|c|c|]
\GFC[b:z] \cw{this is a small}  \NC       \cw{table}            \NC     in which we      \NC \FR
\NC       \cw{will demonstrate} \GFC[c:y] \cw{that this}        \GTC[c] \cw{positioning} \NC \MR
\GSC[a:x] \cw{mechanism also}   \GTC[b]   \cw{works quite well} \NC     in tables        \NC \LR
\stoptable

\stoptext

Any ideas how to get the MPpositiongraphic working?

Patrick

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

* Re: table and MPpositiongraphic
  2003-03-11 16:30 table and MPpositiongraphic Patrick Gundlach
@ 2003-03-11 21:48 ` Hans Hagen
  2003-03-19  8:19   ` Patrick Gundlach
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2003-03-11 21:48 UTC (permalink / raw)


Hi Patrick,

>while browsing thru the source and trying some examples, I can't
>sensible output of the following code. (No MP stuff is visible)

right, this is because it's old crappy code; and so you got me in debugging 
mode again

\setupcolors[state=start]

\starttext

\def\cw#1{\color[white]{#1}}

\startMPpositiongraphic{tableshade}
   initialize_area(\MPpos{\MPvar{from}},\MPpos{\MPvar{to}}) ;
   color c ; c := \MPvar{color} ;
   linear_shade(pxy,0,.4c,.9c) ;
   anchor_area(\MPanchor{\MPvar{from}}) ;
\stopMPpositiongraphic

\setMPpositiongraphic{b:x}{tableshade}{from=b:x,to=e:x,color=red}
\setMPpositiongraphic{b:y}{tableshade}{from=b:y,to=e:y,color=green}
\setMPpositiongraphic{b:z}{tableshade}{from=b:z,to=e:z,color=blue}

\starttable[|c|c|c|]
\GFC[b:z] \cw{this is a small}  \NC       \cw{table}            \NC     in 
which we      \NC \FR
\NC       \cw{will demonstrate} \GFC[c:y] \cw{that this}        \GTC[c] 
\cw{positioning} \NC \MR
\GSC[a:x] \cw{mechanism also}   \GTC[b]   \cw{works quite well} \NC     in 
tables        \NC \LR
\stoptable

\stoptext

so, \startMPpositiongraphic is now named and handles vars

btw, i leave it to you to figure out the \XC alternative (which is a nicer 
way of coding)

there are a few more places where this kind of old code shows up (which is 
one reason why it's in the comments and not in manuals); last week i fixed 
something in a presentation style -) This kind of code is now reaching a 
more stable state because it's quite extensively used in some of the 
projects that we're involved in (i can show you some of the coding in 
bremen if you're interested; this kind of things is needed to make dtp 
competing/beating styles and it's a slow process to make the mechanisms 
programmable and the code readable)

btw, the textbackground features work ok in tables as well, so in a way 
this kind of things are no longer needed, unless you want to span cells in 
complicated ways

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] 4+ messages in thread

* Re: table and MPpositiongraphic
  2003-03-11 21:48 ` Hans Hagen
@ 2003-03-19  8:19   ` Patrick Gundlach
  2003-03-19  9:23     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Gundlach @ 2003-03-19  8:19 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> writes:

Hello Hans,

> right, this is because it's old crappy code; and so you got me in
> debugging mode again

Hopefully you can get out of this mode on your own ;-)

> so, \startMPpositiongraphic is now named and handles vars

That is so nice! It took me a while to figure out the syntax for
\GFC,\GTC,\GSC. \XC is more intuitive.

> btw, the textbackground features work ok in tables as well, so in a
> way this kind of things are no longer needed, unless you want to span
> cells in complicated ways

you mean with the \definepositionframed macro?


Thanks,

Patrick

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

* Re: Re: table and MPpositiongraphic
  2003-03-19  8:19   ` Patrick Gundlach
@ 2003-03-19  9:23     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2003-03-19  9:23 UTC (permalink / raw)


At 09:19 AM 3/19/2003 +0100, you wrote:

> > btw, the textbackground features work ok in tables as well, so in a
> > way this kind of things are no longer needed, unless you want to span
> > cells in complicated ways
>
>you mean with the \definepositionframed macro?

right.

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] 4+ messages in thread

end of thread, other threads:[~2003-03-19  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-11 16:30 table and MPpositiongraphic Patrick Gundlach
2003-03-11 21:48 ` Hans Hagen
2003-03-19  8:19   ` Patrick Gundlach
2003-03-19  9:23     ` 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).