From 69d2352af4b60929b37fc49f3bdb263977016244 Mon Sep 17 00:00:00 2001 From: Marius Date: Fri, 19 Oct 2012 01:20:13 +0300 Subject: stable 2012.05.30 11:26 --- tex/context/base/pack-bar.mkiv | 97 ++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 61 deletions(-) (limited to 'tex/context/base/pack-bar.mkiv') diff --git a/tex/context/base/pack-bar.mkiv b/tex/context/base/pack-bar.mkiv index 06eeebd14..6967173e2 100644 --- a/tex/context/base/pack-bar.mkiv +++ b/tex/context/base/pack-bar.mkiv @@ -13,80 +13,55 @@ \writestatus{loading}{ConTeXt Packaging Macros / Bars} +%D This code has been moved from scrn-int to here (was some old +%D experimental code). It could be in scrn-bar but it's static. \unprotect -%D This code has been moved from scrn-int to here (was some old -%D experimental code). It could be in scrn-bar but it's static. In -%D the meantime the interface has been adapted to a key|/|value one. -%D %D \startbuffer -%D \dorecurse{10}{ -%D \ruledhbox{\horizontalpositionbar[n=#1,min=1,max=10,text=!,color=red]} -%D \par -%D } -%D \stopbuffer -%D -%D \typebuffer \stoplinecorrection \getbuffer \stoplinecorrection +%D \dorecurse{10} +%D {\horizontalpositionbar +%D \pos\recurselevel \min1 \max10 +%D \token\framed{\recurselevel}% +%D \\} %D -%D \startbuffer -%D \dorecurse{10}{ -%D \ruledhbox{\horizontalgrowingbar[n=#1,min=1,max=10,text=!,color=red]} -%D \par -%D } +%D \hbox to 15em +%D {\hss +%D \dorecurse{10} +%D {\verticalpositionbar\pos\recurselevel\min1\max10\token\blackrule\\ +%D \hss}} %D \stopbuffer -%D -%D \typebuffer \stoplinecorrection \getbuffer \stoplinecorrection - -\installcorenamespace{positionbar} - -\installsimplecommandhandler \??positionbar {positionbar} - -\setuppositionbar - [\c!min=1, - \c!max=1, - \c!n=1, - \c!text=?, - \c!width=\emwidth, - \c!height=\strutheight, - \c!depth=\strutdepth] -\unexpanded\def\horizontalpositionbar[#1]% +\def\horizontalpositionbar\pos#1\min#2\max#3\token#4\\% {\hbox to \hsize - {\setuppositionbar[#1]% - \usepositionbarstyleandcolor\c!style\c!color - \hskip\zeropoint\s!plus \positionbarparameter\c!n \s!fill - \hskip\zeropoint\s!plus-\positionbarparameter\c!min\s!fill - \positionbarparameter\c!text\relax - \hskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill - \hskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} + {\hskip\zeropoint\!!plus #1\!!fill + \hskip\zeropoint\!!plus-#2\!!fill + #4\relax + \hskip\zeropoint\!!plus #3\!!fill + \hskip\zeropoint\!!plus-#1\!!fill}} -\unexpanded\def\verticalpositionbar[#1]% +\def\verticalpositionbar\pos#1\min#2\max#3\token#4\\% {\vbox to \vsize - {\setuppositionbar[#1]% - \usepositionbarstyleandcolor\c!style\c!color - \vskip\zeropoint\s!plus \positionbarparameter\c!n \s!fill - \vskip\zeropoint\s!plus-\positionbarparameter\c!min\s!fill - \positionbarparameter\c!text\relax - \vskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill - \vskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} + {\vskip\zeropoint\!!plus #1\!!fill + \vskip\zeropoint\!!plus-#2\!!fill + \hbox{#4}\relax + \vskip\zeropoint\!!plus #3\!!fill + \vskip\zeropoint\!!plus-#1\!!fill}} -\unexpanded\def\horizontalgrowingbar[#1]% +\def\horizontalgrowingbar\pos#1\min#2\max#3\height#4\depth#5\\% {\hbox to \hsize - {\setuppositionbar[#1]% - \usepositionbarstyleandcolor\c!style\c!color - \leaders\vrule\hskip\zeropoint\s!plus \numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill - \vrule\s!width\zeropoint\s!height\positionbarparameter\c!height\s!depth\positionbarparameter\c!depth - \hskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill - \hskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} + {\scratchcounter\numexpr#1-#2+\plusone\relax + \leaders\vrule\hskip\zeropoint\!!plus \scratchcounter\!!fill + \vrule\!!width\zeropoint\!!height#4\!!depth#5% + \hskip\zeropoint\!!plus #3\!!fill + \hskip\zeropoint\!!plus-#1\!!fill}} -\unexpanded\def\verticalgrowingbar[#1]% +\def\verticalgrowingbar\pos#1\min#2\max#3\width#4\\% {\vbox to \vsize - {\setuppositionbar[#1]% - \usepositionbarstyleandcolor\c!style\c!color - \leaders\hrule\vskip\zeropoint\s!plus\numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill - \hrule\s!width\positionbarparameter\c!width\s!height\zeropoint\s!depth\zeropoint - \vskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill - \vskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} + {\scratchcounter\numexpr#1-#2+\plusone\relax + \leaders\hrule\vskip\zeropoint\!!plus\scratchcounter\!!fill + \hrule\!!width#4\!!height\zeropoint\!!depth\zeropoint + \vskip\zeropoint\!!plus #3\!!fill + \vskip\zeropoint\!!plus-#1\!!fill}} \protect \endinput -- cgit v1.2.3