[NTG-context] \framedparameter

Wolfgang Schuster schuster.wolfgang at googlemail.com
Mon Jan 4 14:04:17 CET 2010


Hi Hans,

in MkII the following is possible without problems:

\setupcolors[state=start]

\startuseMPgraphic{frameborder}
drawoptions(withcolor \MPcolor{\framedparameter{framecolor}}) ;
draw topboundary    OverlayBox withpen pencircle scaled \the\dimexpr\framedparameter{toprulethickness}\relax    ;
draw bottomboundary OverlayBox withpen pencircle scaled \the\dimexpr\framedparameter{bottomrulethickness}\relax ;
draw leftboundary   OverlayBox withpen pencircle scaled \the\dimexpr\framedparameter{leftrulethickness}\relax   ;
draw rightboundary  OverlayBox withpen pencircle scaled \the\dimexpr\framedparameter{rightrulethickness}\relax  ;
setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

\defineoverlay[frameborder][\useMPgraphic{frameborder}]

\defineframed
 [mpframed]
 [   toprulethickness=\framedparameter{rulethickness},
  bottomrulethickness=\framedparameter{rulethickness},
    leftrulethickness=\framedparameter{rulethickness},
   rightrulethickness=\framedparameter{rulethickness},
           background=frameborder]

\starttext
\mpframed[width=4cm,height=4cm,toprulethickness=1pt,framecolor=red]{text}
\stoptext

In MkIV this is no longer possible because \framedparameter accepts only protected keys (e.g. \c!rulethickness)
and on the fly key-value-pairs like 'toprulethickness=\framedparameter{rulethickness}' are also useless because
you need now \c!toprulethickness to use the value in another command like metapost graphics.

Can you provide a mechanism to access these values again on the user side, e.g. \userparameter{framed:toprulethickness}.

Best regards,
Wolfgang



More information about the ntg-context mailing list