Difference between revisions of "TextInputDialog"
From GiderosMobile
(15 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | '''Supported platforms:''' android | + | <languages /> |
− | '''Available since:''' Gideros 2012.8<br/> | + | <!-- GIDEROSOBJ:TextInputDialog --> |
− | === | + | '''<translate>Supported platforms</translate>:''' [[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/> |
− | <translate>< | + | '''<translate>Available since</translate>:''' Gideros 2012.8<br/> |
− | 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 | + | '''<translate>Inherits from</translate>:''' [[Special:MyLanguage/AlertDialog|AlertDialog]]<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.< | + | |
− | === | + | === <translate>Description</translate> === |
− | + | The [[Special:MyLanguage/TextInputDialog|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 [[Special:MyLanguage/Event.COMPLETE|Event.COMPLETE]] event is dispatched. | |
− | <source lang="lua">local textInputDialog = TextInputDialog.new( | + | |
+ | 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. | ||
+ | |||
+ | === <translate>Examples</translate> === | ||
+ | <source lang="lua"> | ||
+ | local textInputDialog = TextInputDialog.new("my title", "my message", "some text", "Cancel", "OK") | ||
local function onComplete(event) | local function onComplete(event) | ||
Line 15: | Line 20: | ||
textInputDialog:addEventListener(Event.COMPLETE, onComplete) | textInputDialog:addEventListener(Event.COMPLETE, onComplete) | ||
− | textInputDialog:show()</source> | + | textInputDialog:show() |
+ | </source> | ||
+ | |||
{|- | {|- | ||
− | | style="width: 50%;"| | + | | style="width: 50%; vertical-align:top;"| |
− | === Methods === | + | === <translate>Methods</translate> === |
− | [[TextInputDialog.new]] | + | [[Special:MyLanguage/TextInputDialog.new|TextInputDialog.new]] <br/> |
− | [[TextInputDialog:getInputType]] | + | <!-- GIDEROSMTD:TextInputDialog.new(title,message,text,cancelButton,button1,button2) --> |
− | [[TextInputDialog:getText]] | + | [[Special:MyLanguage/TextInputDialog:getInputType|TextInputDialog:getInputType]] <br/> |
− | [[TextInputDialog:isSecureInput]] | + | <!-- GIDEROSMTD:TextInputDialog:getInputType() --> |
− | [[TextInputDialog:setInputType]] | + | [[Special:MyLanguage/TextInputDialog:getText|TextInputDialog:getText]] <br/> |
− | [[TextInputDialog:setSecureInput]] | + | <!-- GIDEROSMTD:TextInputDialog:getText() --> |
− | [[TextInputDialog:setText]] | + | [[Special:MyLanguage/TextInputDialog:isSecureInput|TextInputDialog:isSecureInput]] <br/> |
− | | style="width: 50%;"| | + | <!-- GIDEROSMTD:TextInputDialog:isSecureInput() --> |
− | === Events === | + | [[Special:MyLanguage/TextInputDialog:setInputType|TextInputDialog:setInputType]] <br/> |
− | [[Event.COMPLETE]]<br/> | + | <!-- GIDEROSMTD:TextInputDialog:setInputType(type) --> |
− | === Constants === | + | [[Special:MyLanguage/TextInputDialog:setSecureInput|TextInputDialog:setSecureInput]] <br/> |
− | [[TextInputDialog.EMAIL]]<br/> | + | <!-- GIDEROSMTD:TextInputDialog:setSecureInput(secureInput) --> |
− | [[TextInputDialog.NUMBER]]<br/> | + | [[Special:MyLanguage/TextInputDialog:setText|TextInputDialog:setText]] <br/> |
− | [[TextInputDialog.PHONE]]<br/> | + | <!-- GIDEROSMTD:TextInputDialog:setText(text) --> |
− | [[TextInputDialog.TEXT]]<br/> | + | |
− | [[TextInputDialog.URL]]<br/> | + | | style="width: 50%; vertical-align:top;"| |
+ | === <translate>Events</translate> === | ||
+ | <!--[[Special:MyLanguage/Event.COMPLETE|Event.COMPLETE]]<br/>--> | ||
+ | [[Special:MyLanguage/TextInputDialog_Event.COMPLETE|TextInputDialog_Event.COMPLETE]]<br/> | ||
+ | <!-- GIDEROSEVT:Event.COMPLETE complete--> | ||
+ | === <translate>Constants</translate> === | ||
+ | [[Special:MyLanguage/TextInputDialog.EMAIL|TextInputDialog.EMAIL]]<br/> | ||
+ | <!-- GIDEROSCST:TextInputDialog.EMAIL email--> | ||
+ | [[Special:MyLanguage/TextInputDialog.NUMBER|TextInputDialog.NUMBER]]<br/> | ||
+ | <!-- GIDEROSCST:TextInputDialog.NUMBER number--> | ||
+ | [[Special:MyLanguage/TextInputDialog.PHONE|TextInputDialog.PHONE]]<br/> | ||
+ | <!-- GIDEROSCST:TextInputDialog.PHONE phone--> | ||
+ | [[Special:MyLanguage/TextInputDialog.TEXT|TextInputDialog.TEXT]]<br/> | ||
+ | <!-- GIDEROSCST:TextInputDialog.TEXT text--> | ||
+ | [[Special:MyLanguage/TextInputDialog.URL|TextInputDialog.URL]]<br/> | ||
+ | <!-- GIDEROSCST:TextInputDialog.URL url--> | ||
|} | |} | ||
+ | |||
+ | {{GIDEROS IMPORTANT LINKS}} |
Revision as of 20:45, 11 February 2020
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 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
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()