scale.table 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # scale.table
  2. !'
  3. "Scale rendering using the table:"
  4. $func('scale.table', 275, 420) + ' 275 / 420'
  5. $func('scale.table', 400, 420) + ' 400 / 420'
  6. $func('scale.table', 420, 420) + ' 420 / 420'
  7. $func('scale.table', 157, 420) + ' 157 / 420'
  8. $func('scale.table', 42, 420) + ' 42 / 420'
  9. $func('scale.table', 0, 420) + ' 0 / 420'
  10. '!
  11. !!-----scale.table------
  12. args[0] = args[0] & ! the current value of the parameter
  13. args[1] = args[1] & ! the maximum value
  14. if args[2] = 0:args[2] = 200 & ! Span (tables) pixels. default 350 px
  15. if $ARGS[3] = "":$ARGS[3] = "FF0000" & ! the color of the filled part of the scale in the format RRGGBB. default - red
  16. $ARGS['table'] = '<table width="<<args[2]>>" border="0" cellspacing="0" cellpadding="0"><tr>'
  17. args['x'] = (args[0] * 100) / args[1]
  18. args['empty'] = 100 - args['x']
  19. if args['x'] > 0:
  20. $ARGS['table'] += '<td width="<<args['x']>>%" bgcolor="#' + $ARGS[3] + '">&nbsp;</td>'
  21. elseif args['empty'] > 0:
  22. $ARGS['table'] + = "<td width="<<args['empty']>>%" bgcolor="#888888">&nbsp;</td>"
  23. end
  24. $ARGS['table'] += '</tr></table>'
  25. $result = $ARGS['table']
  26. --- scale.table ---------------------------------