control.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <!-- This file is generated by Nim. -->
  5. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <!-- Favicon -->
  10. <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
  11. <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
  12. <!-- Google fonts -->
  13. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  14. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  15. <!-- CSS -->
  16. <title>nodesnim/nodescontrol/control</title>
  17. <link rel="stylesheet" type="text/css" href="../../nimdoc.out.css">
  18. <script type="text/javascript" src="dochack.js"></script>
  19. <script type="text/javascript">
  20. function main() {
  21. var pragmaDots = document.getElementsByClassName("pragmadots");
  22. for (var i = 0; i < pragmaDots.length; i++) {
  23. pragmaDots[i].onclick = function(event) {
  24. // Hide tease
  25. event.target.parentNode.style.display = "none";
  26. // Show actual
  27. event.target.parentNode.nextElementSibling.style.display = "inline";
  28. }
  29. }
  30. const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
  31. function switchTheme(e) {
  32. if (e.target.checked) {
  33. document.documentElement.setAttribute('data-theme', 'dark');
  34. localStorage.setItem('theme', 'dark');
  35. } else {
  36. document.documentElement.setAttribute('data-theme', 'light');
  37. localStorage.setItem('theme', 'light');
  38. }
  39. }
  40. toggleSwitch.addEventListener('change', switchTheme, false);
  41. if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
  42. document.documentElement.setAttribute('data-theme', "dark");
  43. toggleSwitch.checked = true;
  44. } else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
  45. document.documentElement.setAttribute('data-theme', "light");
  46. toggleSwitch.checked = false;
  47. } else {
  48. const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
  49. if (currentTheme) {
  50. document.documentElement.setAttribute('data-theme', currentTheme);
  51. if (currentTheme === 'dark') {
  52. toggleSwitch.checked = true;
  53. }
  54. }
  55. }
  56. }
  57. </script>
  58. </head>
  59. <body onload="main()">
  60. <div class="document" id="documentId">
  61. <div class="container">
  62. <h1 class="title">nodesnim/nodescontrol/control</h1>
  63. <div class="row">
  64. <div class="three columns">
  65. <div class="theme-switch-wrapper">
  66. <label class="theme-switch" for="checkbox">
  67. <input type="checkbox" id="checkbox" />
  68. <div class="slider round"></div>
  69. </label>
  70. &nbsp;&nbsp;&nbsp; <em>Dark Mode</em>
  71. </div>
  72. <div id="global-links">
  73. <ul class="simple">
  74. </ul>
  75. </div>
  76. <div id="searchInputDiv">
  77. Search: <input type="text" id="searchInput"
  78. onkeyup="search()" />
  79. </div>
  80. <div>
  81. Group by:
  82. <select onchange="groupBy(this.value)">
  83. <option value="section">Section</option>
  84. <option value="type">Type</option>
  85. </select>
  86. </div>
  87. <ul class="simple simple-toc" id="toc-list">
  88. <li>
  89. <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
  90. <ul class="simple simple-toc-section">
  91. </ul>
  92. </li>
  93. <li>
  94. <a class="reference reference-toplevel" href="#7" id="57">Types</a>
  95. <ul class="simple simple-toc-section">
  96. <li><a class="reference" href="#ControlObj"
  97. title="ControlObj = object of CanvasObj
  98. hovered*: bool
  99. pressed*: bool
  100. focused*: bool
  101. mousemode*: MouseMode
  102. background_color*: ColorRef
  103. on_mouse_enter*: proc (self: ControlRef; x, y: float): void ## This called when the mouse enters the Control node.
  104. on_mouse_exit*: proc (self: ControlRef; x, y: float): void ## This called when the mouse exit from the Control node.
  105. on_click*: proc (self: ControlRef; x, y: float): void ## This called when the user clicks on the Control node.
  106. on_press*: proc (self: ControlRef; x, y: float): void ## This called when the user holds on the mouse on the Control node.
  107. on_release*: proc (self: ControlRef; x, y: float): void ## This called when the user no more holds on the mouse.
  108. on_focus*: proc (self: ControlRef): void ## This called when the Control node gets focus.
  109. on_unfocus*: proc (self: ControlRef): void ## This called when the Control node loses focus."><wbr />Control<wbr />Obj<span class="attachedType"></span></a></li>
  110. <li><a class="reference" href="#ControlRef"
  111. title="ControlRef = ref ControlObj"><wbr />Control<wbr />Ref<span class="attachedType"></span></a></li>
  112. </ul>
  113. </li>
  114. <li>
  115. <a class="reference reference-toplevel" href="#12" id="62">Procs</a>
  116. <ul class="simple simple-toc-section">
  117. <li><a class="reference" href="#Control%2Cstring"
  118. title="Control(name: string = &quot;Control&quot;): ControlRef"><wbr />Control<span class="attachedType">ControlRef</span></a></li>
  119. </ul>
  120. </li>
  121. <li>
  122. <a class="reference reference-toplevel" href="#14" id="64">Methods</a>
  123. <ul class="simple simple-toc-section">
  124. <li><a class="reference" href="#calcPositionAnchor.e%2CControlRef"
  125. title="calcPositionAnchor(self: ControlRef)"><wbr />calc<wbr />Position<wbr />Anchor<span class="attachedType">ControlRef</span></a></li>
  126. <li><a class="reference" href="#draw.e%2CControlRef%2CGLfloat%2CGLfloat"
  127. title="draw(self: ControlRef; w, h: GLfloat)"><wbr />draw<span class="attachedType">ControlRef</span></a></li>
  128. <li><a class="reference" href="#duplicate.e%2CControlRef"
  129. title="duplicate(self: ControlRef): ControlRef"><wbr />duplicate<span class="attachedType">ControlRef</span></a></li>
  130. <li><a class="reference" href="#getGlobalMousePosition.e%2CControlRef"
  131. title="getGlobalMousePosition(self: ControlRef): Vector2Ref"><wbr />get<wbr />Global<wbr />Mouse<wbr />Position<span class="attachedType">ControlRef</span></a></li>
  132. <li><a class="reference" href="#handle.e%2CControlRef%2CInputEvent%2CNodeRef"
  133. title="handle(self: ControlRef; event: InputEvent; mouse_on: var NodeRef)"><wbr />handle<span class="attachedType">ControlRef</span></a></li>
  134. <li><a class="reference" href="#setBackgroundColor.e%2CControlRef%2CColorRef"
  135. title="setBackgroundColor(self: ControlRef; color: ColorRef)"><wbr />set<wbr />Background<wbr />Color<span class="attachedType">ControlRef</span></a></li>
  136. </ul>
  137. </li>
  138. <li>
  139. <a class="reference reference-toplevel" href="#18" id="68">Templates</a>
  140. <ul class="simple simple-toc-section">
  141. <li><a class="reference" href="#controlpattern.t"
  142. title="controlpattern(): untyped"><wbr />controlpattern<span class="attachedType"></span></a></li>
  143. </ul>
  144. </li>
  145. </ul>
  146. </div>
  147. <div class="nine columns" id="content">
  148. <div id="tocRoot"></div>
  149. <p class="module-desc">The base of other Control nodes.</p>
  150. <div class="section" id="6">
  151. <h1><a class="toc-backref" href="#6">Imports</a></h1>
  152. <dl class="item">
  153. <a class="reference external" href="../thirdparty/opengl.html">../thirdparty/opengl</a>, <a class="reference external" href="../core/vector2.html">../core/vector2</a>, <a class="reference external" href="../core/rect2.html">../core/rect2</a>, <a class="reference external" href="../core/anchor.html">../core/anchor</a>, <a class="reference external" href="../core/input.html">../core/input</a>, <a class="reference external" href="../core/enums.html">../core/enums</a>, <a class="reference external" href="../core/color.html">../core/color</a>, <a class="reference external" href="../nodes/node.html">../nodes/node</a>, <a class="reference external" href="../nodes/canvas.html">../nodes/canvas</a>
  154. </dl></div>
  155. <div class="section" id="7">
  156. <h1><a class="toc-backref" href="#7">Types</a></h1>
  157. <dl class="item">
  158. <a id="ControlObj"></a>
  159. <dt><pre><a href="control.html#ControlObj"><span class="Identifier">ControlObj</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="../nodes/canvas.html#CanvasObj"><span class="Identifier">CanvasObj</span></a>
  160. <span class="Identifier">hovered</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
  161. <span class="Identifier">pressed</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
  162. <span class="Identifier">focused</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
  163. <span class="Identifier">mousemode</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/enums.html#MouseMode"><span class="Identifier">MouseMode</span></a>
  164. <span class="Identifier">background_color</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/color.html#ColorRef"><span class="Identifier">ColorRef</span></a>
  165. <span class="Identifier">on_mouse_enter</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">;</span> <span class="Identifier">x</span><span class="Other">,</span> <span class="Identifier">y</span><span class="Other">:</span> <span class="Identifier">float</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">void</span> <span class="Comment">## This called when the mouse enters the Control node.</span>
  166. <span class="Identifier">on_mouse_exit</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">;</span> <span class="Identifier">x</span><span class="Other">,</span> <span class="Identifier">y</span><span class="Other">:</span> <span class="Identifier">float</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">void</span> <span class="Comment">## This called when the mouse exit from the Control node.</span>
  167. <span class="Identifier">on_click</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">;</span> <span class="Identifier">x</span><span class="Other">,</span> <span class="Identifier">y</span><span class="Other">:</span> <span class="Identifier">float</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">void</span> <span class="Comment">## This called when the user clicks on the Control node.</span>
  168. <span class="Identifier">on_press</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">;</span> <span class="Identifier">x</span><span class="Other">,</span> <span class="Identifier">y</span><span class="Other">:</span> <span class="Identifier">float</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">void</span> <span class="Comment">## This called when the user holds on the mouse on the Control node.</span>
  169. <span class="Identifier">on_release</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">;</span> <span class="Identifier">x</span><span class="Other">,</span> <span class="Identifier">y</span><span class="Other">:</span> <span class="Identifier">float</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">void</span> <span class="Comment">## This called when the user no more holds on the mouse.</span>
  170. <span class="Identifier">on_focus</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">void</span> <span class="Comment">## This called when the Control node gets focus.</span>
  171. <span class="Identifier">on_unfocus</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">void</span> <span class="Comment">## This called when the Control node loses focus.</span>
  172. </pre></dt>
  173. <dd>
  174. </dd>
  175. <a id="ControlRef"></a>
  176. <dt><pre><a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <a href="control.html#ControlObj"><span class="Identifier">ControlObj</span></a></pre></dt>
  177. <dd>
  178. </dd>
  179. </dl></div>
  180. <div class="section" id="12">
  181. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  182. <dl class="item">
  183. <a id="Control,string"></a>
  184. <dt><pre><span class="Keyword">proc</span> <a href="#Control%2Cstring"><span class="Identifier">Control</span></a><span class="Other">(</span><span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Other">=</span> <span class="StringLit">&quot;Control&quot;</span><span class="Other">)</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  185. <dd>
  186. <p>Creates a new Control.</p>
  187. <p>Arguments:</p>
  188. <ul class="simple"><li><tt class="docutils literal"><span class="pre">name</span></tt> is a node name.</li>
  189. </ul>
  190. <p><strong class="examples_text">Examples:</strong></p>
  191. <pre class="listing"><span class="Keyword">var</span> <span class="Identifier">ctrl</span> <span class="Other">=</span> <span class="Identifier">Control</span><span class="Other">(</span><span class="StringLit">&quot;Control&quot;</span><span class="Other">)</span></pre>
  192. </dd>
  193. </dl></div>
  194. <div class="section" id="14">
  195. <h1><a class="toc-backref" href="#14">Methods</a></h1>
  196. <dl class="item">
  197. <a id="calcPositionAnchor.e,ControlRef"></a>
  198. <dt><pre><span class="Keyword">method</span> <a href="#calcPositionAnchor.e%2CControlRef"><span class="Identifier">calcPositionAnchor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  199. <dd>
  200. Calculates node position. This uses in the <tt class="docutils literal"><span class="pre">scene.nim</span></tt>.
  201. </dd>
  202. <a id="draw.e,ControlRef,GLfloat,GLfloat"></a>
  203. <dt><pre><span class="Keyword">method</span> <a href="#draw.e%2CControlRef%2CGLfloat%2CGLfloat"><span class="Identifier">draw</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">;</span> <span class="Identifier">w</span><span class="Other">,</span> <span class="Identifier">h</span><span class="Other">:</span> <a href="../thirdparty/opengl.html#GLfloat"><span class="Identifier">GLfloat</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">GLerror</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
  204. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  205. <dd>
  206. this method uses in the <tt class="docutils literal"><span class="pre">window.nim</span></tt>.
  207. </dd>
  208. <a id="duplicate.e,ControlRef"></a>
  209. <dt><pre><span class="Keyword">method</span> <a href="#duplicate.e%2CControlRef"><span class="Identifier">duplicate</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  210. <dd>
  211. Duplicates Control object and create a new Control.
  212. </dd>
  213. <a id="getGlobalMousePosition.e,ControlRef"></a>
  214. <dt><pre><span class="Keyword">method</span> <a href="#getGlobalMousePosition.e%2CControlRef"><span class="Identifier">getGlobalMousePosition</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="../core/vector2.html#Vector2Ref"><span class="Identifier">Vector2Ref</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span>
  215. <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  216. <dd>
  217. Returns mouse position.
  218. </dd>
  219. <a id="handle.e,ControlRef,InputEvent,NodeRef"></a>
  220. <dt><pre><span class="Keyword">method</span> <a href="#handle.e%2CControlRef%2CInputEvent%2CNodeRef"><span class="Identifier">handle</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">;</span> <span class="Identifier">event</span><span class="Other">:</span> <a href="../core/input.html#InputEvent"><span class="Identifier">InputEvent</span></a><span class="Other">;</span> <span class="Identifier">mouse_on</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="../nodes/node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma">
  221. <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  222. <dd>
  223. Handles user input. This uses in the <tt class="docutils literal"><span class="pre">window.nim</span></tt>.
  224. </dd>
  225. <a id="setBackgroundColor.e,ControlRef,ColorRef"></a>
  226. <dt><pre><span class="Keyword">method</span> <a href="#setBackgroundColor.e%2CControlRef%2CColorRef"><span class="Identifier">setBackgroundColor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="control.html#ControlRef"><span class="Identifier">ControlRef</span></a><span class="Other">;</span> <span class="Identifier">color</span><span class="Other">:</span> <a href="../core/color.html#ColorRef"><span class="Identifier">ColorRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  227. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  228. <dd>
  229. Changes Control background color.
  230. </dd>
  231. </dl></div>
  232. <div class="section" id="18">
  233. <h1><a class="toc-backref" href="#18">Templates</a></h1>
  234. <dl class="item">
  235. <a id="controlpattern.t"></a>
  236. <dt><pre><span class="Keyword">template</span> <a href="#controlpattern.t"><span class="Identifier">controlpattern</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
  237. <dd>
  238. </dd>
  239. </dl></div>
  240. </div>
  241. </div>
  242. <div class="row">
  243. <div class="twelve-columns footer">
  244. <span class="nim-sprite"></span>
  245. <br/>
  246. <small style="color: var(--hint);">Made with Nim. Generated: 2020-06-07 17:06:35 UTC</small>
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. </body>
  252. </html>