diff options
author | Marius <mariausol@gmail.com> | 2012-01-02 18:40:26 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-01-02 18:40:26 +0200 |
commit | 47864ebdfe2d9916e365c2f278585a94879c813d (patch) | |
tree | d39e6ffd03197668549d215301cf0a80c1a9ed76 /tex/context/base/scrn-bar.mkvi | |
parent | 622f28bc3cb9a918b1e50a77427c193c7b671cce (diff) | |
download | context-47864ebdfe2d9916e365c2f278585a94879c813d.tar.gz |
beta 2012.01.02 17:18
Diffstat (limited to 'tex/context/base/scrn-bar.mkvi')
-rw-r--r-- | tex/context/base/scrn-bar.mkvi | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/tex/context/base/scrn-bar.mkvi b/tex/context/base/scrn-bar.mkvi index 3be46d915..d2915eb1b 100644 --- a/tex/context/base/scrn-bar.mkvi +++ b/tex/context/base/scrn-bar.mkvi @@ -78,10 +78,10 @@ \endgroup \fi} -\newdimen\scrn_bar_width -\newdimen\scrn_bar_height -\newdimen\scrn_bar_depth -\newdimen\scrn_bar_distance +\newdimen\d_scrn_bar_width +\newdimen\d_scrn_bar_height +\newdimen\d_scrn_bar_depth +\newdimen\d_scrn_bar_distance %D Interaction buttons, in fact a row of tiny buttons, are %D typically only used for navigational purposed. The next @@ -127,9 +127,9 @@ {\begingroup %\let\menuparameter\interactionbarparameter \setupcurrentinteractionbar[#settings]% - \scrn_bar_width\interactionbarparameter\c!width - \ifdim\scrn_bar_width=\zeropoint - \scrn_bar_width1.5\emwidth + \d_scrn_bar_width\interactionbarparameter\c!width + \ifdim\d_scrn_bar_width=\zeropoint + \d_scrn_bar_width1.5\emwidth \fi \doifnothing{\interactionbarparameter\c!height}{\letinteractionbarparameter\c!height\v!broad}% \doifnothing{\interactionbarparameter\c!depth }{\letinteractionbarparameter\c!depth\!!zeropoint}%%% @@ -144,15 +144,15 @@ [ \v!page=>\advance\!!counta\plusfour, \v!subpage=>\advance\!!counta\plusfour, \s!unknown=>\advance\!!counta\plusone]% - \ifdim\scrn_bar_width=\zeropoint - \!!widtha\dimexpr2\emwidth+\scrn_bar_distance\relax - \!!widthb\dimexpr\!!counta\!!widtha-\scrn_bar_distance\relax + \ifdim\d_scrn_bar_width=\zeropoint + \!!widtha\dimexpr2\emwidth+\d_scrn_bar_distance\relax + \!!widthb\dimexpr\!!counta\!!widtha-\d_scrn_bar_distance\relax \else - \!!widtha\scrn_bar_width - \!!widthb\dimexpr\!!counta\scrn_bar_distance-\scrn_bar_distance\relax + \!!widtha\d_scrn_bar_width + \!!widthb\dimexpr\!!counta\d_scrn_bar_distance-\d_scrn_bar_distance\relax \advance\!!widtha -\!!widthb \divide\!!widtha \!!counta - \!!widthb\scrn_bar_width + \!!widthb\d_scrn_bar_width \fi \hbox to \!!widthb {\setnostrut @@ -182,14 +182,14 @@ % todo: this will be \letblackruleparameter\c!width\!!widtha (faster) \def\scrn_bar_alternative_a - {\scrn_bar_width \interactionbarparameter\c!width - \scrn_bar_distance\interactionbarparameter\c!distance - \scrn_bar_height \interactionbarparameter\c!height - \scrn_bar_depth \interactionbarparameter\c!depth - \noindent\hbox to \scrn_bar_width \bgroup + {\d_scrn_bar_width \interactionbarparameter\c!width + \d_scrn_bar_distance\interactionbarparameter\c!distance + \d_scrn_bar_height \interactionbarparameter\c!height + \d_scrn_bar_depth \interactionbarparameter\c!depth + \noindent\hbox to \d_scrn_bar_width \bgroup \dontcomplain \setupblackrules[\c!height=\v!max,\c!depth=\v!max]% - \!!widthb\dimexpr\scrn_bar_width-4\emwidth\relax + \!!widthb\dimexpr\d_scrn_bar_width-4\emwidth\relax \processaction [\interactionbarparameter\c!step] [ \v!small=>\scratchcounter 20, @@ -198,7 +198,7 @@ \s!unknown=>\scratchcounter 10]% \!!widtha\dimexpr\!!widthb/\scratchcounter\relax \setupblackrules[\c!width=\!!widtha]% - \setbox\scratchbox\hbox to \scrn_bar_width + \setbox\scratchbox\hbox to \d_scrn_bar_width {\hskip2\emwidth \setbox\scratchbox\hbox{\blackrule[\c!color=\interactionbarparameter\c!backgroundcolor]}% \dorecurse\scratchcounter @@ -230,10 +230,10 @@ \def\scrn_bar_alternative_c {\ifnum\lastpage>\plusone - \scrn_bar_width\interactionbarparameter\c!width - \hbox to \scrn_bar_width + \d_scrn_bar_width\interactionbarparameter\c!width + \hbox to \d_scrn_bar_width {\setupblackrules[\c!height=\interactionbarparameter\c!height,\c!depth=\interactionbarparameter\c!depth,\c!width=\emwidth]% - \scratchdimen\dimexpr(\scrn_bar_width-4\emwidth)/\numexpr\lastpage+\minusone\relax\relax + \scratchdimen\dimexpr(\d_scrn_bar_width-4\emwidth)/\numexpr\lastpage+\minusone\relax\relax \!!widtha\numexpr\realpageno+\minusone\relax\scratchdimen \!!widthb\numexpr\lastpage-\realpageno\relax\scratchdimen \directgotospecbox\interactionbarparameter{\blackrule}[\v!firstpage]% @@ -249,20 +249,20 @@ {\symbol[\ifcase#whereto\v!previous\or\v!somewhere\or\v!next\fi]} \unexpanded\def\scrn_bar_goto_b#whereto% - {\vrule\!!height\scrn_bar_height\!!depth\scrn_bar_depth\!!width\!!widtha\relax} + {\vrule\!!height\d_scrn_bar_height\!!depth\d_scrn_bar_depth\!!width\!!widtha\relax} \unexpanded\def\scrn_bar_goto_c#whereto% {\symbol[\ifcase#whereto\v!previous\or\v!somewhere\or\v!somewhere\or\v!somewhere\or\v!next\fi} \unexpanded\def\scrn_bar_goto_d#whereto% {\vrule \!!width\!!widtha \ifcase#whereto% - \!!height \scrn_bar_height \!!depth \scrn_bar_depth \or - \!!height.5\scrn_bar_height \!!depth.5\scrn_bar_depth \or - \!!height \scrn_bar_height \!!depth \scrn_bar_depth \or - \!!height.5\scrn_bar_height \!!depth.5\scrn_bar_depth \else - \!!height \scrn_bar_height \!!depth \scrn_bar_depth \fi} + \!!height \d_scrn_bar_height \!!depth \d_scrn_bar_depth \or + \!!height.5\d_scrn_bar_height \!!depth.5\d_scrn_bar_depth \or + \!!height \d_scrn_bar_height \!!depth \d_scrn_bar_depth \or + \!!height.5\d_scrn_bar_height \!!depth.5\d_scrn_bar_depth \else + \!!height \d_scrn_bar_height \!!depth \d_scrn_bar_depth \fi} -\newconstant\scrn_bar_mode +\newconstant\c_scrn_bar_mode \unexpanded\def\scrn_bar_goto_x#command% {\doifelse{\interactionbarparameter\c!symbol}\v!yes @@ -271,64 +271,64 @@ {\let\scrn_bar_goto_indeed\scrn_bar_goto_b}% \dorecurse\nofsubpages {\scratchcounter\numexpr\recurselevel+\firstsubpage+\minusone\relax - \scrn_bar_mode + \c_scrn_bar_mode \ifnum\scratchcounter<\realpageno \zerocount \else \ifnum\scratchcounter=\realpageno \plusone \else \plustwo \fi\fi - \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\scrn_bar_goto_indeed\scrn_bar_mode}[page(\the\scratchcounter)]}% + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\scrn_bar_goto_indeed\c_scrn_bar_mode}[page(\the\scratchcounter)]}% #command}% \unskip} \def\scrn_bar_alternative_d {\ifnum\nofsubpages>\plusone \doif{\structurecounterparameter\s!subpage\c!state}\v!start{% - \scrn_bar_width \interactionbarparameter\c!width - \scrn_bar_distance\interactionbarparameter\c!distance - \scrn_bar_height \interactionbarparameter\c!height - \scrn_bar_depth \interactionbarparameter\c!depth - \!!widtha\scrn_bar_width - \noindent\hbox{\scrn_bar_goto_x{\hskip\scrn_bar_distance}}% + \d_scrn_bar_width \interactionbarparameter\c!width + \d_scrn_bar_distance\interactionbarparameter\c!distance + \d_scrn_bar_height \interactionbarparameter\c!height + \d_scrn_bar_depth \interactionbarparameter\c!depth + \!!widtha\d_scrn_bar_width + \noindent\hbox{\scrn_bar_goto_x{\hskip\d_scrn_bar_distance}}% }\fi} \def\scrn_bar_alternative_e {\ifnum\nofsubpages>\plusone \doif{\structurecounterparameter\s!subpage\c!state}\v!start{% - \scrn_bar_width \interactionbarparameter\c!width - \scrn_bar_distance\interactionbarparameter\c!distance - \scrn_bar_height \interactionbarparameter\c!height - \scrn_bar_depth \interactionbarparameter\c!depth - \!!widthb\dimexpr\nofsubpages\scrn_bar_distance-\scrn_bar_distance\relax % (n-1) - \!!widtha\dimexpr(\scrn_bar_width-\!!widthb)/\nofsubpages\relax - \ifdim\!!widtha<\scrn_bar_distance + \d_scrn_bar_width \interactionbarparameter\c!width + \d_scrn_bar_distance\interactionbarparameter\c!distance + \d_scrn_bar_height \interactionbarparameter\c!height + \d_scrn_bar_depth \interactionbarparameter\c!depth + \!!widthb\dimexpr\nofsubpages\d_scrn_bar_distance-\d_scrn_bar_distance\relax % (n-1) + \!!widtha\dimexpr(\d_scrn_bar_width-\!!widthb)/\nofsubpages\relax + \ifdim\!!widtha<\d_scrn_bar_distance \scrn_bar_alternative_f \else - \noindent\hbox to \scrn_bar_width{\scrn_bar_goto_x{\hss}\unskip}% + \noindent\hbox to \d_scrn_bar_width{\scrn_bar_goto_x{\hss}\unskip}% \fi }\fi} \def\scrn_bar_alternative_f {\ifnum\nofsubpages>\plusone \doif{\structurecounterparameter\s!subpage\c!state}\v!start{% - \scrn_bar_width \interactionbarparameter\c!width - \scrn_bar_distance\interactionbarparameter\c!distance - \scrn_bar_height \interactionbarparameter\c!height - \scrn_bar_depth \interactionbarparameter\c!depth - \noindent \hbox to \scrn_bar_width \bgroup + \d_scrn_bar_width \interactionbarparameter\c!width + \d_scrn_bar_distance\interactionbarparameter\c!distance + \d_scrn_bar_height \interactionbarparameter\c!height + \d_scrn_bar_depth \interactionbarparameter\c!depth + \noindent \hbox to \d_scrn_bar_width \bgroup \doloop {\!!countc\numexpr(\nofsubpages/\recurselevel)+\plusone\relax % rounding - \!!widthb\scrn_bar_distance + \!!widthb\d_scrn_bar_distance \multiply\!!widthb \!!countc - \advance\!!widthb -\scrn_bar_distance - \!!widtha\scrn_bar_width + \advance\!!widthb -\d_scrn_bar_distance + \!!widtha\d_scrn_bar_width \advance\!!widtha -\!!widthb \divide\!!widtha \!!countc - \ifdim\!!widtha<\scrn_bar_distance\else + \ifdim\!!widtha<\d_scrn_bar_distance\else \!!countb\recurselevel \exitloop \fi}% \ifnum\!!countc>\plusone % this is not that well tested \advance\!!countc \minustwo - \!!widtha-\scrn_bar_distance + \!!widtha-\d_scrn_bar_distance \!!widtha\!!countc\!!widtha - \advance\!!widtha \scrn_bar_width + \advance\!!widtha \d_scrn_bar_width \advance\!!countc \plusone \divide\!!widtha \!!countc \fi @@ -345,7 +345,7 @@ \advance\!!countf \plusone \ifnum\recurselevel=\firstsubpage\relax \!!doneatrue \fi \ifnum\recurselevel=\lastsubpage \relax \!!doneatrue \fi - \scrn_bar_mode + \c_scrn_bar_mode \if!!donea \ifnum\recurselevel<\realpageno \zerocount @@ -367,7 +367,7 @@ \plusthree \fi \fi - \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\scrn_bar_goto_indeed\scrn_bar_mode}[page(\recurselevel)]}% + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\scrn_bar_goto_indeed\c_scrn_bar_mode}[page(\recurselevel)]}% \hss \!!countf\zerocount}% \unskip |