ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* postponed processing
@ 2006-01-15 13:18 Henning Hraban Ramm
  2006-01-15 18:06 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Henning Hraban Ramm @ 2006-01-15 13:18 UTC (permalink / raw)


Me again...
I'd like to define an address layer in my environment:

--- start env --

\definelayer[senderlayer]
	[x=0mm, y=0mm, width=\paperwidth, height=\paperheight]

\def\Sender#1#2#3{\setvalue{SenderKey#1}{#2}\setvalue{SenderVal#1}{#3}}
\def\GetSenderLine#1{\bTR\bTD\doiftextelse{\getvalue{SenderKey#1}}%
	{\getvalue{SenderKey#1}:}{}\eTD\bTD\getvalue{SenderVal#1}\eTD\eTR}

\setlayerframed[senderlayer]
	[%corner={right}, location={left,bottom},
	x=\dimexpr(\getvalue{LogoHOffset}-\bleed), %\getvalue{LogoHOffset},
	y=\getvalue{LogoHeight}] % \dimexpr(\getvalue{LogoHeight}+\topspace)
	[height=46mm, width=\dimexpr(\getvalue{SenderKeyWidth}+\getvalue 
{SenderValueWidth}),
	frame=off, offset=none, align={left,top}]{%
	\setupTABLE[frame=off]
	\setupTABLE[x][1][width=\getvalue{SenderKeyWidth}, align=left, style= 
{\keystyle\strut}]
	\setupTABLE[x][2][width=\getvalue{SenderValueWidth}, align=right,  
style={\valstyle\strut}]
	\bTABLE
	\dostepwiserecurse{1}{9}{1}{% count from 1 to 9, step 1
		\expanded{\GetSenderLine{\recurselevel}}
	}
	\eTABLE
}

\def\EnableSender{\setupbackgrounds[rightpage][page]
	[background={\currentvalue, senderlayer}]}

--- stop env ---

and use that later in a product/component:

--- start text ---

\Sender{1}{Name}{Hraban}
\Sender{2}{Web}{www.fiee.net}

\EnableSender

--- stop text ---

Of course it doesn't work, because the Sender values aren't set via  
typesetting the address in the environment, and \x1c\currentvalue in  
\EnableSender hasn't the right value either.

Holger solves this in his letter style (wiki) via setups.
Is that the best approach?
How else could I postpone the senderlayer processing?
(I guess it would work with some expansion magic, but I'd like to  
stay at ConTeXt's surface as much as possible.)


Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/
http://contextgarden.net
http://www.cacert.org (I'm an assurer)

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

end of thread, other threads:[~2006-01-15 21:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-15 13:18 postponed processing Henning Hraban Ramm
2006-01-15 18:06 ` Hans Hagen
2006-01-15 19:19   ` Henning Hraban Ramm
2006-01-15 21: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).