<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.gideros.rocks/index.php?action=history&amp;feed=atom&amp;title=UI.Button</id>
	<title>UI.Button - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.gideros.rocks/index.php?action=history&amp;feed=atom&amp;title=UI.Button"/>
	<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=UI.Button&amp;action=history"/>
	<updated>2026-11-17T14:19:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=UI.Button&amp;diff=22727&amp;oldid=prev</id>
		<title>MoKaLux at 06:17, 17 October 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=UI.Button&amp;diff=22727&amp;oldid=prev"/>
		<updated>2023-10-17T06:17:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 06:17, 17 October 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l105&quot;&gt;Line 105:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 105:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;GIDEROS IMPORTANT LINKS&lt;/del&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;UI&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=UI.Button&amp;diff=22666&amp;oldid=prev</id>
		<title>MoKaLux: Created page with &quot;__NOTOC__ &#039;&#039;&#039;Available since:&#039;&#039;&#039; Gideros 2023.1&lt;br/&gt; &#039;&#039;&#039;Class:&#039;&#039;&#039; UI&lt;br/&gt;  === Description === Creates Button widgets. The widget can be a &#039;&#039;&#039;Button&#039;&#039;&#039;, a &#039;&#039;&#039;ToggleButton&#039;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=UI.Button&amp;diff=22666&amp;oldid=prev"/>
		<updated>2023-10-14T15:43:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ &amp;#039;&amp;#039;&amp;#039;Available since:&amp;#039;&amp;#039;&amp;#039; Gideros 2023.1&amp;lt;br/&amp;gt; &amp;#039;&amp;#039;&amp;#039;Class:&amp;#039;&amp;#039;&amp;#039; &lt;a href=&quot;/index.php/UI&quot; title=&quot;UI&quot;&gt;UI&lt;/a&gt;&amp;lt;br/&amp;gt;  === Description === Creates Button widgets. The widget can be a &amp;#039;&amp;#039;&amp;#039;Button&amp;#039;&amp;#039;&amp;#039;, a &amp;#039;&amp;#039;&amp;#039;ToggleButton&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Available since:&amp;#039;&amp;#039;&amp;#039; Gideros 2023.1&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Class:&amp;#039;&amp;#039;&amp;#039; [[UI]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
Creates Button widgets. The widget can be a &amp;#039;&amp;#039;&amp;#039;Button&amp;#039;&amp;#039;&amp;#039;, a &amp;#039;&amp;#039;&amp;#039;ToggleButton&amp;#039;&amp;#039;&amp;#039; or a &amp;#039;&amp;#039;&amp;#039;PopupButton&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
UI.Button.new(params)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Available parameters are:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Repeat&amp;#039;&amp;#039;&amp;#039; (number) the repeat speed&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RepeatSpeedup&amp;#039;&amp;#039;&amp;#039; (number) speedup factor (&amp;lt;1 to increase actual speed)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NoDoubleClick&amp;#039;&amp;#039;&amp;#039; (boolean) disables double clicking ability (faster response)&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;params&amp;#039;&amp;#039;&amp;#039;: (table) the Button widget parameters&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A Button&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
UI.Style:setDefault(UI.Theme.PointCore_Pink)&lt;br /&gt;
&lt;br /&gt;
local gui=UI.Button.new()&lt;br /&gt;
gui:setDimensions(96, 48)&lt;br /&gt;
gui:setPosition(50,50)&lt;br /&gt;
gui:setText(&amp;quot;button&amp;quot;)&lt;br /&gt;
gui.name = &amp;quot;btn1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function gui:onWidgetAction(w)&lt;br /&gt;
	print(&amp;quot;Hello, &amp;quot;..w.name)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
stage:addChild(gui)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Two buttons, introducing the events system&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
UI.Style:setDefault(UI.Theme.PointCore_Pink)&lt;br /&gt;
&lt;br /&gt;
local buttonA=UI.Button.new()&lt;br /&gt;
buttonA:setDimensions(64, 48)&lt;br /&gt;
buttonA:setPosition(150,50)&lt;br /&gt;
buttonA:setText(&amp;quot;btn1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local buttonB=UI.Button.new()&lt;br /&gt;
buttonB:setDimensions(64, 48)&lt;br /&gt;
buttonB:setPosition(150,150)&lt;br /&gt;
buttonB:setText(&amp;quot;btn2&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
stage:addChild(buttonA)&lt;br /&gt;
stage:addChild(buttonB)&lt;br /&gt;
&lt;br /&gt;
--Here we put the WidgetAction listener on stage. &lt;br /&gt;
--It will be propagated from each button up to stage through the sprite tree&lt;br /&gt;
--First parameter of event listeners are always the source widget of the event&lt;br /&gt;
function stage:onWidgetAction(w)&lt;br /&gt;
	if w==buttonA then&lt;br /&gt;
		print(&amp;quot;b1&amp;quot;)&lt;br /&gt;
	elseif w==buttonB then&lt;br /&gt;
		print(&amp;quot;b2&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A button with repeat on&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
UI.Style:setDefault(UI.Theme.PointCore_Pink)&lt;br /&gt;
&lt;br /&gt;
local gui=UI.Button.new({ Repeat=0.5, RepeatSpeedup=0.9, NoDoubleClick=true, })&lt;br /&gt;
gui:setDimensions(64, 48)&lt;br /&gt;
gui:setPosition(128, 128)&lt;br /&gt;
gui:setText(&amp;quot;btn&amp;quot;)&lt;br /&gt;
gui.name = &amp;quot;button&amp;quot;&lt;br /&gt;
&lt;br /&gt;
stage:addChild(gui)&lt;br /&gt;
&lt;br /&gt;
function gui:onWidgetAction(w)&lt;br /&gt;
	print(w.name, &amp;quot;clicked&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A button with a long click indicator&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
UI.Style:setDefault(UI.Theme.PointCore_Pink)&lt;br /&gt;
&lt;br /&gt;
local gui=UI.Button.new()&lt;br /&gt;
gui:setDimensions(64, 48)&lt;br /&gt;
gui:setPosition(128, 128)&lt;br /&gt;
gui:setText(&amp;quot;btn&amp;quot;)&lt;br /&gt;
gui.name = &amp;quot;button&amp;quot;&lt;br /&gt;
&lt;br /&gt;
UI.Behavior.LongClick.new(gui,{ clsIndicator=UI.CircularProgress, szIndicator=24 })&lt;br /&gt;
&lt;br /&gt;
function gui:onWidgetAction(w)&lt;br /&gt;
	print(w.name, &amp;quot;clicked&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function gui:onWidgetLongAction(w)&lt;br /&gt;
	print(w.name, &amp;quot;long clicked!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local screen=UI.Screen.new() -- needed to add the long click indicator&lt;br /&gt;
screen:ui(gui)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{GIDEROS IMPORTANT LINKS}}&lt;/div&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
</feed>