Difference between revisions of "TextInputDialog"
(removed language stuff) |
|||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | |||
<!-- GIDEROSOBJ:TextInputDialog --> | <!-- GIDEROSOBJ:TextInputDialog --> | ||
− | + | '''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> | |
− | ''' | + | '''Available since:''' Gideros 2012.8<br/> |
− | ''' | + | '''Inherits from:''' [[AlertDialog]]<br/> |
− | ''' | ||
=== Description === | === 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 [[ | + | 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. | 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. | ||
Line 23: | Line 21: | ||
textInputDialog:show() | textInputDialog:show() | ||
</source> | </source> | ||
+ | |||
+ | === See also === | ||
+ | '''[[AlertDialog]]''' | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === | + | === Methods === |
− | [[ | + | [[TextInputDialog.new]] ''creates an input dialog''<br/><!--GIDEROSMTD:TextInputDialog.new(title,message,text,cancelButton,button1,button2) creates an input dialog--> |
− | <!-- GIDEROSMTD:TextInputDialog.new(title,message,text,cancelButton,button1,button2) | + | [[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--> |
− | <!-- GIDEROSMTD:TextInputDialog:getInputType() | + | [[TextInputDialog:isSecureInput]] ''checks if this dialog is secure (password)''<br/><!--GIDEROSMTD:TextInputDialog:isSecureInput() checks if this dialog is secure (password)--> |
− | [[ | + | [[TextInputDialog:setInputType]] ''specifies the type of input''<br/><!--GIDEROSMTD:TextInputDialog:setInputType(type) specifies the type of input--> |
− | <!-- GIDEROSMTD:TextInputDialog:getText() | + | [[TextInputDialog:setSecureInput]] ''instructs the dialog to secure the input''<br/><!--GIDEROSMTD:TextInputDialog:setSecureInput(secureInput) instructs the dialog to secure the input--> |
− | [[ | + | [[TextInputDialog:setText]] ''sets the input text''<br/><!--GIDEROSMTD:TextInputDialog:setText(text) sets the input text--> |
− | <!-- GIDEROSMTD:TextInputDialog:isSecureInput() | ||
− | [[ | ||
− | <!-- GIDEROSMTD:TextInputDialog:setInputType(type) | ||
− | [[ | ||
− | <!-- GIDEROSMTD:TextInputDialog:setSecureInput(secureInput) | ||
− | [[ | ||
− | <!-- GIDEROSMTD:TextInputDialog:setText(text) | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === | + | === Events === |
− | <!--[[ | + | <!--[[Event.COMPLETE]]<br/>--> |
− | [[ | + | [[TextInputDialog_Event.COMPLETE]]<br/><!--GIDEROSEVT:Event.COMPLETE complete--> |
− | <!-- GIDEROSEVT:Event.COMPLETE complete--> | + | === Constants === |
− | === | + | [[TextInputDialog.EMAIL]]<br/><!--GIDEROSCST:TextInputDialog.EMAIL email--> |
− | [[ | + | [[TextInputDialog.NUMBER]]<br/><!--GIDEROSCST:TextInputDialog.NUMBER number--> |
− | <!-- GIDEROSCST:TextInputDialog.EMAIL email--> | + | [[TextInputDialog.PHONE]]<br/><!--GIDEROSCST:TextInputDialog.PHONE phone--> |
− | [[ | + | [[TextInputDialog.TEXT]]<br/><!--GIDEROSCST:TextInputDialog.TEXT text--> |
− | <!-- GIDEROSCST:TextInputDialog.NUMBER number--> | + | [[TextInputDialog.URL]]<br/><!--GIDEROSCST:TextInputDialog.URL url--> |
− | [[ | ||
− | <!-- GIDEROSCST:TextInputDialog.PHONE phone--> | ||
− | [[ | ||
− | <!-- GIDEROSCST:TextInputDialog.TEXT text--> | ||
− | [[ | ||
− | <!-- GIDEROSCST:TextInputDialog.URL url--> | ||
|} | |} | ||
{{GIDEROS IMPORTANT LINKS}} | {{GIDEROS IMPORTANT LINKS}} |
Revision as of 11:35, 8 September 2021
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 |
EventsTextInputDialog_Event.COMPLETE ConstantsTextInputDialog.EMAIL |