% Translation: 2006-10-09 VZ
% Checking:    2006-11-14 zyka
\startcomponent ma-cb-cz-interactivity
\project ma-cb
\product ma-cb-cz
\environment ma-cb-env-cz

%\chapter{Interactive mode in electronic documents}
\chapter{Interaktivn� m�d v~elektronick�ch dokumentech}

%\section{Introduction}
\section{�vod}

%% \index[reader]{\READER}
%% \index[exchange]{\EXCHANGE}
%% \index[distiller]{\DISTILLER}
\index[reader]{\READER}
\index[exchange]{\EXCHANGE}
\index[distiller]{\DISTILLER}

%% Nowadays documents can be made electronically available for
%% consulting on a computer and displaying on a computer screen.
Dokumenty dnes mohou b�t zp��stup�ov�ny elektronicky prost�ednictv�m
obrazovky po��ta�e.

%% Interaction means that you can click on active areas and
%% jump to the indicated areas. For example if you consult a
%% register you can click on a (active) page number and you will
%% jump to the corresponding page.
Po kliknut� my�� na ur�itou plochu interaktivn�ho dokumentu, se n�m
zobraz� jeho jin� ��st -- ta, kter� byla odkazov�na. P��kladem m��e b�t
kliknut� na ��slo strany v~rejst��ku a~n�sledn� zobrazen� odpov�daj�c�
str�nky dokumentu.

%% Interaction relates to:
Interakce se t�kaj�:

\startitemize[packed]
%% \item active chapter numbers in table of content
%% \item active page numbers in registers
%% \item active page numbers, chapter numbers and figure numbers in
%%       internal references to pages, chapters, figures etc.
%% \item active titles, page numbers, and chapter numbers in
%%       external references to other interactive documents
%% \item active menus as navigation tools
\item aktivn�ch ��sel kapitol v~obsahu;
\item aktivn�ch ��sel stran v~rejst��ku;
\item aktivn�ch ��sel stran, ��sel kapitol a ��sel obr�zk� ve
  vnit�n�ch odkazech na strany, kapitoly, obr�zky ap.;
\item aktivn�ch n�zv�, ��sel stran a ��sel kapitol v~extern�ch
  referenc�ch na jin� interaktivn� dokumenty;
\item aktivn� menu v~naviga�n�ch panelech.
\stopitemize

%% Interactivity depends on the program you use to view the
%% interactive document. We assume that you will use \PDFTEX\
%% for producing a \PDF\ document directly or use \DISTILLER\
%% to convert a \POSTSCRIPT\ file into a \PDF\ one. It is
%% obvious that you will then use \READER, \EXCHANGE, or
%% \GHOSTVIEW\ for viewing.
Interaktivn� chov�n� do jist� m�ry z�vis� na programu, kter�m
dokument prohl���me. Pokud p�edpokl�d�me, �e pou�ijeme \PDFTEX{} pro
p��m� generov�n� \PDF{} dokumentu nebo pou�ijeme \DISTILLER{} pro
p�eveden� \POSTSCRIPT{}ov�ho souboru na soubor \PDF, je pak z�ejm�, �e
pro zobrazen� pou�ijeme \PDF{} prohl��e�, nap��klad \READER,
\EXCHANGE{} nebo \GHOSTVIEW.

%% \CONTEXT\ is a very powerful system for producing electronic
%% or interactive \PDF\ documents. However only a few standard
%% features are described in this chapter. As the authors of
%% this manual are planning to make all \CONTEXT\ related
%% manuals electronically (sources included) available, reverse
%% engineering is one of the options to become more acquainted
%% with the possibilities of \CONTEXT.
\CONTEXT\ je velmi mocn� n�stroj pro generov�n� elektronick�ch nebo
interaktivn�ch dokument� \PDF. V~t�to kapitole je nicm�n� pops�no
jenom p�r standardn�ch vlastnost�. Proto�e auto�i tohoto manu�lu
cht�j� v�echny manu�ly v�novan� \CONTEXT u zp��stupnit elektronicky
v�etn� zdrojov�ch text�, je jednou z~mo�nost�, jak se d�v�rn� obezn�mit
se schopnostmi \CONTEXT{}u, zp�tn� in�en�rstv�.\footnote{Pozn. p�ekl.:
  Interaktivit� je v�nov�n manu�l \from[manual:widgets], viz
  \in{p��lohu}[sec:info].}

%% \section{Interactive mode}
\section{Interaktivn� m�d}

%% \index{interactive mode}
\index{interaktivn� m�d}

\Command{\tex{setupinteraction}}

%% The interactive mode is activated by:
Interaktivn� m�d se aktivuje pomoc�:

\shortsetup{setupinteraction}

%% For example:
Nap��klad:

\startbuffer
\setupinteraction
  [state=start,
   color=green,
   style=bold]
\stopbuffer

\typebuffer

%% The hyper links are now generated automatically and the
%% active words are displayed in bold green.
zp�sob�, �e se za�nou automaticky generovat hyperlinky a aktivn�
slova se zobraz� zelen�.

%% The interactive document is considerably bigger (in MB's)
%% than its paper cousin because hyperlinks consume space. You
%% will also notice that processing time becomes longer.
%% Therefore it is advisable to de-activate the interactive mode
%% as long as your document is under construction.
Interaktivn� dokumenty jsou podstatn� v�t�� (v~MB) ne� jejich pap�rov�
bratranci, proto�e hyperlinky zab�raj� n�jak� m�sto. Tak� si
v�imn�me, �e zpracov�n� dokumentu prob�h� pomaleji. Proto je v�hodn�
interaktivn� m�d b�hem p��pravn�ch f�z� tvorby dokumentu deaktivovat.

%% \section{Interaction within a document}
\section{Interaktivita v~r�mci jednoho dokumentu}

%% \index{interaction+internal}
\index{interakce+vnit�n�}

\Command{\tex{in}}
\Command{\tex{at}}
\Command{\tex{goto}}

%% Earlier you have seen how to make a reference with
%% \type{\in} and \type{\at}. You may have wondered why you had
%% to type \type{\in{chapter}[chap:introduction]}. In the first
%% place {\em chapter} and its corresponding chapter number
%% will not be separated at line breaking. In the second place
%% the word {\em chapter} and its number are typeset
%% differently in the interactive mode. This gives the user a
%% larger clickable area.
Ji� d��ve jsme vid�li, jak vytvo�it odkaz pomoc� \type{\in} a
\type{\at}. Mo�n� jste se divili, pro� p��eme
\type{\in{kapitola}[chap:uvod]}. Zaprv� se tak zamez�, aby slovo
{\em kapitola} a~koresponduj�c� ��slo bylo rozd�leno ��dkov�m
zlomem. A~zadruh� bude jak slovo {\em kapitola}, tak i~jej� ��slo s�zeno
v~interaktivn�m m�du aktivn�. D�ky tomu z�sk� �ten�� v�t�� klikatelnou
oblast.

%% In interactive mode there is one other command that has
%% little meaning in the paper variant.
V~interaktivn�m m�du m�me k~dispozici jeden p��kaz, kter�
v~pap�rov� variant� dokumentu nem� p��li� v�znam. Je j�m

\shortsetup{goto}

%% The curly braces contain text, the brackets contain a
%% reference (logical name, location).
Slo�en� z�vorky obsahuj� uvozuj�c� nebo ukon�uj�c� text reference,
hranat� odkaz (referen�n� jm�no nebo pokyn).

%% \startbuffer
%% In \goto{Hasselt}[fig:cityplan] all streets are build in a
%% circular way.
%% \stopbuffer
\startbuffer
V~\goto{Hasseltu}[fig:cityplan] jsou v�echny ulice vybudov�ny do kruhu.
\stopbuffer

\typebuffer

%% In the interactive document {\em Hasselt} will be green and
%% active. You will jump to a map of Hasselt.
V~interaktivn�m dokumentu bude slovo {\em Hasseltu} zelen� a
aktivn�. Sko��te j�m na obr�zek s~mapkou Hasseltu.

%% \section{Interaction between documents}
\section{Interaktivita mezi dokumenty}

%% \index{interaction+external}
\index{interakce+vn�j��}

\Command{\tex{from}}
\Command{\tex{useexternaldocument}}

%% It is possible to link one document to another. First you
%% have to state that you want to refer to another document.
%% This is done by:
Je mo�n� odkazovat z~jednoho dokumentu na jin�. Nejd��ve mus�me
registrovat vn�j�� dokument. D�l� se to pomoc�

\shortsetup{useexternaldocument}

%% The first bracket pair must contain a logical name of the
%% document, the second pair the file name of the other document
%% and the third pair is used for the title of the document.
Prvn� hranat� z�vorky mus� obsahovat logick� jm�no dokumentu, druh� p�r
z�vorek obsahuje jm�no souboru a posledn� z�vorky obklopuj� pojmenov�n�
vn�j��ho dokumentu.

%% For refering to these other documents you can use:
Pro odkazov�n� takto registrovan�ho dokumentu pou�ijeme

\shortsetup{from}

%% The curly braces contain text and the brackets contain the
%% reference.
% !!!
%Slo�en� z�vorky obsahuj� zobrazovan� text, hranat� referenci.
Z�vorky obsahuj� logick� jm�no dokumentu.

%% Look at the example below.
Pod�vejme se na n�sleduj�c� p��klad:

%% \startbuffer
%% \useexternaldocument[hia][hasbook][Hasselt in August]

%% Most tourist attractions are described in \from[hia]. A description
%% of the Eui||feest is found in \from[hia::euifeest]. A description
%% of the \goto{Eui||feest}[hia::euifeest] is found in \from[hia]. The
%% eui||feest is described on \at{page}[hia::euifeest] in \from[hia].
%% See for more information \in{chapter}[hia::euifeest] in \from[hia].
%% \stopbuffer

%% \typebuffer
\startbuffer
\useexternaldocument[hia][hasbook][Hasselt v~srpnu]

V�t�ina turistick�ch atrakc� je pops�na v~knize
\from[hia]. Podrobnosti o~Eui||feestu je mo�no nal�zt
v~knize \from[hia::euifeest]. Popis \goto{Eui||feestu}[hia::euifeest]
je v~pr�vodci \from[hia]. Eui||feest je pops�n na
\at{stran�}[hia::euifeest] v~materi�lu \from[hia]. 
Viz dal�� informace v~kapitole \in{kapitole}[hia::euifeest] knihy
\from[hia].
\stopbuffer

\typebuffer

%% The \type{\useexternaldocument} is usually typed in the
%% set up area of your input file.
P��kaz \type{\useexternaldocument} b�v� pou�it v~�vodn� oblasti
vstupn�ho souboru.

%% After processing your input file (at least two times to get
%% the references right), and the file \type{hasbook.tex},
%% you will have two \PDF\ documents. The references
%% above have the following meaning:
Po zpracov�n� na�eho vstupn�ho souboru (p�inejmen��m dvakr�t, aby byly
odkazy v~po��dku) a~souboru \type{hasbook.tex}, budeme m�t dva \PDF\
dokumenty. V��e uveden� odkazy maj� n�sleduj�c� v�znam:

\startitemize[packed]
%% \item \type{\from[hia]} will produce the active title you gave
%%       in the third bracket pair of
%%       \type{\useexternaldocument} and is linked to the
%%       first page of \type{hasbook.pdf}
\item \type{\from[hia]} vyrob� aktivn� titulek, kter� jsme uvedli
  v~t�et�m p�ru hranat�ch z�vorek p��kazu \type{\useexternaldocument}
  a~sv�z�n bude s~prvn� stranou \type{hasbook.pdf}.
%% \item \type{\from[hia::euifeest]} will produce an active title
%%       and is linked to the page where chapter Eui||feest
%%       begins
\item \type{\from[hia::euifeest]} vyrob� aktivn� titulek
  a~sv�e jej se stranou, kde za��n� kapitola Eui||feest.
%% \item \type{\goto{Eui||feest}[hia::euifeest]} will produce an
%%       active word {\em Eui||feest} and is linked to the page
%%       where chapter Eui||feest begins
\item \type{\goto{Eui||feest}[hia::euifeest]} vyrob� aktivn� slovo
  {\em Eui||feest} a~sv�e jej se stranou, kde za��n� kapitola
  Eui||feest.
%% \item \type{\at{page}[hia::euifeest]} will produce an active
%%       word {\em page} and page number and is linked to that
%%       page
\item \type{\at{strana}[hia::euifeest]} vyrob� aktivn� slovo
  {\em strana}, p�ipoj� ��slo strany a~sv�e je s~touto stranou.
%% \item \type{\in{chapter}[hia::euifeest]} will produce on
%%       active word {\em chapter} and chapter number and is
%%       linked to that chapter
\item \type{\in{kapitola}[hia::euifeest]} vyrob� aktivn� slovo
  {\em kapitola}, p�ipoj� ��slo kapitoly a~sv�e je s~p��slu�nou
  kapitolou.
\stopitemize

%% As you can see the \type{::} separates the (logical) file name
%% and the destination in that file.
Jak jsme mohli vid�t, \type{::} odd�luje (logick�) jm�no souboru
a~referen�n� jm�no doskoku v~tomto dokumentu.

%% \section{Menus}
\section{Menu}

%% You can define navigation tools with:
Definovat m��eme tak� naviga�n� panel pomoc�

\shortsetup{defineinteractionmenu}

%% The first bracket pair is used for a logical name that can
%% be used to recall the menu. The second pair contains the
%% location on the screen. The third pair is used for setting
%% up the menu.
Prvn� p�r z�vorek definuje referen�n� jm�no, kter� m��e pozd�ji b�t
pou�ito pro vyvol�n� menu. Druh� z�vorky ur�uj� polohu na
obrazovce. T�et� nastavuj� menu.

%% A typical menu definition might look like this:
Typick� definice menu vypad� takto:

%% \startbuffer
%% \setupcolors
%%   [state=start]

%% \setupinteraction
%%   [state=start,
%%    menu=on]

%% \defineinteractionmenu
%%   [mymenu]
%%   [right]
%%   [state=start,
%%    align=middle,
%%    background=screen,
%%    frame=on,
%%    width=\marginwidth,
%%    style=smallbold,
%%    color=]

%% \setupinteractionmenu
%%   [mymenu]
%%   [{Content[content]},
%%    {Index[index]},
%%    {\vfill},
%%    {Stop[ExitViewer]}]
%% \stopbuffer
\startbuffer
\setupcolors
  [state=start]

\setupinteraction
  [state=start,
   menu=on]

\defineinteractionmenu
  [mymenu]
  [right]
  [state=start,
   align=middle,
   background=screen,
   frame=on,
   width=\marginwidth,
   style=smallbold,
   color=]

\startinteractionmenu[mymenu]
  \but [content] Obsah \\
  \but [index] Rejst��k \\
  \vfill \\
  \but [ExitViewer] Konec \\
\stopinteractionmenu

\setupheadertexts[{\interactionmenu[mymenu]}]
\stopbuffer

\typebuffer

%% This will produce a menu on the right hand side of every
%% screen. The menu buttons contain the text {\em Content}, {\em
%% Index} and {\em Stop} with respectively the following
%% functions: jump to the table of contents, jump to the index
%% and leave the viewer. The labels to obvious destinations
%% like \type{content} and \type{index} are predefined. Other
%% predefined destinations are \type{FirstPage},
%% \type{LastPage}, \type{NextPage} and
%% \type{PreviousPage}.
Tato definice vytvo�� na prav� stran� ka�d� strany menu. Tla��tka menu
budou obsahovat texty {\em Obsah}, {\em Rejst��k} a {\em Konec}
s~odpov�daj�c�mi funkcemi, po �ad�: skok na obsah, skok na rejst��k
a~ukon�en� prohl��e�e. N�v�t� na obvykl� doskoky, jak�mi jsou
nap�. \type{content} a~\type{index}, jsou p�eddefinov�ny, pokud obsah
a~rejst��k vlo��me pomoc� \type{\completecontent} a~\type{\completeindex}. Jin�
p�eddefinovan� funkce jsou \type{FirstPage} (prvn� strana),
\type{LastPage} (posledn� strana), \type{NextPage} (dal�� strana)
a~\type{PreviousPage} (p�edchoz� strana). O~vlo�en� menu se star�
\type{\interactionmenu}.

%% An action like \type{ExitViewer} is necessary to make an
%% electronic document self containing. Other predefined
%% actions you can use are \type{PrintDocument},
%% \type{SearchDocument} and \type{PreviousJump}. The meaning of
%% these actions is obvious.
Akce typu \type{ExitViewer} (ukon�i prohl��e�) je nezbytn�, aby n�
elektronick� dokument byl samoobsa�n�. Jin� p�eddefinovan� akce, kter�
m��eme pou��t jsou \type{PrintDocument} (tiskni),
\type{SearchDocument} (prohledej dokument) a~\type{PreviousJump}
(skok na p�edchoz� zobrazen�). 

%% Menus are set up with:
Menu jsou nastavov�na pomoc�:

\shortsetup{startinteractionmenu}

\stopcomponent
