tglogo.png

Downloading File

Filename: PW Progress
/*
/prog -o TITLE
open the progress

/prog -p [0-100]
progress bar (can assume decimal number)

/prog -c
close the progress
*/

alias prog { progress $1- }
alias progress {
  if ($1 == -o && !$window(@Progress) && !$window(@Progress.B) && $2-) {
    window -pdohknBC +dL @Progress -1 -1 $iif($calc($width($2-,tahoma,13) +30) < 256,$v2,$v1) 64
    drawrect -rf @Progress 16514043 1 0 0 $window(@Progress).w $window(@Progress).h
    drawrect -r @Progress 14869218 2 0 0 $window(@Progress).w $window(@Progress).h
    drawtext -r @Progress 0 tahoma 13 $calc(($window(@Progress).w - $width($2-,tahoma,13))/2) 12 $2-
    drawrect -r @Progress 6842472 1 10 40 $calc($window(@Progress).w -20) 13
    window -a @Progress
    var %prog = 164,202,255 149,183,231 142,178,228 133,170,223 124,164,220 117,158,214 20,125,251 25,136,243 36,150,238 50,170,238 91,228,255,%p = 1
    window -phkBC +d @Progress.B 1 1 $calc($window(@Progress).w -22) 11
    while (%p <= 11) {
      var %c = $gettok(%prog,%p,32)
      drawdot -r @Progress.B $rgb($gettok(%c,1,44),$gettok(%c,2,44),$gettok(%c,3,44)) 1 0 %p
      inc %p
    }
    %p = 1
    while (%p <= $window(@Progress.B).w) {
      drawcopy @Progress.B 0 0 1 11 @Progress.B %p 0
      inc %p
    }
  }
  if ($1 == -c) {
    window -c @Progress
    window -c @Progress.B
  }
  if ($1 == -p && $window(@Progress) && $window(@Progress.B) && $2 isnum 0-100) {
    drawrect -rnf @Progress 16514043 1 11 41 $window(@Progress.B).w 11
    drawcopy -n @Progress.B 0 0 $round($calc(($window(@Progress.B).w * $2)/100),0) 11 @Progress 11 41
    drawtext -rn @Progress 0 tahoma 9 $calc(($window(@Progress).w -20- $width($+($2,%),tahoma,9))/2 +10) 41 $+($2,%)
    drawdot @Progress
  }
}

Related Files

by Flobse
by Takaharu
by Pepsi_Man0077

Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand