ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* goto & framed
@ 2006-10-17 14:23 Renaud AUBIN
  2006-10-17 18:39 ` Peter Rolf
  0 siblings, 1 reply; 2+ messages in thread
From: Renaud AUBIN @ 2006-10-17 14:23 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 973 bytes --]


Hi folks !

Consider the working example:

\usemodule[pre-original]

\starttext
\startbuffer[stack1]
draw (0,0)--(10cm,10cm);
\stopbuffer

\startbuffer[stack2]
draw (0,10cm)--(10cm,0);
\stopbuffer

\startbuffer[stack3]
draw (0,5cm)--(10cm,5cm);
\stopbuffer


\definesymbol[step 1][{\processMPbuffer[stack1]}]
\definesymbol[step 2][{\processMPbuffer[stack1,stack2]}]
\definesymbol[step 3][{\processMPbuffer[stack1,stack2,stack3]}]

\definefieldstack
   [stack]
   [step 1,step 2,step 3]
   [frame=off]

\defineoverlay[cowbg][{\externalfigure[cow][width=10cm]}]

\framed[background=cowbg,frame=off,offset=none,backgroundoffset=0pt]{{\fieldstack[stack]}}

\goto{next}[JS(Walk_Field{stack})]

\stoptext

I naively (as always ? ;) ) tried to make the "framed" interactive with
\goto{\framed[background=cowbg,frame=off,offset=none,backgroundoffset=0pt]{{\fieldstack[stack]}}}[JS(Walk_Field{stack})]
but failed in my attempt...

Is there a way to solve this problem ?


Renaud



[-- Attachment #1.2: Type: text/html, Size: 1487 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: goto & framed
  2006-10-17 14:23 goto & framed Renaud AUBIN
@ 2006-10-17 18:39 ` Peter Rolf
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Rolf @ 2006-10-17 18:39 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]

Renaud AUBIN wrote:
> 
> Hi folks !
> 
> Consider the working example:
> 
> \usemodule[pre-original]
> 
> \starttext
> \startbuffer[stack1]
> draw (0,0)--(10cm,10cm);
> \stopbuffer
> 
> \startbuffer[stack2]
> draw (0,10cm)--(10cm,0);
> \stopbuffer
> 
> \startbuffer[stack3]
> draw (0,5cm)--(10cm,5cm);
> \stopbuffer
> 
> 
> \definesymbol[step 1][{\processMPbuffer[stack1]}]
> \definesymbol[step 2][{\processMPbuffer[stack1,stack2]}]
> \definesymbol[step 3][{\processMPbuffer[stack1,stack2,stack3]}]
> 
> \definefieldstack
>    [stack]
>    [step 1,step 2,step 3]
>    [frame=off]
> 
> \defineoverlay[cowbg][{\externalfigure[cow][width=10cm]}]
> 
> \framed[background=cowbg,frame=off,offset=none,backgroundoffset=0pt]{{\fieldstack[stack]}}
> 
> \goto{next}[JS(Walk_Field{stack})]
> 
> \stoptext
> 
> I naively (as always ? ;) ) tried to make the "framed" interactive with
> \goto{\framed[background=cowbg,frame=off,offset=none,backgroundoffset=0pt]{{\fieldstack[stack]}}}[JS(Walk_Field{stack})]
> but failed in my attempt...
>
> Is there a way to solve this problem ?
>
Hi Renaud. How could you have missed this one? ;)

http://archive.contextgarden.net/thread/20060422.200921.44436476.en.html#20060422.200921.44436476

The trick is to use a PDF layer for the trigger button (else you get a
mess of stacking, interactive areas).

Greetings, Peter

> 
> Renaud
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context


[-- Attachment #2: walkfield.tex --]
[-- Type: text/plain, Size: 1062 bytes --]

\setupoutput[pdftex]
\setupinteraction[state=start]
\setupcolors[state=start]

\starttext

\tracefieldstrue

\switchtobodyfont[96pt]

\def\FS#1{\framed[width=4cm,height=4cm,strut=no]{\red\bf#1}}%

\definesymbol [empty]   []

\definesymbol [one]     [\FS{1}]
\definesymbol [two]     [\FS{2}]
\definesymbol [three]   [\FS{3}]
\definesymbol [four]    [\FS{4}]
\definesymbol [five]    [\FS{5}]


\setupfield[interaction]
  [width=4cm,height=4cm,
%   frame=off,
   framecolor=blue,
   offset=none,% default offset causes different positioning of walk button and fieldstack
   clickin=JS(Walk_Field{sequence})]

\definefield[Walk][check][interaction][empty][empty]


\definefieldstack[sequence]
  [one,two,three,four,five]
  [frame=off,
   offset=none,% default offset causes different positioning of walk button and fieldstack
  ]


\defineproperty[interaction][layer][title=interaction, state=start]


\vbox{\normaloffinterlineskip
\smashedvbox{\fieldstack[sequence]}%
%
\startproperty[interaction]%
\field[Walk]
\stopproperty%
}

\blank[2cm]
\showfields

\stoptext

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2006-10-17 18:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-17 14:23 goto & framed Renaud AUBIN
2006-10-17 18:39 ` Peter Rolf

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).