* Toggle fields
@ 2003-05-12 10:27 Sytse Knypstra
2003-05-12 11:41 ` Hans Hagen
0 siblings, 1 reply; 3+ messages in thread
From: Sytse Knypstra @ 2003-05-12 10:27 UTC (permalink / raw)
Dear ConTeXt users,
In experimenting with (JavaScript) fields I tried the example on p. 11
in the up-to-date 1998/1 publication.
I placed the check field not in the margin, but in the running text and
discovered
that \goto{Help}[JS(Toggle_Hide{Help})] does work if it is placed after
\fitfield[Help],
but that it does not work if it is placed before \fitfield[Help].
For the commands \goto{Hide Help}[HideField{Help}] and \goto{Show
Help}[ShowField{Help}]
their position relative to \fitfield[Help] does not matter.
Would it be possible to make a command ToggleField, analagous to HideField
and ShowField,
whose position relative to \fitfield[Help} is not important?
Thank you,
Sytse
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Here is the complete example:
\setupoutput[pdftex]
\setupinteraction[state=start]
\starttext
\definefield[Help][check][Helpsetup][helpinfo][helpinfo]
\setupfields[reset]
\setupfield[Helpsetup][width=fit,height=fit,frame=off,option={readonly,hidden}]
\definesymbol[helpinfo][\SomeHelpText]
\def\SomeHelpText%
{\framed
[width=\leftmarginwidth,height=fit,align=middle,style=small,
frame=on,background=color,backgroundcolor=white,framecolor=red]
{Click on the hide button to remove this screen}}
%\fitfield[Help] % if uncommented, all three \goto's work ok
Now we can put the button somewhere and turn the help on or off by saying
\goto{Hide Help}[HideField{Help}] or \goto{Show Help}[ShowField{Help}].
Although it's better to put these commands in a dedicated part of the screen.
And try \goto{Help}[JS(Toggle_Hide{Help})].
\fitfield[Help] % \goto{Help}[JS(Toggle_Hide{Help})] does not work
\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Toggle fields
2003-05-12 10:27 Toggle fields Sytse Knypstra
@ 2003-05-12 11:41 ` Hans Hagen
2003-05-13 8:07 ` Sytse Knypstra
0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2003-05-12 11:41 UTC (permalink / raw)
At 12:27 12/05/2003 +0200, Sytse Knypstra wrote:
>Dear ConTeXt users,
>
>In experimenting with (JavaScript) fields I tried the example on p. 11
>in the up-to-date 1998/1 publication.
>
>I placed the check field not in the margin, but in the running text and
>discovered
>that \goto{Help}[JS(Toggle_Hide{Help})] does work if it is placed after
>\fitfield[Help],
>but that it does not work if it is placed before \fitfield[Help].
can you test if
\useJSscripts[fld]
helps? for some functionality you need to preload some javascript definitions
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] 3+ messages in thread
* Re: Toggle fields
2003-05-12 11:41 ` Hans Hagen
@ 2003-05-13 8:07 ` Sytse Knypstra
0 siblings, 0 replies; 3+ messages in thread
From: Sytse Knypstra @ 2003-05-13 8:07 UTC (permalink / raw)
Thank you, Hans. It works fine now.
Do you have a similar solution for my problem that \fillinfield{Sytse} does
not work?
Sytse
At 5/12/2003 01:41, you wrote:
>At 12:27 12/05/2003 +0200, Sytse Knypstra wrote:
> >Dear ConTeXt users,
> >
> >In experimenting with (JavaScript) fields I tried the example on p. 11
> >in the up-to-date 1998/1 publication.
> >
> >I placed the check field not in the margin, but in the running text and
> >discovered
> >that \goto{Help}[JS(Toggle_Hide{Help})] does work if it is placed after
> >\fitfield[Help],
> >but that it does not work if it is placed before \fitfield[Help].
>
>can you test if
>
> \useJSscripts[fld]
>
>helps? for some functionality you need to preload some javascript definitions
>
>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
>-------------------------------------------------------------------------
>
>_______________________________________________
>ntg-context mailing list
>ntg-context@ntg.nl
>http://www.ntg.nl/mailman/listinfo/ntg-context
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-13 8:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-12 10:27 Toggle fields Sytse Knypstra
2003-05-12 11:41 ` Hans Hagen
2003-05-13 8:07 ` Sytse Knypstra
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).