goo.textinput.html 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  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. <head>
  5. <title>Module goo.textinput</title>
  6. <link rel="stylesheet" href="../luadoc.css" type="text/css" />
  7. <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
  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. <div id="navigation">
  18. <h1>Goo</h1>
  19. <ul>
  20. <li><a href="../index.html">Index</a></li>
  21. </ul>
  22. <!-- Module list -->
  23. <h1>Modules</h1>
  24. <ul>
  25. <li>
  26. <a href="../modules/anim.html">anim</a>
  27. </li>
  28. <li>
  29. <a href="../modules/goo.html">goo</a>
  30. </li>
  31. <li>
  32. <a href="../modules/goo.button.html">goo.button</a>
  33. </li>
  34. <li>
  35. <a href="../modules/goo.checkbox.html">goo.checkbox</a>
  36. </li>
  37. <li>
  38. <a href="../modules/goo.colorpick.html">goo.colorpick</a>
  39. </li>
  40. <li>
  41. <a href="../modules/goo.image.html">goo.image</a>
  42. </li>
  43. <li>
  44. <a href="../modules/goo.null.html">goo.null</a>
  45. </li>
  46. <li>
  47. <a href="../modules/goo.object.html">goo.object</a>
  48. </li>
  49. <li>
  50. <a href="../modules/goo.panel.html">goo.panel</a>
  51. </li>
  52. <li>
  53. <a href="../modules/goo.progressbar.html">goo.progressbar</a>
  54. </li>
  55. <li>
  56. <a href="../modules/goo.text.html">goo.text</a>
  57. </li>
  58. <li><strong>goo.textinput</strong></li>
  59. </ul>
  60. <!-- File list -->
  61. </div><!-- id="navigation" -->
  62. <div id="content">
  63. <h1>Module <code>goo.textinput</code></h1>
  64. <p>A box you can input text to. Supports all characters, lowercase and uppercase. Multiline text and caret movement.</p>
  65. <h2>Functions</h2>
  66. <table class="function_list">
  67. <tr>
  68. <td class="name" nowrap><a href="#goo.textinput:getCaretPos">goo.textinput:getCaretPos</a>&nbsp;()</td>
  69. <td class="summary">Get the position of the caret on the current line.</td>
  70. </tr>
  71. <tr>
  72. <td class="name" nowrap><a href="#goo.textinput:getLinePos">goo.textinput:getLinePos</a>&nbsp;()</td>
  73. <td class="summary">Get the line number the caret is on.</td>
  74. </tr>
  75. <tr>
  76. <td class="name" nowrap><a href="#goo.textinput:getMultiline">goo.textinput:getMultiline</a>&nbsp;()</td>
  77. <td class="summary">Get's if the textinput is in multiline mode </td>
  78. </tr>
  79. <tr>
  80. <td class="name" nowrap><a href="#goo.textinput:getText">goo.textinput:getText</a>&nbsp;()</td>
  81. <td class="summary">Get the text inside the textinput.</td>
  82. </tr>
  83. <tr>
  84. <td class="name" nowrap><a href="#goo.textinput:insert">goo.textinput:insert</a>&nbsp;(text, pos)</td>
  85. <td class="summary">Insert text on the current line at the specified position.</td>
  86. </tr>
  87. <tr>
  88. <td class="name" nowrap><a href="#goo.textinput:newline">goo.textinput:newline</a>&nbsp;(line_pos)</td>
  89. <td class="summary">Create a new line </td>
  90. </tr>
  91. <tr>
  92. <td class="name" nowrap><a href="#goo.textinput:onKeyReturn">goo.textinput:onKeyReturn</a>&nbsp;()</td>
  93. <td class="summary">Callback function called when the return key is pressed </td>
  94. </tr>
  95. <tr>
  96. <td class="name" nowrap><a href="#goo.textinput:onKeypressed">goo.textinput:onKeypressed</a>&nbsp;(key, unicode)</td>
  97. <td class="summary">Callback function when the key is pressed.</td>
  98. </tr>
  99. <tr>
  100. <td class="name" nowrap><a href="#goo.textinput:remove">goo.textinput:remove</a>&nbsp;(pos, length)</td>
  101. <td class="summary">Remove text on the current line at the specified position.</td>
  102. </tr>
  103. <tr>
  104. <td class="name" nowrap><a href="#goo.textinput:removeline">goo.textinput:removeline</a>&nbsp;(line_pos)</td>
  105. <td class="summary">Removes a line of text.</td>
  106. </tr>
  107. <tr>
  108. <td class="name" nowrap><a href="#goo.textinput:setCaretPos">goo.textinput:setCaretPos</a>&nbsp;(caretpos)</td>
  109. <td class="summary">Set the position of the caret on the current line </td>
  110. </tr>
  111. <tr>
  112. <td class="name" nowrap><a href="#goo.textinput:setLinePos">goo.textinput:setLinePos</a>&nbsp;(linepos)</td>
  113. <td class="summary">Sets the line position of the caret </td>
  114. </tr>
  115. <tr>
  116. <td class="name" nowrap><a href="#goo.textinput:setMultiline">goo.textinput:setMultiline</a>&nbsp;(multiline)</td>
  117. <td class="summary">Set the text input's multiline mode.</td>
  118. </tr>
  119. <tr>
  120. <td class="name" nowrap><a href="#goo.textinput:setText">goo.textinput:setText</a>&nbsp;(text)</td>
  121. <td class="summary">Sets the text of the box, new lines ignored if not multiline.</td>
  122. </tr>
  123. </table>
  124. <br/>
  125. <br/>
  126. <h2><a name="functions"></a>Functions</h2>
  127. <dl class="function">
  128. <dt><a name="goo.textinput:getCaretPos"></a><span>goo.textinput:</span><strong>getCaretPos</strong>&nbsp;( )</dt>
  129. <dd>
  130. <p class="func_description">Get the position of the caret on the current line. <br/>The position is relative to the line it's on.</p>
  131. <h3>Return value:</h3>
  132. <p class="func_return">number: the position of the caret, 1 is first character.</p>
  133. <h3>See also:</h3>
  134. <ul>
  135. <li><a href="">
  136. goo.textinput:getLinePos
  137. </a>
  138. <li><a href="">
  139. goo.textinput:setCaretPos
  140. </a>
  141. </ul>
  142. </dd>
  143. <dt><a name="goo.textinput:getLinePos"></a><span>goo.textinput:</span><strong>getLinePos</strong>&nbsp;( )</dt>
  144. <dd>
  145. <p class="func_description">Get the line number the caret is on.</p>
  146. <h3>Return value:</h3>
  147. <p class="func_return">number: the line the caret is on, 1 is first line.</p>
  148. <h3>See also:</h3>
  149. <ul>
  150. <li><a href="">
  151. goo.textinput:setLinePos
  152. </a>
  153. <li><a href="">
  154. goo.textinput:getCaretPos
  155. </a>
  156. </ul>
  157. </dd>
  158. <dt><a name="goo.textinput:getMultiline"></a><span>goo.textinput:</span><strong>getMultiline</strong>&nbsp;( )</dt>
  159. <dd>
  160. <p class="func_description">Get's if the textinput is in multiline mode</p>
  161. </dd>
  162. <dt><a name="goo.textinput:getText"></a><span>goo.textinput:</span><strong>getText</strong>&nbsp;( )</dt>
  163. <dd>
  164. <p class="func_description">Get the text inside the textinput.</p>
  165. <h3>Return value:</h3>
  166. <p class="func_return">string: the text.</p>
  167. </dd>
  168. <dt><a name="goo.textinput:insert"></a><span>goo.textinput:</span><strong>insert</strong>&nbsp;( text, pos )</dt>
  169. <dd>
  170. <p class="func_description">Insert text on the current line at the specified position.</p>
  171. <h3>Parameters</h3>
  172. <ul>
  173. <li>
  174. <b>text</b> <i><small>:string</small></i><br/>the text to insert.
  175. </li>
  176. <li>
  177. <b>pos</b> <i><small>:number</small></i><br/>the position to insert it at.
  178. </li>
  179. </ul>
  180. </dd>
  181. <dt><a name="goo.textinput:newline"></a><span>goo.textinput:</span><strong>newline</strong>&nbsp;( line_pos )</dt>
  182. <dd>
  183. <p class="func_description">Create a new line</p>
  184. <h3>Parameters</h3>
  185. <ul>
  186. <li>
  187. <b>line_pos</b> <i><small>:number</small></i><br/>the line number to add the newline after.
  188. </li>
  189. </ul>
  190. </dd>
  191. <dt><a name="goo.textinput:onKeyReturn"></a><span>goo.textinput:</span><strong>onKeyReturn</strong>&nbsp;( )</dt>
  192. <dd>
  193. <p class="func_description">Callback function called when the return key is pressed</p>
  194. </dd>
  195. <dt><a name="goo.textinput:onKeypressed"></a><span>goo.textinput:</span><strong>onKeypressed</strong>&nbsp;( key, unicode )</dt>
  196. <dd>
  197. <p class="func_description">Callback function when the key is pressed. <br/>this will not override the functionality of the text input, <br/>if you wish to override keypresses use goo.textinput:keypressed() instead.</p>
  198. <h3>Parameters</h3>
  199. <ul>
  200. <li>
  201. <b>key</b> <i><small>:string</small></i><br/>the keyConstant of the key pressed.
  202. </li>
  203. <li>
  204. <b>unicode</b> <i><small>:number</small></i><br/>the unicode value of the key pressed.
  205. </li>
  206. </ul>
  207. </dd>
  208. <dt><a name="goo.textinput:remove"></a><span>goo.textinput:</span><strong>remove</strong>&nbsp;( pos, length )</dt>
  209. <dd>
  210. <p class="func_description">Remove text on the current line at the specified position.</p>
  211. <h3>Parameters</h3>
  212. <ul>
  213. <li>
  214. <b>pos</b> <i><small>:number</small></i><br/>the position to start removing.
  215. </li>
  216. <li>
  217. <b>length</b> <i><small>:number</small></i><br/>the number of character after pos to remove.
  218. </li>
  219. </ul>
  220. </dd>
  221. <dt><a name="goo.textinput:removeline"></a><span>goo.textinput:</span><strong>removeline</strong>&nbsp;( line_pos )</dt>
  222. <dd>
  223. <p class="func_description">Removes a line of text.</p>
  224. <h3>Parameters</h3>
  225. <ul>
  226. <li>
  227. <b>line_pos</b> <i><small>:number</small></i><br/>thr line number to remove.
  228. </li>
  229. </ul>
  230. </dd>
  231. <dt><a name="goo.textinput:setCaretPos"></a><span>goo.textinput:</span><strong>setCaretPos</strong>&nbsp;( caretpos )</dt>
  232. <dd>
  233. <p class="func_description">Set the position of the caret on the current line</p>
  234. <h3>Parameters</h3>
  235. <ul>
  236. <li>
  237. <b>caretpos</b> <i><small>:number</small></i><br/>the position of the caret, 1 is first character
  238. </li>
  239. </ul>
  240. <h3>See also:</h3>
  241. <ul>
  242. <li><a href="">
  243. goo.textinput:setCaretPos
  244. </a>
  245. </ul>
  246. </dd>
  247. <dt><a name="goo.textinput:setLinePos"></a><span>goo.textinput:</span><strong>setLinePos</strong>&nbsp;( linepos )</dt>
  248. <dd>
  249. <p class="func_description">Sets the line position of the caret</p>
  250. </dd>
  251. <dt><a name="goo.textinput:setMultiline"></a><span>goo.textinput:</span><strong>setMultiline</strong>&nbsp;( multiline )</dt>
  252. <dd>
  253. <p class="func_description">Set the text input's multiline mode.</p>
  254. <h3>Parameters</h3>
  255. <ul>
  256. <li>
  257. <b>multiline</b> <i><small>:bool</small></i><br/>true to allow multiple lines, false to not.
  258. </li>
  259. </ul>
  260. </dd>
  261. <dt><a name="goo.textinput:setText"></a><span>goo.textinput:</span><strong>setText</strong>&nbsp;( text )</dt>
  262. <dd>
  263. <p class="func_description">Sets the text of the box, new lines ignored if not multiline.</p>
  264. <h3>See also:</h3>
  265. <ul>
  266. <li><a href="">
  267. goo.textinput:setMultiline
  268. </a>
  269. </ul>
  270. </dd>
  271. </dl>
  272. </div> <!-- id="content" -->
  273. </div> <!-- id="main" -->
  274. <div id="about">
  275. <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
  276. </div> <!-- id="about" -->
  277. </div> <!-- id="container" -->
  278. </body>
  279. </html>