ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to control the placement of a button
@ 2018-01-26  5:51 Otared Kavian
  2018-01-26 13:12 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Otared Kavian @ 2018-01-26  5:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

Some years ago Wolfgang Schuster answered a question about interactive buttons placed on a page in order to navigate in a PDF document. 

Somehow, unfortunately, I did not keep his complete answer, but kept just an example code he sent, which I copy below.
So my question is: how can one control the placement of a button created by the commands
	\startbut[GoToDestination] NameOfTheButton \stopbut
For instance if one wishes to put a button on the bottom, or even somewhere on a page? Is it possible to give coordinates, like when one places a layer?

In the example below if the layout is modified then the buttons may disappear, since they might be out of the boundaries of the predefined locations of the buttons (which are unknown to me…).

Thanks in advance: OK

%%% begin button-example.tex
\setuppapersize[S6,S6]

\setuplayout
	[width=13cm,
	rightedge=1.5cm]

\setupinteraction
  [state=start,
   menu=on]

\setupinteractionmenu[right]
	[state=start,
	align=middle,
	background=screen,
	frame=on,
	width=broad,
	style=bold,
	color=]

\startinteractionmenu[right]
	\startbut[content]    $\leftarrow$ \stopbut % this button is too high on the page
	\vfill
	\startbut[index]  $\rightarrow$   \stopbut % this button should be a little bit lower
\stopinteractionmenu

\starttext

\completecontent \showframe

\dorecurse{4}
  {\chapter{Chapter #1}\index{chapter #1}
   \input knuth \index{Knuth}\page}

\completeindex

\stoptext
%%% end button-example.tex
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: How to control the placement of a button
  2018-01-26  5:51 How to control the placement of a button Otared Kavian
@ 2018-01-26 13:12 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2018-01-26 13:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Otared Kavian

On 1/26/2018 6:51 AM, Otared Kavian wrote:
> Hi all,
> 
> Some years ago Wolfgang Schuster answered a question about interactive buttons placed on a page in order to navigate in a PDF document.
> 
> Somehow, unfortunately, I did not keep his complete answer, but kept just an example code he sent, which I copy below.
> So my question is: how can one control the placement of a button created by the commands
> 	\startbut[GoToDestination] NameOfTheButton \stopbut
> For instance if one wishes to put a button on the bottom, or even somewhere on a page? Is it possible to give coordinates, like when one places a layer?
> 
> In the example below if the layout is modified then the buttons may disappear, since they might be out of the boundaries of the predefined locations of the buttons (which are unknown to me…).
> 
> Thanks in advance: OK
> 
> %%% begin button-example.tex
> \setuppapersize[S6,S6]
> 
> \setuplayout
> 	[width=13cm,
> 	rightedge=1.5cm]
> 
> \setupinteraction
>    [state=start,
>     menu=on]
> 
> \setupinteractionmenu[right]
> 	[state=start,
> 	align=middle,
> 	background=screen,
> 	frame=on,
> 	width=broad,
> 	style=bold,
> 	color=]
> 
> \startinteractionmenu[right]
> 	\startbut[content]    $\leftarrow$ \stopbut % this button is too high on the page
> 	\vfill
> 	\startbut[index]  $\rightarrow$   \stopbut % this button should be a little bit lower
> \stopinteractionmenu
> 
> \starttext
> 
> \completecontent \showframe
> 
> \dorecurse{4}
>    {\chapter{Chapter #1}\index{chapter #1}
>     \input knuth \index{Knuth}\page}
> 
> \completeindex
> 
> \stoptext
> %%% end button-example.tex

maybe \button does the job (you can put it in a layer) and 
\interactionmenu[right] will place a whole menu


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2018-01-26 13:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-26  5:51 How to control the placement of a button Otared Kavian
2018-01-26 13:12 ` 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).