All pastes #770669 Raw Edit

Mine

public text v1 · immutable
·published 2007-11-12 14:19 UTC
rendered paste body
2F*
-These are buttons, pbars, tools etc. for Picture Windows
-created by Foshizzle.
-Most if not all of the images were created by foshizzle.
-All Scripts by Foshizzle
-Version 1
-
*/


;PBar--Created By Foshizzle

;demo
alias progbartest {
  window -pkodCf @progress -1 -1 302 28
  drawpbar -lpv @progress 1 1 300 25 20031323
}
alias pbtt {
  window -pkodCf +l @progresst -1 -1 302 30
  drawpbar -lp @progresst 1 1 300 29 193
}

;:;:;:;
;engine

alias drawpbar {
  if ($1-) {
    $iif(-* iswm $1, set %switch $1, set %switch $null)
    $iif($iif(%switch == $null, $1, $2), set %pbarwin $iif(%switch == $null, $1, $2), goto err)
    $iif($iif(%switch == $null, $2, $3), set %x $iif(%switch == $null, $2, $3), goto err)
    $iif($iif(%switch == $null, $3, $4), set %y $iif(%switch == $null, $3, $4), goto err)
    $iif($iif(%switch == $null, $4, $5), set %w $iif(%switch == $null, $4, $5), goto err)
    $iif($iif(%switch == $null, $5, $6), set %h $iif(%switch == $null, $5, $6), goto err)
    $iif($iif(%switch == $null, $6, $7), set %c $iif(%switch == $null, $6, $7), goto err)
    set %prcnt 0
    set %inc.x $calc(%w / 100)
    set %lo 0
    $iif(*v* iswm $1, contloadvis, contloadbas)
    halt
    :err
    echo 2 -a Error!
  }
}
alias -l contloadvis {
  if (%prcnt <= 100) && ($window(%pbarwin, *)) {
    var %hc1 %h
    var %ch1 205
    while (%hc1 >= 0) {
      drawrect -nrf %pbarwin $rgb(%ch1,%ch1,%ch1) 1 %x %y %w %hc1
      dec %hc1
      inc %ch1 2
    }
    var %hc2 %h
    var %ch2 %c
    while (%hc2 >= 0) {
      drawrect -nrf %pbarwin $rgb(%ch2,30,30) 1 %x %y %lo %hc2
      dec %hc2
      inc %ch2 7
    }
    drawrect -nr %pbarwin $rgb(40,40,40) 1 %x %y %w %h
    $iif(*l* iswm %switch, drawtext -n %pbarwin 1 tahoma 10 $calc(%x + 5) $calc(%y + (%h / 2) - 5) Loading $+ $str(.,$and(3,%prcnt)), $null)
    $iif(*p* iswm %switch, drawtext -n %pbarwin 1 tahoma 10 $calc(%w / 2) $calc(%y + (%h / 2) - 5) %prcnt $+ %, $null)
    inc %prcnt
    inc %lo %inc.x
    $iif(%pbarwin, drawrect %pbarwin, halt)
    $iif(%pbarwin, .timer -m 1 30 contloadvis, halt)
  }
  elseif (%prcnt > 100) { window -c %pbarwin | unset %pbarwin | unset %w | unset %h | unset %prcnt | unset %inc.x | unset %lo | unset %switch | unset %x | unset %y | unset %c }
}
alias -l contloadbas {
  alias -l contloadvis {
    if (%prcnt <= 100) && ($window(%pbarwin, *)) {
      drawrect -nrf %pbarwin $rgb(250,250,250) 1 %x %y %w %h
      drawrect -nrf %pbarwin $rgb(100,155,255) 1 %x %y %lo %h
      drawrect -nr %pbarwin $rgb(40,40,40) 1 %x %y %w %h
      $iif(*l* iswm %switch, drawtext -n %pbarwin 1 tahoma 10 $calc(%x + 5) $calc(%y + (%h / 2) - 5) Loading..., $null)
      $iif(*p* iswm %switch, drawtext -n %pbarwin 1 tahoma 10 $calc(%w / 2) $calc(%y + (%h / 2) - 5) %prcnt $+ %, $null)
      inc %prcnt
      inc %lo %inc.x
      $iif(%pbarwin, drawrect %pbarwin, halt)
      $iif(%pbarwin, .timer -m 1 30 contloadbas, halt)
    }
    elseif (%prcnt > 100) { window -c %pbarwin | unset %pbarwin | unset %w | unset %h | unset %prcnt | unset %inc.x | unset %lo | unset %switch | unset %x | unset %y | unset %c }
  }
}
;:;:;:;: