Difference between revisions of "AlertDialog"

From GiderosMobile
(----)
(template)
Line 47: Line 47:
 
|}
 
|}
  
----
+
{{AlertDialog}}
 
 
{{Special:PrefixIndex/AlertDialog}}
 

Revision as of 23:38, 2 December 2019


Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.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

local alertDialog = AlertDialog.new("This is my title", "And my message", "Cancel", "Yes", "No")
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