interaction-enabling.tex /size: 4612 b    last modification: 2023-12-21 09:43
1% language=us
2
3\environment interaction-style
4
5\startcomponent interaction-enabling
6
7\startchapter[title=Enabling]
8
9Interaction is turned off by default. Of course cross referencing
10work without interaction but there are no hyperlinks. You turn on
11interaction with the \type {\setupinteraction} command:
12
13\showsetup {setupinteraction}
14
15The \type {state} key is the switch you need to use. In addition you might want
16to setup the style and color.
17
18\starttyping
19\setupinteraction
20  [state=start,
21   style=,
22   color=,
23   contrastcolor=]
24\stoptyping
25
26This is the least intrusive way to get interaction in your document. By default
27the style is bold and the \type {color} defaults to green. The \type
28{contrastcolor} is used when a hyperlink refers to the same page and defaults to
29red. A neutral setup makes sense because nowadays the reader kind of knows what
30can be clicked on.
31
32The \type {title}, \type {subtitle}, \type {author}, \type {date} and \type
33{keyword} parameters are passed to the document and will show up when you request
34document information.
35
36The \type {openaction} parameter can for instance be used to start at a specific
37page, while the \type {closeaction} can be used to trigger a \JAVASCRIPT\ cleanup
38script. The \type {openpageaction} and \type {closepageaction} can for instance
39initialize and reset states, something we do in some presentation styles.
40
41The \type {click} parameter controls how a viewer responds to pressing a mouse
42button on an annotation: highlight or not. The \type {display} parameter
43determines if a cross document link opens in the current window.
44
45The \type {menu} parameter is a quick way to disable menus, of which there can be
46many: at each side of the page, stacked or not, etc. The \type {symbolset}
47determines the look and feel of symbols used in for instance menus, buttons and
48status bars.
49
50The \type {page} parameters is a bit special, and it function is an inheritance
51from the early days. Some \DVI\ and \PDF\ viewers supported named destinations,
52others only page references. This parameter can be used to force one or the
53other. There was a time that there was a limit on the number of named references,
54so going page was the only option \footnote {We're talking of 1995 when we made
55documents of many thousands of pages with tens of thousands of hyperlinks, cross
56linked tables of contents, registers, active graphics, etc.\ Think of
57dictionaries used in very specific projects, or quality assurance manuals.}
58
59Personally I consider an electronic document an entity to be seen full screen on
60a dedicated device. However some users prefer the target of a link to fit the
61width of the screen and alike. The \type {focus} parameter can (within)
62reasonable bounds provide this. The \type {focusoffset} is then used to keep
63things a bit visual convenient.
64
65The \type {height} and \type{depth} parameters are sort of special and probably never
66used. When we go back in time, to when we started adding interactivity, there were
67a few issues that needed to be dealt with:
68
69\startitemize[packed]
70\startitem
71    We need to make sure that we have something to click on, so we need to add
72    some offset if needed.
73\stopitem
74\startitem
75    We need to handle nested hyperlinks, which is why \CONTEXT\ didn't use the
76    link features of for instance \PDFTEX\ but built its own.
77\stopitem
78\startitem
79    Hyperlinks should break properly across lines without side effects, again a
80    reason for bypassing some of the \TEX\ engine's behaviour.
81\stopitem
82\startitem
83    We have to make sure that there is at least a consistent height and depth
84    of hyperlinks. These tight links with viewer supplied bounding boxes to
85    click on just look real bad! So, we had to do better.
86\stopitem
87\stopitemize
88
89Normally the two mentioned parameters are not used. However, their value will
90kick in when we say \type {\setfalse \locationstrut}, in which case the given
91height and depth will be used. Some advice: don't mess with this. We only have
92this because it permits special effects.
93
94If you want to see what the target (destinations) and sources (references) of
95links are, you can say:
96
97\starttyping
98\enabletrackers[nodes.references,nodes.destinations]
99\stoptyping
100
101The \type {fieldlayer} parameter can be used to set a so called viewer layer, so
102that you can hide them (given that a viewer supports that). The \type {calculate}
103parameter can associate a calculator (initializer) with the fields.
104
105You can create an interaction environment with:
106
107\showsetup {defineinteraction}
108
109which then can be used with:
110
111\showsetup {startinteraction}
112
113\stopchapter
114
115\stopcomponent
116
117
118