Difference between revisions of "AlertDialog"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Supported platforms</translate>:''' [[File:Platform android]][[File:Platform ios]][[File:Platform mac]][[File:Platform pc]]<br/>
+
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]]<br/>
 
'''<translate>Available since</translate>:''' Gideros 2012.8<br/>
 
'''<translate>Available since</translate>:''' Gideros 2012.8<br/>
 
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Object|Object]]<br/>
 
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Object|Object]]<br/>
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
 
<translate><br />
 
<translate><br />
The `AlertDialog` class is used to display native alert dialogs with one, two or three buttons. Cancel button<br />
+
The [[Special:MyLanguage/AlertDialog|AlertDialog]] class is used to display native alert dialogs with one, two or three buttons. Cancel button<br />
 
is mandatory but other two buttons are optional. When the user presses any button in the alert dialog,<br />
 
is mandatory but other two buttons are optional. When the user presses any button in the alert dialog,<br />
it&#039;s dismissed and `Event.COMPLETE` event is dispatched.<br />
+
it&#039;s dismissed and [[Special:MyLanguage/Event.COMPLETE|Event.COMPLETE]] event is dispatched.<br />
 
<br />
 
<br />
  

Revision as of 10:36, 24 August 2018

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.png
Available since: Gideros 2012.8
Inherits from: Object

Description


The AlertDialog class is used to display native alert dialogs with one, two or three buttons. Cancel button
is mandatory but other two buttons are optional. When the user presses any button in the alert dialog,
it's dismissed and Event.COMPLETE event is dispatched.

If alert dialog is dismissed by any other means (by pressing back button on Android or by pressing close button on desktop), it behaves as cancel button is pressed.

Examples

Example

local alertDialog = AlertDialog.new(&quot;This is my title&quot;, &quot;And my message&quot;, &quot;Cancel&quot;, &quot;Yes&quot;, &quot;No&quot;)

local function onComplete(event)
	print(event.buttonIndex, event.buttonText)
end

alertDialog:addEventListener(Event.COMPLETE, onComplete)
alertDialog:show()

Methods

AlertDialog.new
AlertDialog:hide
AlertDialog:show

Events

Event.COMPLETE

Constants