indiktab.qsrc 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. # indiktab
  2. ! ARGS[0] ... color
  3. !! color palette selector
  4. ! ARGS[1] ... percentage
  5. !! scales the bar from 0 to 100
  6. ! ARGS[2] ... real value
  7. !! the value displayed on the bar
  8. ! ARGS[3] ... phantom
  9. !! ghost value, used for painkillers
  10. if $ARGS[2] = '': $ARGS[2] = str(ARGS[2])
  11. indiktab['bar_progress'] = min(max(ARGS[1], 0), 100)
  12. if Enable_statfsize > 0:
  13. indiktab['label_width'] = len($ARGS[2]) * Enable_statfsize*2
  14. else
  15. indiktab['label_width'] = len($ARGS[2]) * fsize/2
  16. end
  17. if ARGS[3] > 0: indiktab['bar_phantom'] = min(max(ARGS[3] - indiktab['bar_progress'], 0), 100 - indiktab['bar_progress'])
  18. !{if Enable_Android = 1:
  19. $indiktab['bar_bg_color'] = 'gray'
  20. else}
  21. ! $indiktab['bar_bg_color'] = $bcolor
  22. ! end
  23. if ARGS[0] = 1:
  24. !{ if Enable_Android = 1:
  25. if indiktab['bar_progress'] >= 65:
  26. $indiktab['bar_color'] = 'green'
  27. elseif indiktab['bar_progress'] >= 35:
  28. $indiktab['bar_color'] = 'blue'
  29. $indiktab['phantom_color'] = '#00007F'
  30. else
  31. $indiktab['bar_color'] = 'red'
  32. end
  33. else}
  34. if indiktab['bar_progress'] >= 85:
  35. $indiktab['bar_color'] = '#008000'
  36. $indiktab['phantom_color'] = '#003F00'
  37. $indiktab['bar_label'] = '#FFFFFF'
  38. $indiktab['phantom_label'] = '#FFFFFF'
  39. elseif indiktab['bar_progress'] >= 70:
  40. $indiktab['bar_color'] = '#b3b300'
  41. $indiktab['phantom_color'] = '#595900'
  42. $indiktab['bar_label'] = '#000000'
  43. $indiktab['phantom_label'] = '#FFFFFF'
  44. elseif indiktab['bar_progress'] >= 50:
  45. $indiktab['bar_color'] = '#00CED1'
  46. $indiktab['phantom_color'] = '#006666'
  47. $indiktab['bar_label'] = '#000000'
  48. $indiktab['phantom_label'] = '#FFFFFF'
  49. elseif indiktab['bar_progress'] >= 20:
  50. $indiktab['bar_color'] = '#0000ff'
  51. $indiktab['phantom_color'] = '#00007F'
  52. $indiktab['bar_label'] = '#FFFFFF'
  53. $indiktab['phantom_label'] = '#FFFFFF'
  54. elseif indiktab['bar_progress'] >= 10:
  55. $indiktab['bar_color'] = '#ff6600'
  56. $indiktab['phantom_color'] = '#7F3300'
  57. $indiktab['bar_label'] = '#000000'
  58. $indiktab['phantom_label'] = '#FFFFFF'
  59. else
  60. $indiktab['bar_color'] = '#ff0000'
  61. $indiktab['phantom_color'] = '#7F0000'
  62. $indiktab['bar_label'] = '#000000'
  63. $indiktab['phantom_label'] = '#FFFFFF'
  64. end
  65. ! end
  66. elseif ARGS[0] = 2:
  67. !{ if Enable_Android = 1:
  68. if indiktab['bar_progress'] >= 85:
  69. $indiktab['bar_color'] = 'red'
  70. elseif indiktab['bar_progress'] >= 65:
  71. $indiktab['bar_color'] = 'orange'
  72. elseif indiktab['bar_progress'] >= 45:
  73. $indiktab['bar_color'] = 'yellow'
  74. elseif indiktab['bar_progress'] >= 25:
  75. $indiktab['bar_color'] = 'green'
  76. else
  77. $indiktab['bar_color'] = 'blue'
  78. end
  79. else}
  80. if indiktab['bar_progress'] >= 90:
  81. $indiktab['bar_color'] = '#ff0000'
  82. $indiktab['phantom_color'] = '#7F0000'
  83. $indiktab['bar_label'] = '#000000'
  84. $indiktab['phantom_label'] = '#FFFFFF'
  85. elseif indiktab['bar_progress'] >= 80:
  86. $indiktab['bar_color'] = '#ff1a1a'
  87. $indiktab['phantom_color'] = '#7F0E0E'
  88. $indiktab['bar_label'] = '#000000'
  89. $indiktab['phantom_label'] = '#FFFFFF'
  90. elseif indiktab['bar_progress'] >= 70:
  91. $indiktab['bar_color'] = '#ff3333'
  92. $indiktab['phantom_color'] = '#7F1919'
  93. $indiktab['bar_label'] = '#000000'
  94. $indiktab['phantom_label'] = '#FFFFFF'
  95. elseif indiktab['bar_progress'] >= 60:
  96. $indiktab['bar_color'] = '#ff4d4d'
  97. $indiktab['phantom_color'] = '#7F2727'
  98. $indiktab['bar_label'] = '#000000'
  99. $indiktab['phantom_label'] = '#FFFFFF'
  100. elseif indiktab['bar_progress'] >= 50:
  101. $indiktab['bar_color'] = '#ff6666'
  102. $indiktab['phantom_color'] = '#7F3333'
  103. $indiktab['bar_label'] = '#000000'
  104. $indiktab['phantom_label'] = '#FFFFFF'
  105. elseif indiktab['bar_progress'] >= 40:
  106. $indiktab['bar_color'] = '#ff8080'
  107. $indiktab['phantom_color'] = '#7F4141'
  108. $indiktab['bar_label'] = '#000000'
  109. $indiktab['phantom_label'] = '#FFFFFF'
  110. elseif indiktab['bar_progress'] >= 30:
  111. $indiktab['bar_color'] = '#e68080'
  112. $indiktab['phantom_color'] = '#724040'
  113. $indiktab['bar_label'] = '#000000'
  114. $indiktab['phantom_label'] = '#FFFFFF'
  115. elseif indiktab['bar_progress'] >= 20:
  116. $indiktab['bar_color'] = '#cc8080'
  117. $indiktab['phantom_color'] = '#664040'
  118. $indiktab['bar_label'] = '#000000'
  119. $indiktab['phantom_label'] = '#FFFFFF'
  120. elseif indiktab['bar_progress'] >= 10:
  121. $indiktab['bar_color'] = '#b38080'
  122. $indiktab['phantom_color'] = '#594040'
  123. $indiktab['bar_label'] = '#000000'
  124. $indiktab['phantom_label'] = '#FFFFFF'
  125. else
  126. $indiktab['bar_color'] = '#998080'
  127. $indiktab['phantom_color'] = '#4C4040'
  128. $indiktab['bar_label'] = '#000000'
  129. $indiktab['phantom_label'] = '#FFFFFF'
  130. end
  131. ! end
  132. elseif ARGS[0] = 3:
  133. if indiktab['bar_progress'] >= 20:
  134. $indiktab['bar_color'] = '#0000ff'
  135. $indiktab['phantom_color'] = '#00007F'
  136. $indiktab['bar_label'] = '#FFFFFF'
  137. $indiktab['phantom_label'] = '#FFFFFF'
  138. else
  139. $indiktab['bar_color'] = '#0000ff'
  140. $indiktab['phantom_color'] = '#00007F'
  141. $indiktab['bar_label'] = '#000000'
  142. $indiktab['phantom_label'] = '#FFFFFF'
  143. end
  144. end
  145. $result = '<TABLE cellpadding="1" cellspacing="0" width="200"><TR>'
  146. if indiktab['bar_progress'] >= ARGS[3]:
  147. ! if indiktab['bar_progress'] = 100: $indiktab['bar_bg_color'] = $indiktab['bar_color']
  148. if indiktab['bar_progress'] > indiktab['label_width']:
  149. $result += '<TD bgcolor="<<$indiktab[''bar_color'']>>" width="<<indiktab[''bar_progress'']>>%"' & !! bar
  150. $result += ' align="right"><font color ="<<$indiktab[''bar_label'']>>"><<$ARGS[2]>></font>&nbsp;</TD>' & !! label
  151. $result += '<TD width="<<100 - indiktab[''bar_progress'']>>%"></TD>' & !! background
  152. ! bgcolor="<<$indiktab[''bar_bg_color'']>>"
  153. else
  154. $result += '<TD bgcolor="<<$indiktab[''bar_color'']>>" width="<<indiktab[''bar_progress'']>>%"></TD>' & !! bar
  155. $result += '<TD width="<<100 - indiktab[''bar_progress'']>>%"' & !! background
  156. ! bgcolor="<<$indiktab[''bar_bg_color'']>>"
  157. $result += ' align="left">&nbsp;<<$ARGS[2]>></TD>' & !! label
  158. ! <font color ="<<$fcolor>>"></font>
  159. end
  160. else
  161. ! if indiktab['bar_progress'] + indiktab['bar_phantom'] = 100: $indiktab['bar_bg_color'] = $indiktab['phantom_color']
  162. if indiktab['bar_progress'] > indiktab['label_width']:
  163. $result += '<TD bgcolor="<<$indiktab[''bar_color'']>>" width="<<indiktab[''bar_progress'']>>%"' & !! bar
  164. $result += ' align="right"><font color ="<<$indiktab[''bar_label'']>>"><<$ARGS[2]>></font>&nbsp;</TD>' & !! label
  165. $result += '<TD bgcolor="<<$indiktab[''phantom_color'']>>" width="<<indiktab[''bar_phantom'']>>%"></TD>' & !! phantom
  166. $result += '<TD width="<<100 - indiktab[''bar_phantom''] - indiktab[''bar_progress'']>>%"></TD>' & !! background
  167. ! bgcolor="<<$indiktab[''bar_bg_color'']>>"
  168. elseif indiktab['bar_phantom'] > indiktab['label_width']:
  169. $result += '<TD bgcolor="<<$indiktab[''bar_color'']>>" width="<<indiktab[''bar_progress'']>>%"></TD>' & !! bar
  170. $result += '<TD bgcolor="<<$indiktab[''phantom_color'']>>" width="<<indiktab[''bar_phantom'']>>%"' & !! phantom
  171. $result += ' align="left">&nbsp;<font color ="<<$indiktab[''phantom_label'']>>"><<$ARGS[2]>></font></TD>' & !! label
  172. $result += '<TD width="<<100 - indiktab[''bar_phantom''] - indiktab[''bar_progress'']>>%"></TD>' & !! background
  173. ! bgcolor="<<$indiktab[''bar_bg_color'']>>"
  174. else
  175. $result += '<TD bgcolor="<<$indiktab[''bar_color'']>>" width="<<indiktab[''bar_progress'']>>%"></TD>' & !! bar
  176. $result += '<TD bgcolor="<<$indiktab[''phantom_color'']>>" width="<<indiktab[''bar_phantom'']>>%"></TD>' & !! phantom
  177. $result += '<TD width="<<100 - indiktab[''bar_progress'']>>%"' & !! background
  178. ! bgcolor="<<$indiktab[''bar_bg_color'']>>"
  179. $result += ' align="left">&nbsp;<<$ARGS[2]>></TD>' & !! label
  180. ! <font color ="<<$fcolor>>"></font>
  181. end
  182. end
  183. $result += '</TR></TABLE>'
  184. killvar 'indiktab'
  185. killvar '$indiktab'
  186. --- indiktab ---------------------------------