Re: [NTG-context] \fieldstack

2011-06-25 Thread Hans Hagen

On 25-6-2011 1:59, Wolfgang Schuster wrote:

\setupinteraction[state=start]

\starttext

\definesymbol[one][\tt 1]
\definesymbol[two][\tt 2]

\definefieldstack[some][one,two]

\defineoverlay[some][\overlaybutton{Walk{some}}]

\framed[frame=off,background={foreground,some}]{\fieldstack[some]}

\stoptext


weird, I'll have a look at it (didn't change something with widgets 
recently)




-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] \fieldstack

2011-06-25 Thread Wolfgang Schuster
Hi,

fieldstack based animations result in a broken PDF document.

\setupinteraction[state=start]

\starttext

\definesymbol[one][\tt 1]
\definesymbol[two][\tt 2]

\definefieldstack[some][one,two]

\defineoverlay[some][\overlaybutton{Walk{some}}]

\framed[frame=off,background={foreground,some}]{\fieldstack[some]}

\stoptext

This is LuaTeX, Version beta-0.70.1-2011051908 (rev 4277)

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \fieldstack with mkiv

2010-02-14 Thread Hans Hagen

On 14-2-2010 20:12, Wolfgang Schuster wrote:

Am 14.02.10 19:16, schrieb Hans Hagen:

new attempt

the stepper did now work but why are the symbol names shown on the terminal

here is a example from another file with more symbols (the symbols have
the names 'go!symbol!...')

fonts : using map file: lm-math
{/Users/wolf/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}
fonts : using map file: lm-rm
{/Users/wolf/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}go!symbol!2

go!symbol!3

go!symbol!4

go!symbol!5

go!symbol!6

go!symbol!7

go!symbol!8

go!symbol!9

go!symbol!10


!pages : flushing realpage 1, userpage 1, subpage 1
systems : end file test-go-5 at line 15
system : cont-err loaded


because i added a print for tracing; i'll remove it

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \fieldstack with mkiv

2010-02-14 Thread Wolfgang Schuster

Am 14.02.10 19:16, schrieb Hans Hagen:

new attempt

the stepper did now work but why are the symbol names shown on the terminal

here is a example from another file with more symbols (the symbols have 
the names 'go!symbol!...')


fonts   : using map file: lm-math
{/Users/wolf/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}
fonts   : using map file: lm-rm
{/Users/wolf/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}go!symbol!2

go!symbol!3

go!symbol!4

go!symbol!5

go!symbol!6

go!symbol!7

go!symbol!8

go!symbol!9

go!symbol!10


!pages  : flushing realpage 1, userpage 1, subpage 1
systems : end file test-go-5 at line 15
system  : cont-err loaded

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \fieldstack with mkiv

2010-02-14 Thread Hans Hagen

On 14-2-2010 17:45, Wolfgang Schuster wrote:

Am 14.02.10 14:32, schrieb Hans Hagen:

On 13-2-2010 11:45, Peter Münster wrote:

\setupinteraction[state=start]
\definesymbol[step1][AAA]
\definesymbol[step2][BBB]
\definefieldstack[test][step1, step2]
\starttext
\fieldstack[test]

Just click \goto{here}[JS(Walk_Field{test})] to walk through the
fieldstack!
\goto{(restart)}[JS(Set_Field{test, 1})]
\stoptext

\def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings
{\ifcsname fieldstack:#1\endcsname \else
\setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}%
\fi}

\else missing

works but only the first symbol is shown, all others are invisible


new attempt

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \fieldstack with mkiv

2010-02-14 Thread Wolfgang Schuster

Am 14.02.10 14:32, schrieb Hans Hagen:

On 13-2-2010 11:45, Peter Münster wrote:

\setupinteraction[state=start]
\definesymbol[step1][AAA]
\definesymbol[step2][BBB]
\definefieldstack[test][step1, step2]
\starttext
\fieldstack[test]

Just click \goto{here}[JS(Walk_Field{test})] to walk through the 
fieldstack!

\goto{(restart)}[JS(Set_Field{test, 1})]
\stoptext

\def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings
  {\ifcsname fieldstack:#1\endcsname \else
 \setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}%
   \fi}

\else missing

works but only the first symbol is shown, all others are invisible

Wolfgang





test.pdf
Description: Adobe PDF document


test.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \fieldstack with mkiv

2010-02-14 Thread Hans Hagen

On 13-2-2010 11:45, Peter Münster wrote:

\setupinteraction[state=start]
\definesymbol[step1][AAA]
\definesymbol[step2][BBB]
\definefieldstack[test][step1, step2]
\starttext
\fieldstack[test]

Just click \goto{here}[JS(Walk_Field{test})] to walk through the fieldstack!
\goto{(restart)}[JS(Set_Field{test, 1})]
\stoptext



\def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings
  {\ifcsname fieldstack:#1\endcsname \else
 \setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}%
   \fi}

\else missing

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] \fieldstack with mkiv

2010-02-13 Thread Peter Münster
Hello,

What is needed to get \fieldstack working in mkiv?

The following example works with mkii, but not with mkiv:

\setupinteraction[state=start]
\definesymbol[step1][AAA]
\definesymbol[step2][BBB]
\definefieldstack[test][step1, step2]
\starttext
\fieldstack[test]

Just click \goto{here}[JS(Walk_Field{test})] to walk through the fieldstack!
\goto{(restart)}[JS(Set_Field{test, 1})]
\stoptext

TIA for any hints!
Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Weird Fieldstack problem

2007-06-11 Thread Zhichu Chen

Hi Aditya,

In my situation, I can't use buffer conveniently. So is there an easy way to
\includeMPgraphic recurrently? I've tried

\newcount\steps

 repeat the following block several times
\advance\steps\plusone
\startuseMPgraphics{step\the\steps}
. . . % Some random graphics
\stopuseMPgraphic
%

\startuseMPgraphic{aa}
\dorecurse{\the\steps}
 {\includeMPgraphic{step\recurselevel}}
\stopuseMPgraphic


but, it's not working.

On 6/9/07, Aditya Mahajan <[EMAIL PROTECTED]> wrote:


Quoting Zhichu Chen <[EMAIL PROTECTED]>:

> Hi Aditya,
>
> Actually, they should have the same boundingbox, the first MPdrawing
> environment draws a line from (0,0) to (2cm,2cm) and the sequence
MPdrawing
> environments just add two lines that are in the previous boundingbox.
>
> I know what's happening now. \definesymbol doesn't define a symbol
> from \getMPdrawing at once.

Yes, \definesymbol[a][b] is roughly equal to \def\a{b}, for example

\starttext

\def\something{aa}

\definesymbol[aa][\something]
\symbol[aa]

\def\something{bb}
\symbol[aa]

\stoptext

This is what is also happening in your case. You need to go back to the
definebuffer and processbuffer as suggested in metafun manual.

I do not know if it makes sense to have a \edef version of
definesymbol. In any case, getting expansion to work with \getMPdrawing
is going to be difficult.

Aditya


___
If your question is of interest to others as well, please add an entry to
the Wiki!

maillist : ntg-context@ntg.nl /
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net

___





--
Best Regards
Chen


 Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
  | www.sinap.ac.cn

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Weird Fieldstack problem

2007-06-08 Thread Aditya Mahajan
Quoting Zhichu Chen <[EMAIL PROTECTED]>:

> Hi Aditya,
>
> Actually, they should have the same boundingbox, the first MPdrawing
> environment draws a line from (0,0) to (2cm,2cm) and the sequence MPdrawing
> environments just add two lines that are in the previous boundingbox.
>
> I know what's happening now. \definesymbol doesn't define a symbol
> from \getMPdrawing at once.

Yes, \definesymbol[a][b] is roughly equal to \def\a{b}, for example

\starttext

\def\something{aa}

\definesymbol[aa][\something]
\symbol[aa]

\def\something{bb}
\symbol[aa]

\stoptext

This is what is also happening in your case. You need to go back to the 
definebuffer and processbuffer as suggested in metafun manual.

I do not know if it makes sense to have a \edef version of 
definesymbol. In any case, getting expansion to work with \getMPdrawing 
is going to be difficult.

Aditya

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Weird Fieldstack problem

2007-06-08 Thread Zhichu Chen

Hi Aditya,

Actually, they should have the same boundingbox, the first MPdrawing
environment draws a line from (0,0) to (2cm,2cm) and the sequence MPdrawing
environments just add two lines that are in the previous boundingbox.

I know what's happening now. \definesymbol doesn't define a symbol
from \getMPdrawing at once.


On 6/8/07, Aditya Mahajan <[EMAIL PROTECTED]> wrote:


On Fri, 8 Jun 2007, Zhichu Chen wrote:

> Hi,
>
> I've written the following test file:
>
> ==
> \setupcolors[state=start]
> \setuppagenumbering[state=stop]
> \setupinteraction  [state=start]
>
> \starttext
>
> \MPdrawingdonetrue
>
> \startMPdrawing
> draw (0,0)--(2cm,2cm);
> \stopMPdrawing
> \definesymbol[aa][\getMPdrawing]
>
> \startMPdrawing
> draw (2cm,2cm)--(2cm,0);
> \stopMPdrawing
>
> \definesymbol[bb][\getMPdrawing]
>
> \startMPdrawing
> draw (0,0)--(2cm,0);
> \stopMPdrawing
>
> \definesymbol[cc][\getMPdrawing]
>
> \definefieldstack[somemap][aa,bb,cc][height=fit,width=fit,frame=on]
>
>
> \fieldstack[somemap]
> \goto{here} [JS(Walk_Field{somemap})]
>
> \stoptext
> ==
>
> It seems that the fieldstack does not work. Is there anything wrong?

I haven't tested this, but I think that all elements in the fieldstack
should have the same bounding box. Look at the widget manual, where
Hans shows how to make sure that all elements have the same bounding
box.

Aditya

___
If your question is of interest to others as well, please add an entry to
the Wiki!

maillist : ntg-context@ntg.nl /
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net

___





--
Best Regards
Chen


 Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
  | www.sinap.ac.cn

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Weird Fieldstack problem

2007-06-08 Thread Aditya Mahajan
On Fri, 8 Jun 2007, Zhichu Chen wrote:

> Hi,
>
> I've written the following test file:
>
> ==
> \setupcolors[state=start]
> \setuppagenumbering[state=stop]
> \setupinteraction  [state=start]
>
> \starttext
>
> \MPdrawingdonetrue
>
> \startMPdrawing
> draw (0,0)--(2cm,2cm);
> \stopMPdrawing
> \definesymbol[aa][\getMPdrawing]
>
> \startMPdrawing
> draw (2cm,2cm)--(2cm,0);
> \stopMPdrawing
>
> \definesymbol[bb][\getMPdrawing]
>
> \startMPdrawing
> draw (0,0)--(2cm,0);
> \stopMPdrawing
>
> \definesymbol[cc][\getMPdrawing]
>
> \definefieldstack[somemap][aa,bb,cc][height=fit,width=fit,frame=on]
>
>
> \fieldstack[somemap]
> \goto{here} [JS(Walk_Field{somemap})]
>
> \stoptext
> ==
>
> It seems that the fieldstack does not work. Is there anything wrong?

I haven't tested this, but I think that all elements in the fieldstack 
should have the same bounding box. Look at the widget manual, where 
Hans shows how to make sure that all elements have the same bounding 
box.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Weird Fieldstack problem

2007-06-08 Thread Zhichu Chen

Hi,

I've written the following test file:

==
\setupcolors[state=start]
\setuppagenumbering[state=stop]
\setupinteraction  [state=start]

\starttext

\MPdrawingdonetrue

\startMPdrawing
draw (0,0)--(2cm,2cm);
\stopMPdrawing
\definesymbol[aa][\getMPdrawing]

\startMPdrawing
draw (2cm,2cm)--(2cm,0);
\stopMPdrawing

\definesymbol[bb][\getMPdrawing]

\startMPdrawing
draw (0,0)--(2cm,0);
\stopMPdrawing

\definesymbol[cc][\getMPdrawing]

\definefieldstack[somemap][aa,bb,cc][height=fit,width=fit,frame=on]


\fieldstack[somemap]
\goto{here} [JS(Walk_Field{somemap})]

\stoptext
==

It seems that the fieldstack does not work. Is there anything wrong?

--
Best Regards
Chen


 Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
  | www.sinap.ac.cn

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Any idea about copy or clone fieldstack?

2006-10-19 Thread Zhichu Chen
Thank you very much Peter
On 10/19/06, Peter Rolf <[EMAIL PROTECTED]> wrote:
Hi Chen,Have you tried the method described on page 402-403 of the "Acrobat_javascript_ Scripting Reference" (
AcroJS.pdf, 27.06.2005)? Search for"Use of arbitrary fonts".If I understand it right, all you need is the *right name* of the font(as JS sees/names it).[ Acrobat is required, but the trial version should work. Maybe also
"Adobe Type Manager Light" for the clean installation of a ps font underXP. ]To make sure that all clock relevant types are embeded, you can addsomething like\smashedhbox{\color[white]\ 0123456789:}
to your document.This is all untested, so don't expect too much...But let me know if it works ;)As I know, there is no command that clones a complete fieldstack.This is all a bit confusing without any example code.
HTH, Peter___ntg-context mailing listntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context
I've only read the "AcroJSGuide.pdf", and I thought it's all. Thank you to tell me that there is a more detailed reference. I'll try it now.
 
-- Sincerely yours,Chen  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | 
P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com   | www.sinap.ac.cn
 
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Any idea about copy or clone fieldstack?

2006-10-19 Thread Peter Rolf
Hi Chen,

Zhichu Chen wrote:
> Hello everyone,
>  
> I want to display dynamic system time on each page of my presentation.
> Displaying system time can be manipulated by JavaScript but, a field can
> be shown only once. So I used clone field and it works very well for me.
>  
> But when I want to change the font (xxx presents the variable that gets
> the field):
> 
> xxx.textFont = font.LucidaBright ;
> 
> it can be compiled successfully, but when I open it with acrobat reader,
> there are many errors from javascript console. So I think that JS don't
> know the font, and I don't know how to embed the font into pdf file and
> make JS knows it.
>
Have you tried the method described on page 402-403 of the "Acrobat
JavaScript Scripting Reference" (AcroJS.pdf, 27.06.2005)? Search for
"Use of arbitrary fonts".
If I understand it right, all you need is the *right name* of the font
(as JS sees/names it).
[ Acrobat is required, but the trial version should work. Maybe also
"Adobe Type Manager Light" for the clean installation of a ps font under
XP. ]

To make sure that all clock relevant types are embeded, you can add
something like

\smashedhbox{\color[white]\ 0123456789:}

to your document.

This is all untested, so don't expect too much...
But let me know if it works ;)

> Then I turned to use field stacks. I use MetaPost to draw some needles
> and use JS to set_Field the fieldstack to the correct frame. But when I
> want to display the second clock, it seems that I should write another
> JS code to control the other fieldstack.
>
> So is there some command that clones the fieldstack just like
> \copyfield? Or how to assign the font of the field as I like?
>
As I know, there is no command that clones a complete fieldstack.
This is all a bit confusing without any example code.

HTH, Peter

> Thank you.
> 
> 
> -- 
> Sincerely yours,
> Chen
> 
> 
>   Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
>  No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
>  tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
> <http://zhichu.chen.googlepages.com>
>| www.sinap.ac.cn
> <http://www.sinap.ac.cn>
> 
> 
> 
> 
> 
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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


[NTG-context] Any idea about copy or clone fieldstack?

2006-10-17 Thread Zhichu Chen
Hello everyone,
 
I want to display dynamic system time on each page of my presentation. Displaying system time can be manipulated by _javascript_ but, a field can be shown only once. So I used clone field and it works very well for me.

 
But when I want to change the font (xxx presents the variable that gets the field):

xxx.textFont = font.LucidaBright ;

it can be compiled successfully, but when I open it with acrobat reader, there are many errors from _javascript_ console. So I think that JS don't know the font, and I don't know how to embed the font into pdf file and make JS knows it.

 
Then I turned to use field stacks. I use MetaPost to draw some needles and use JS to set_Field the fieldstack to the correct frame. But when I want to display the second clock, it seems that I should write another JS code to control the other fieldstack.

 
So is there some command that clones the fieldstack just like \copyfield? Or how to assign the font of the field as I like?
 
Thank you.
-- Sincerely yours,Chen  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | 
P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com   | www.sinap.ac.cn
 
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Fieldstack Walk

2006-04-22 Thread Peter Rolf
Peter Rolf wrote:
> Michal Kvasnička wrote:
>> Good afternoon.
>>
>> Many thanks, this  solves the problem -- at least partially. The frames
>> are `walking' now, but new problems appeared. I found that when I set
>> `clickin=...', it is set it automatically to `clickout' as well, so one
>> mouse click runs the JavaScript code twice. So I've set it this way:
>>
>> \definefieldstack[fgolds2]
>>  [sgolds1,sgolds2a,sgolds2b,sgolds2c,sgolds2d,sgolds2]
>>  [frame=off,option=,clickout=JS(Walk_Field{fgolds3}),clickin=]
>>
>> It's better, but I found that now frames are walking in a strange order.
>> It is rather puzzling, since when it is invoked by \goto{...}[JS(...)],
>> it works well. Moreover, it does different things at AdobeReader 7.x
>> under Linux, and Acrobat 4.x under Windoze.
>>
>> Can you help me to solve it?
> 
> Took some time, but it works now. What I don't understand, is the
> strange behaviour of the offset parameter in this case. See attached file.
> 
> Greets, Peter
> 
>> Many thanks once more.
>> M.K.
>>
>>
> 
> 
> 
> 
> % interface=en output=pdftex
> % Time-stamp: 
> %
> \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
>clickin=JS(Walk_Field{sequence})]
 

oeps, this one is obsolete

> 
> 
> \defineproperty[interaction][layer][title=walkfield, state=start]
> 
> 
> \vbox{\forgetall
> \nointerlineskip\smashedvbox{\fieldstack[sequence]}%
> %
> \startproperty[interaction]%
> \nointerlineskip\field[Walk]
> \stopproperty%
> }
> 
> \blank[2cm]
> \showfields
> 
> \stoptext
> 
> 
> %%% Local Variables:
> %%% mode: context
> %%% TeX-master: ""
> %%% End:
> 
> 
> 
> 
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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


Re: [NTG-context] Fieldstack Walk

2006-04-22 Thread Peter Rolf
Michal Kvasnička wrote:
> Good afternoon.
> 
> Many thanks, this  solves the problem -- at least partially. The frames
> are `walking' now, but new problems appeared. I found that when I set
> `clickin=...', it is set it automatically to `clickout' as well, so one
> mouse click runs the JavaScript code twice. So I've set it this way:
> 
> \definefieldstack[fgolds2]
>  [sgolds1,sgolds2a,sgolds2b,sgolds2c,sgolds2d,sgolds2]
>  [frame=off,option=,clickout=JS(Walk_Field{fgolds3}),clickin=]
> 
> It's better, but I found that now frames are walking in a strange order.
> It is rather puzzling, since when it is invoked by \goto{...}[JS(...)],
> it works well. Moreover, it does different things at AdobeReader 7.x
> under Linux, and Acrobat 4.x under Windoze.
> 
> Can you help me to solve it?

Took some time, but it works now. What I don't understand, is the
strange behaviour of the offset parameter in this case. See attached file.

Greets, Peter

> Many thanks once more.
> M.K.
> 
> 

% interface=en output=pdftex
% Time-stamp: 
%
\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
   clickin=JS(Walk_Field{sequence})]


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


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

\blank[2cm]
\showfields

\stoptext


%%% Local Variables:
%%% mode: context
%%% TeX-master: ""
%%% End:
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Fieldstack Walk

2006-04-19 Thread Sanjoy Mahajan
From:Peter Rolf <[EMAIL PROTECTED]>
> Both problems are still *unfixed* (beta from 17.04).

The one I pointed out doesn't have an obvious solution since (I think)
the reserveobjnum spacing change breaks with pdftex 1.30 but is needed
with pdftex 1.21.  I guess the magic line could be wrapped in a test
for pdftexminorversion or something like that (and that wrapped in a
test for using pdftex at all).

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
 --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Fieldstack Walk

2006-04-19 Thread Peter Rolf
Thanks Sanjoy for pointing this out. Both problems are still *unfixed*
(beta from 17.04). Unfortunately fixing them doesn't solve my problem.
I'll try it again later. Maybe I was to tired yesterday to solve this
and the error is on my side...

Greets, Peter

Sanjoy Mahajan wrote:
>> there are still some problems with spurious spaces.
> 
> Just on the off chance that it's the same problem I had with some section
> numbers getting an extra space before them (in pdf mode):
> 
> If you are running pdf(e)tex 1.21, you might need the patch below;
> then remake the formats.  I think (but haven't tried it myself) that
> pdftex 1.30 wants the original spacings (i.e. don't apply the patch in
> that case).  See
> 
> 
> diff -r f6897ee163d2 -r 5ff7b6430984 tex/context/base/enco-pfr.tex
> --- a/tex/context/base/enco-pfr.tex   Fri Apr 14 14:45:01 2006 -0400
> +++ b/tex/context/base/enco-pfr.tex   Fri Apr 14 14:51:47 2006 -0400
> @@ -188,7 +188,7 @@
>\else\ifcsname\pdffontfileresource\endcsname
>  % is there a resource already included
>  \doifsomething\pdffontfileresource
> -  {\pdfobj reserveobjnum {}%
> +  {\pdfobj reserveobjnum{}%
> \setxvalue\pdffontresource{\the\pdflastobj}%
> \flushatshipout{\dododoincludepdffontresource{\currentencoding}}}%
>  %\doglobal\appendetoks
> @@ -216,7 +216,7 @@
>   {\expandafter\ifx\csname\pdffontresource\endcsname\relax
>  \expandafter\ifx\csname\pdffontfileresource\endcsname\relax\else
>\doifsomething\pdffontfileresource
> -{\pdfobj reserveobjnum {}%
> +{\pdfobj reserveobjnum{}%
>   \setxvalue\pdffontresource{\the\pdflastobj}%
>   
> \flushatshipout{\dododoincludepdffontresource{\currentencoding}}}%
>  %  \doglobal\appendetoks
> 
> 
> 
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

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


Re: [NTG-context] Fieldstack Walk

2006-04-18 Thread Sanjoy Mahajan
> there are still some problems with spurious spaces.

Just on the off chance that it's the same problem I had with some section
numbers getting an extra space before them (in pdf mode):

If you are running pdf(e)tex 1.21, you might need the patch below;
then remake the formats.  I think (but haven't tried it myself) that
pdftex 1.30 wants the original spacings (i.e. don't apply the patch in
that case).  See


diff -r f6897ee163d2 -r 5ff7b6430984 tex/context/base/enco-pfr.tex
--- a/tex/context/base/enco-pfr.tex Fri Apr 14 14:45:01 2006 -0400
+++ b/tex/context/base/enco-pfr.tex Fri Apr 14 14:51:47 2006 -0400
@@ -188,7 +188,7 @@
   \else\ifcsname\pdffontfileresource\endcsname
 % is there a resource already included
 \doifsomething\pdffontfileresource
-  {\pdfobj reserveobjnum {}%
+  {\pdfobj reserveobjnum{}%
\setxvalue\pdffontresource{\the\pdflastobj}%
\flushatshipout{\dododoincludepdffontresource{\currentencoding}}}%
 %\doglobal\appendetoks
@@ -216,7 +216,7 @@
  {\expandafter\ifx\csname\pdffontresource\endcsname\relax
 \expandafter\ifx\csname\pdffontfileresource\endcsname\relax\else
   \doifsomething\pdffontfileresource
-{\pdfobj reserveobjnum {}%
+{\pdfobj reserveobjnum{}%
  \setxvalue\pdffontresource{\the\pdflastobj}%
  \flushatshipout{\dododoincludepdffontresource{\currentencoding}}}%
 %  \doglobal\appendetoks



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


Re: [NTG-context] Fieldstack Walk

2006-04-18 Thread Peter Rolf
Peter Rolf wrote:
> Michal Kvasnička wrote:
>> Good afternoon.
>>
>> Many thanks, this  solves the problem -- at least partially. The frames
>> are `walking' now, but new problems appeared. I found that when I set
>> `clickin=...', it is set it automatically to `clickout' as well, so one
>> mouse click runs the JavaScript code twice. So I've set it this way:
>>
>> \definefieldstack[fgolds2]
>>  [sgolds1,sgolds2a,sgolds2b,sgolds2c,sgolds2d,sgolds2]
>>  [frame=off,option=,clickout=JS(Walk_Field{fgolds3}),clickin=]
>>
>> It's better, but I found that now frames are walking in a strange order.
>> It is rather puzzling, since when it is invoked by \goto{...}[JS(...)],
>> it works well. Moreover, it does different things at AdobeReader 7.x
>> under Linux, and Acrobat 4.x under Windoze.
>>
>> Can you help me to solve it?
> 
> Mhh, looks like you are going new ways with making the fieldstack
> interactive (maybe not intended?). Sorry, but I can't help you any
> further in this direction.
> 
> Another possibility that I can think of is to add an invisible button
> field (same dimensions) behind a normal fieldstack, that calls
> JS(Walk_Field...). Should cause no conflicts with the readonly (non
> interactive) fieldstack [but this is untested!]. You can simply check
> this with a button beside the fieldstack and if this works ok, you can use
> 
> \nointerlineskip
> \smashedvbox{YOUR WALKBUTTON FIELD}%
> \placefigure[here]{none}{\fieldstack[fgolds3]}
> 
> to place it under your fieldstack.
> 
Bad news...
I just tested this and it works only as long as you don't stack the
button and the fieldstack.

The only solution I have found, is to seperate the interaction button
into a pdf layer. Things work as desired (you need a context version not
older than 2 month), but there are still some problems with spurious spaces.

Example is attached.

Greets, Peter


> HTH, Peter
> 
> 
>> Many thanks once more.
>> M.K.
>>
>>
> 
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

% interface=en output=pdftex
% Time-stamp: 
%
\setupinteraction[state=start]
\setupcolors[state=start]

\starttext

\switchtobodyfont[ss,32pt]

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

\definesymbol[empty][]

\definesymbol[sgolds1][\FS{A}]
\definesymbol[sgolds3a][\FS{B}]
\definesymbol[sgolds3b][\FS{C}]
\definesymbol[sgolds3c][\FS{D}]
\definesymbol[sgolds3][\FS{E}]


\setupfield[hidden][width=4cm,height=4cm,
%  frame=off,
  framecolor=blue,
  clickin=JS(Walk_Field{fgolds3})]

\definefield[Walk][check][hidden][empty][empty]


\definefieldstack[fgolds3]
 [sgolds1,sgolds3a,sgolds3b,sgolds3c,sgolds3]
 [frame=off,clickin=JS(Walk_Field{fgolds3})]


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

%\showmakeup

% can't get rid of the spurious apaces...
\vbox{\forgetall
\nointerlineskip
\smashedvbox{\fieldstack[fgolds3]}%
%
\startproperty[interaction]%
\nointerlineskip
\field[Walk]
\stopproperty%
}

\stoptext


%%% Local Variables:
%%% mode: context
%%% TeX-master: ""
%%% End:
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Fieldstack Walk

2006-04-18 Thread Peter Rolf
Michal Kvasnička wrote:
> Good afternoon.
> 
> Many thanks, this  solves the problem -- at least partially. The frames
> are `walking' now, but new problems appeared. I found that when I set
> `clickin=...', it is set it automatically to `clickout' as well, so one
> mouse click runs the JavaScript code twice. So I've set it this way:
> 
> \definefieldstack[fgolds2]
>  [sgolds1,sgolds2a,sgolds2b,sgolds2c,sgolds2d,sgolds2]
>  [frame=off,option=,clickout=JS(Walk_Field{fgolds3}),clickin=]
> 
> It's better, but I found that now frames are walking in a strange order.
> It is rather puzzling, since when it is invoked by \goto{...}[JS(...)],
> it works well. Moreover, it does different things at AdobeReader 7.x
> under Linux, and Acrobat 4.x under Windoze.
> 
> Can you help me to solve it?

Mhh, looks like you are going new ways with making the fieldstack
interactive (maybe not intended?). Sorry, but I can't help you any
further in this direction.

Another possibility that I can think of is to add an invisible button
field (same dimensions) behind a normal fieldstack, that calls
JS(Walk_Field...). Should cause no conflicts with the readonly (non
interactive) fieldstack [but this is untested!]. You can simply check
this with a button beside the fieldstack and if this works ok, you can use

\nointerlineskip
\smashedvbox{YOUR WALKBUTTON FIELD}%
\placefigure[here]{none}{\fieldstack[fgolds3]}

to place it under your fieldstack.

HTH, Peter


> Many thanks once more.
> M.K.
> 
> 

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


Re: [NTG-context] Fieldstack Walk

2006-04-18 Thread Michal Kvasnička
Good afternoon.

Many thanks, this  solves the problem -- at least partially. The frames 
are `walking' now, but new problems appeared. I found that when I set 
`clickin=...', it is set it automatically to `clickout' as well, so one 
mouse click runs the JavaScript code twice. So I've set it this way:

\definefieldstack[fgolds2]
  [sgolds1,sgolds2a,sgolds2b,sgolds2c,sgolds2d,sgolds2]
  [frame=off,option=,clickout=JS(Walk_Field{fgolds3}),clickin=]

It's better, but I found that now frames are walking in a strange order. 
It is rather puzzling, since when it is invoked by \goto{...}[JS(...)], 
it works well. Moreover, it does different things at AdobeReader 7.x 
under Linux, and Acrobat 4.x under Windoze.

Can you help me to solve it?
Many thanks once more.
M.K.

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


Re: [NTG-context] Fieldstack Walk

2006-04-18 Thread Peter Rolf
Hi Michal,

Michal Kvasnička wrote:
> Hi Peter,
> 
> thank for your answer, but it doesn't help. First, it seems the order is
> not important in ConTeXt. Second, the fieldstack works well. I can even
> make it walk with \goto{...}[JS(Walk_Field{fgolds3})]. The only thing
> that doesn't work is that I can't click on the figure to make it walk.
> 
I see  :)

Can you try the following:

\definefieldstack[fgolds3]
 [sgolds1,sgolds3a,sgolds3b,sgolds3c,sgolds3]
 [frame=off,option=,clickin=JS(Walk_Field{fgolds3})]

^^

option is "readonly" as default (see \dodofieldstack in core-fld.tex),
so there can be no interaction (if I'm not again completely wrong).

Greets, Peter

P.S.: don't know why this mail was replied to your mail address and not
to ntg-context...

> Thanks anyway.
> M.K.
> 
>>> I use a fieldstack in my presentation. I'd like to go to the next
>>> frame when I click on the figure. I tried this:
>>>
>>> \definefieldstack[fgolds3]
>>>  [sgolds1,sgolds3a,sgolds3b,sgolds3c,sgolds3]
>>>  [frame=off,clickin=JS(Walk_Field{fgolds3})]
>>> \definesymbol[sgolds1][{\externalfigure[golds1]}]
>>> \definesymbol[sgolds3a][{\externalfigure[golds3a]}]
>>> \definesymbol[sgolds3b][{\externalfigure[golds3b]}]
>>> \definesymbol[sgolds3c][{\externalfigure[golds3c]}]
>>> \definesymbol[sgolds3][{\externalfigure[golds3]}]
>>> \placefigure[here]{none}{\fieldstack[fgolds3]}
>>>
>>>   
>> just guessing:
>>
>> first define the symbols, then define the fieldstack.
>>
>> Hope that helps,
>>
>> Peter
>>
>>
>>  
>>
>>> I thought that `clickin=JS(Walk_Field{fgolds3})' makes precisely what
>>> I need, but it does not. How can I make it work?
>>>
>>> With many thanks yours
>>> Michal Kvasnicka
>>>
>>> ___
>>> ntg-context mailing list
>>> ntg-context@ntg.nl
>>> http://www.ntg.nl/mailman/listinfo/ntg-context
>>>
>>>
>>>   
> 
> 

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


Re: [NTG-context] Fieldstack Walk

2006-04-18 Thread Peter Rolf
Michal Kvasnička wrote:
> Good morning.
> 
> I use a fieldstack in my presentation. I'd like to go to the next frame 
> when I click on the figure. I tried this:
> 
> \definefieldstack[fgolds3]
>   [sgolds1,sgolds3a,sgolds3b,sgolds3c,sgolds3]
>   [frame=off,clickin=JS(Walk_Field{fgolds3})]
> \definesymbol[sgolds1][{\externalfigure[golds1]}]
> \definesymbol[sgolds3a][{\externalfigure[golds3a]}]
> \definesymbol[sgolds3b][{\externalfigure[golds3b]}]
> \definesymbol[sgolds3c][{\externalfigure[golds3c]}]
> \definesymbol[sgolds3][{\externalfigure[golds3]}]
> \placefigure[here]{none}{\fieldstack[fgolds3]}
>
just guessing:

first define the symbols, then define the fieldstack.

Hope that helps,

Peter


> I thought that `clickin=JS(Walk_Field{fgolds3})' makes precisely what I 
> need, but it does not. How can I make it work?
> 
> With many thanks yours
> Michal Kvasnicka
> 
> ___
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

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


[NTG-context] Fieldstack Walk

2006-04-18 Thread Michal Kvasnička
Good morning.

I use a fieldstack in my presentation. I'd like to go to the next frame 
when I click on the figure. I tried this:

\definefieldstack[fgolds3]
  [sgolds1,sgolds3a,sgolds3b,sgolds3c,sgolds3]
  [frame=off,clickin=JS(Walk_Field{fgolds3})]
\definesymbol[sgolds1][{\externalfigure[golds1]}]
\definesymbol[sgolds3a][{\externalfigure[golds3a]}]
\definesymbol[sgolds3b][{\externalfigure[golds3b]}]
\definesymbol[sgolds3c][{\externalfigure[golds3c]}]
\definesymbol[sgolds3][{\externalfigure[golds3]}]
\placefigure[here]{none}{\fieldstack[fgolds3]}

I thought that `clickin=JS(Walk_Field{fgolds3})' makes precisely what I 
need, but it does not. How can I make it work?

With many thanks yours
Michal Kvasnicka

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