Difference between revisions of "TextInputDialog"
(removed language stuff) |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 11: | Line 11: | ||
=== Example === | === Example === | ||
− | < | + | <syntaxhighlight lang="lua"> |
local textInputDialog = TextInputDialog.new("my title", "my message", "some text", "Cancel", "OK") | local textInputDialog = TextInputDialog.new("my title", "my message", "some text", "Cancel", "OK") | ||
Line 20: | Line 20: | ||
textInputDialog:addEventListener(Event.COMPLETE, onComplete) | textInputDialog:addEventListener(Event.COMPLETE, onComplete) | ||
textInputDialog:show() | textInputDialog:show() | ||
− | </ | + | </syntaxhighlight> |
=== See also === | === See also === | ||
Line 29: | Line 29: | ||
=== Methods === | === Methods === | ||
[[TextInputDialog.new]] ''creates an input dialog''<br/><!--GIDEROSMTD:TextInputDialog.new(title,message,text,cancelButton,button1,button2) creates an input dialog--> | [[TextInputDialog.new]] ''creates an input dialog''<br/><!--GIDEROSMTD:TextInputDialog.new(title,message,text,cancelButton,button1,button2) creates an input dialog--> | ||
+ | |||
[[TextInputDialog:getInputType]] ''gets the input type''<br/><!--GIDEROSMTD:TextInputDialog:getInputType() gets the input type--> | [[TextInputDialog:getInputType]] ''gets the input type''<br/><!--GIDEROSMTD:TextInputDialog:getInputType() gets the input type--> | ||
[[TextInputDialog:getText]] ''retrieves the entered text''<br/><!--GIDEROSMTD:TextInputDialog:getText() retrieves the entered text--> | [[TextInputDialog:getText]] ''retrieves the entered text''<br/><!--GIDEROSMTD:TextInputDialog:getText() retrieves the entered text--> |
Latest revision as of 14:33, 13 July 2023
Supported platforms:
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 is dismissed and TextInputDialog_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.
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()
See also
MethodsTextInputDialog.new creates an input dialog TextInputDialog:getInputType gets the input type |
EventsTextInputDialog_Event.COMPLETE ConstantsTextInputDialog.EMAIL |