value_text_box.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <head>
  6. <title>Reference</title>
  7. <link rel="stylesheet" href="../ldoc.css" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <!-- Menu -->
  18. <div id="navigation">
  19. <br/>
  20. <h1>ldoc</h1>
  21. <ul>
  22. <li><a href="../index.html">Index</a></li>
  23. </ul>
  24. <h2>Contents</h2>
  25. <ul>
  26. <li><a href="#Functions">Functions</a></li>
  27. </ul>
  28. <h2>Modules</h2>
  29. <ul>
  30. <li><a href="../modules/blingbling.clock.html">blingbling.clock</a></li>
  31. <li><a href="../modules/blingbling.helpers.html">blingbling.helpers</a></li>
  32. <li><a href="../modules/blingbling.linegraph.html">blingbling.linegraph</a></li>
  33. <li><a href="../modules/blingbling.popups.html">blingbling.popups</a></li>
  34. <li><a href="../modules/blingbling.progress_graph.html">blingbling.progress_graph</a></li>
  35. <li><a href="../modules/blingbling.system.html">blingbling.system</a></li>
  36. <li><a href="../modules/blingbling.tagslist.html">blingbling.tagslist</a></li>
  37. <li><a href="../modules/blingbling.task_warrior.html">blingbling.task_warrior</a></li>
  38. <li><a href="../modules/blingbling.text_box.html">blingbling.text_box</a></li>
  39. <li><a href="../modules/blingbling.triangular_progress_graph.html">blingbling.triangular_progress_graph</a></li>
  40. <li><a href="../modules/blingbling.udisks_glue.html">blingbling.udisks_glue</a></li>
  41. <li><a href="../modules/blingbling.volume.html">blingbling.volume</a></li>
  42. <li><a href="../modules/blingbling.widget.html">blingbling.widget</a></li>
  43. <li><a href="../modules/blingbling.wlourf_circle_graph.html">blingbling.wlourf_circle_graph</a></li>
  44. <li><a href="../modules/config_example.japanese2.theme.html">config_example.japanese2.theme</a></li>
  45. <li><a href="../modules/superproperties.html">superproperties</a></li>
  46. <li><strong>value_text_box</strong></li>
  47. </ul>
  48. </div>
  49. <div id="content">
  50. <h1>Module <code>value_text_box</code></h1>
  51. <p>A text box that can display value and text with colors.</p>
  52. <p>
  53. blingbling.value_text_box</p>
  54. <h2><a href="#Functions">Functions</a></h2>
  55. <table class="function_list">
  56. <tr>
  57. <td class="name" nowrap><a href="#set_background_color">set_background_color&nbsp;(color)</a></td>
  58. <td class="summary">Fill all the widget with this color (default is transparent).</td>
  59. </tr>
  60. <tr>
  61. <td class="name" nowrap><a href="#set_text_background_color">set_text_background_color&nbsp;(color)</a></td>
  62. <td class="summary">Fill the text area (text height/width + padding) background with this color (default is none).</td>
  63. </tr>
  64. <tr>
  65. <td class="name" nowrap><a href="#set_text_background_border">set_text_background_border&nbsp;(color)</a></td>
  66. <td class="summary">Set a border on the text area background (default is none ).</td>
  67. </tr>
  68. <tr>
  69. <td class="name" nowrap><a href="#set_v_margin">set_v_margin&nbsp;(margin)</a></td>
  70. <td class="summary">Define the top and bottom margin for the text background.</td>
  71. </tr>
  72. <tr>
  73. <td class="name" nowrap><a href="#set_h_margin">set_h_margin&nbsp;(margin)</a></td>
  74. <td class="summary">Define the left and right margin for the text background.</td>
  75. </tr>
  76. <tr>
  77. <td class="name" nowrap><a href="#set_h_margin">set_h_margin&nbsp;(padding)</a></td>
  78. <td class="summary">Define the padding between the text and it's background.</td>
  79. </tr>
  80. <tr>
  81. <td class="name" nowrap><a href="#set_rounded_size">set_rounded_size&nbsp;(rounded_size)</a></td>
  82. <td class="summary">Set rounded corners for background and text background.</td>
  83. </tr>
  84. <tr>
  85. <td class="name" nowrap><a href="#set_text_color">set_text_color&nbsp;(color)</a></td>
  86. <td class="summary">Define the color for all the text of the widget (white by default).</td>
  87. </tr>
  88. <tr>
  89. <td class="name" nowrap><a href="#set_values_text_color">set_values_text_color&nbsp;(table)</a></td>
  90. <td class="summary">Define the value text color depending on the limit given ( if value >= limit, we apply the color).</td>
  91. </tr>
  92. <tr>
  93. <td class="name" nowrap><a href="#set_font_size">set_font_size&nbsp;(size)</a></td>
  94. <td class="summary">Define the text font size.</td>
  95. </tr>
  96. <tr>
  97. <td class="name" nowrap><a href="#set_label">set_label&nbsp;(text)</a></td>
  98. <td class="summary">Define the template of the text to display.</td>
  99. </tr>
  100. <tr>
  101. <td class="name" nowrap><a href="#value_text_box:set_height">value_text_box:set_height&nbsp;(height)</a></td>
  102. <td class="summary">Set the vt_box height.</td>
  103. </tr>
  104. <tr>
  105. <td class="name" nowrap><a href="#value_text_box:set_width">value_text_box:set_width&nbsp;(width)</a></td>
  106. <td class="summary">Set the vt_box width.</td>
  107. </tr>
  108. <tr>
  109. <td class="name" nowrap><a href="#new">new&nbsp;(args)</a></td>
  110. <td class="summary">Create a vt_box widget.</td>
  111. </tr>
  112. </table>
  113. <br/>
  114. <br/>
  115. <h2><a name="Functions"></a>Functions</h2>
  116. <dl class="function">
  117. <dt>
  118. <a name = "set_background_color"></a>
  119. <strong>set_background_color&nbsp;(color)</strong>
  120. </dt>
  121. <dd>
  122. Fill all the widget with this color (default is transparent).
  123. <h3>Parameters:</h3>
  124. <ul>
  125. <li><span class="parameter">color</span>
  126. a string "#rrggbbaa" or "#rrggbb"</li>
  127. </ul>
  128. <h3>Usage:</h3>
  129. <ul>
  130. <pre class="example">myvt_box:set_background_color(<span class="global">string</span>) --&gt;<span class="string">"#rrggbbaa"</span></pre>
  131. </ul>
  132. </dd>
  133. <dt>
  134. <a name = "set_text_background_color"></a>
  135. <strong>set_text_background_color&nbsp;(color)</strong>
  136. </dt>
  137. <dd>
  138. Fill the text area (text height/width + padding) background with this color (default is none).
  139. <h3>Parameters:</h3>
  140. <ul>
  141. <li><span class="parameter">color</span>
  142. a string "#rrggbbaa" or "#rrggbb"</li>
  143. </ul>
  144. <h3>Usage:</h3>
  145. <ul>
  146. <pre class="example">myvt_box:set_text_background_color(<span class="global">string</span>) --&gt;<span class="string">"#rrggbbaa"</span></pre>
  147. </ul>
  148. </dd>
  149. <dt>
  150. <a name = "set_text_background_border"></a>
  151. <strong>set_text_background_border&nbsp;(color)</strong>
  152. </dt>
  153. <dd>
  154. Set a border on the text area background (default is none ).
  155. <h3>Parameters:</h3>
  156. <ul>
  157. <li><span class="parameter">color</span>
  158. a string "#rrggbbaa" or "#rrggbb"</li>
  159. </ul>
  160. <h3>Usage:</h3>
  161. <ul>
  162. <pre class="example">myvt_box:set_text_background_border(<span class="global">string</span>) --&gt;<span class="string">"#rrggbbaa"</span></pre>
  163. </ul>
  164. </dd>
  165. <dt>
  166. <a name = "set_v_margin"></a>
  167. <strong>set_v_margin&nbsp;(margin)</strong>
  168. </dt>
  169. <dd>
  170. Define the top and bottom margin for the text background.
  171. <h3>Parameters:</h3>
  172. <ul>
  173. <li><span class="parameter">margin</span>
  174. an integer for top and bottom margin</li>
  175. </ul>
  176. <h3>Usage:</h3>
  177. <ul>
  178. <pre class="example">myvt_box:set_v_margin(integer)</pre>
  179. </ul>
  180. </dd>
  181. <dt>
  182. <a name = "set_h_margin"></a>
  183. <strong>set_h_margin&nbsp;(margin)</strong>
  184. </dt>
  185. <dd>
  186. Define the left and right margin for the text background.
  187. <h3>Parameters:</h3>
  188. <ul>
  189. <li><span class="parameter">margin</span>
  190. an integer for left and right margin</li>
  191. </ul>
  192. <h3>Usage:</h3>
  193. <ul>
  194. <pre class="example">myvt_box:set_h_margin(integer)</pre>
  195. </ul>
  196. </dd>
  197. <dt>
  198. <a name = "set_h_margin"></a>
  199. <strong>set_h_margin&nbsp;(padding)</strong>
  200. </dt>
  201. <dd>
  202. Define the padding between the text and it's background.
  203. <h3>Parameters:</h3>
  204. <ul>
  205. <li><span class="parameter">padding</span>
  206. an integer for the text padding</li>
  207. </ul>
  208. <h3>Usage:</h3>
  209. <ul>
  210. <pre class="example">myvt_box:set_padding(integer)</pre>
  211. </ul>
  212. </dd>
  213. <dt>
  214. <a name = "set_rounded_size"></a>
  215. <strong>set_rounded_size&nbsp;(rounded_size)</strong>
  216. </dt>
  217. <dd>
  218. Set rounded corners for background and text background.
  219. <h3>Parameters:</h3>
  220. <ul>
  221. <li><span class="parameter">rounded_size</span>
  222. float in [0,1]</li>
  223. </ul>
  224. <h3>Usage:</h3>
  225. <ul>
  226. <pre class="example">myvt_box:set_rounded_size(a) -&gt; a <span class="keyword">in</span> [<span class="number">0</span>,<span class="number">1</span>]</pre>
  227. </ul>
  228. </dd>
  229. <dt>
  230. <a name = "set_text_color"></a>
  231. <strong>set_text_color&nbsp;(color)</strong>
  232. </dt>
  233. <dd>
  234. Define the color for all the text of the widget (white by default).
  235. <h3>Parameters:</h3>
  236. <ul>
  237. <li><span class="parameter">color</span>
  238. a string "#rrggbbaa" or "#rrggbb</li>
  239. </ul>
  240. <h3>Usage:</h3>
  241. <ul>
  242. <pre class="example">myvt_box:set_text_color(<span class="global">string</span>) --&gt;<span class="string">"#rrggbbaa"</span></pre>
  243. </ul>
  244. </dd>
  245. <dt>
  246. <a name = "set_values_text_color"></a>
  247. <strong>set_values_text_color&nbsp;(table)</strong>
  248. </dt>
  249. <dd>
  250. Define the value text color depending on the limit given ( if value >= limit, we apply the color).
  251. <h3>Parameters:</h3>
  252. <ul>
  253. <li><span class="parameter">table</span>
  254. table like { {"#rrggbbaa", limit 1}, {"#rrggbbaa", limit 2}}</li>
  255. </ul>
  256. <h3>Usage:</h3>
  257. <ul>
  258. <pre class="example">myvt_box:set_values_text_color(<span class="global">table</span>) <span class="comment">--&gt;{ {"#rrggbbaa", limit 1}, {"#rrggbbaa", limit 2}}
  259. </span> By default the color is text_color(another example: {{<span class="string">"#88aa00ff"</span>,<span class="number">0</span>},{<span class="string">"#d4aa00ff"</span>, <span class="number">0.5</span>},{<span class="string">"#d45500ff"</span>,<span class="number">0.75</span>}})</pre>
  260. </ul>
  261. </dd>
  262. <dt>
  263. <a name = "set_font_size"></a>
  264. <strong>set_font_size&nbsp;(size)</strong>
  265. </dt>
  266. <dd>
  267. Define the text font size.
  268. <h3>Parameters:</h3>
  269. <ul>
  270. <li><span class="parameter">size</span>
  271. the font size</li>
  272. </ul>
  273. <h3>Usage:</h3>
  274. <ul>
  275. <pre class="example">myvt_box:set_font_size(integer)</pre>
  276. </ul>
  277. </dd>
  278. <dt>
  279. <a name = "set_label"></a>
  280. <strong>set_label&nbsp;(text)</strong>
  281. </dt>
  282. <dd>
  283. Define the template of the text to display.
  284. <h3>Parameters:</h3>
  285. <ul>
  286. <li><span class="parameter">text</span>
  287. the text to display</li>
  288. </ul>
  289. <h3>Usage:</h3>
  290. <ul>
  291. <pre class="example"> myvt_box:set_label(<span class="global">string</span>)
  292. By default the text is : (value_send_to_the_widget *<span class="number">100</span>)
  293. static <span class="global">string</span>: example set_label(<span class="string">"CPU usage:"</span>) will display <span class="string">"CUP usage:"</span> on the vt_box
  294. dynamic <span class="global">string</span>: use $percent <span class="keyword">in</span> the <span class="global">string</span> example set_label(<span class="string">"Load $percent %"</span>) will display <span class="string">"Load 10%"</span> </pre>
  295. </ul>
  296. </dd>
  297. <dt>
  298. <a name = "value_text_box:set_height"></a>
  299. <strong>value_text_box:set_height&nbsp;(height)</strong>
  300. </dt>
  301. <dd>
  302. Set the vt_box height.
  303. <h3>Parameters:</h3>
  304. <ul>
  305. <li><span class="parameter">height</span>
  306. The height to set.</li>
  307. </ul>
  308. </dd>
  309. <dt>
  310. <a name = "value_text_box:set_width"></a>
  311. <strong>value_text_box:set_width&nbsp;(width)</strong>
  312. </dt>
  313. <dd>
  314. Set the vt_box width.
  315. <h3>Parameters:</h3>
  316. <ul>
  317. <li><span class="parameter">width</span>
  318. The width to set.</li>
  319. </ul>
  320. </dd>
  321. <dt>
  322. <a name = "new"></a>
  323. <strong>new&nbsp;(args)</strong>
  324. </dt>
  325. <dd>
  326. Create a vt_box widget.
  327. <h3>Parameters:</h3>
  328. <ul>
  329. <li><span class="parameter">args</span>
  330. Standard widget() arguments. You can add width and height keys to set vt_box geometry.</li>
  331. </ul>
  332. <h3>Returns:</h3>
  333. <ol>
  334. A vt_box widget.
  335. </ol>
  336. </dd>
  337. </dl>
  338. </div> <!-- id="content" -->
  339. </div> <!-- id="main" -->
  340. <div id="about">
  341. <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.3.12</a></i>
  342. </div> <!-- id="about" -->
  343. </div> <!-- id="container" -->
  344. </body>
  345. </html>