Difference between revisions of "TextInputDialog"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | '''Supported platforms:''' android | + | '''<translate>Supported platforms</translate>:''' [[File:Platform android]][[File:Platform ios]][[File:Platform mac]][[File:Platform pc]]<br/> |
− | '''Available since:''' Gideros 2012.8<br/> | + | '''<translate>Available since</translate>:''' Gideros 2012.8<br/> |
+ | '''<translate>Inherits from</translate>:''' [[Special:MyLanguage/AlertDialog|AlertDialog]]<br/> | ||
=== <translate>Description</translate> === | === <translate>Description</translate> === | ||
<translate><br /> | <translate><br /> | ||
− | The | + | The `TextInputDialog` class is used to display native text input dialogs with one text edit field, one button (as cancel button) and two optional buttons. When the user presses any buttons in the alert dialog, it's dismissed and `Event.COMPLETE` event is dispatched.<br /> |
If text input 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.<br /></translate> | If text input 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.<br /></translate> | ||
=== <translate>Examples</translate> === | === <translate>Examples</translate> === |
Revision as of 09:29, 24 August 2018
Supported platforms: File:Platform androidFile:Platform iosFile:Platform macFile:Platform pc
Available since: Gideros 2012.8
Inherits from: AlertDialog
Description
The `TextInputDialog` class is used to display native text input dialogs with one text edit field, one button (as cancel button) and two optional buttons. When the user presses any buttons in the alert dialog, it's dismissed and `Event.COMPLETE` event is dispatched.
If text input 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 textInputDialog = TextInputDialog.new("my title", "my message", "some text", "Cancel", "OK")
local function onComplete(event)
print(event.text, event.buttonIndex, event.buttonText)
end
textInputDialog:addEventListener(Event.COMPLETE, onComplete)
textInputDialog:show()