This is android.
I have been using regular text fields that on mouseDown, if the text field is not empty, it enables a button to submit the text. No problem.
But ... I really like the native mobileControlCreate "input" widget. Mostly because of text correct, predictive text, and the ability to move the cursor with the spacebar (apparently you can do that now on android). So, how would I enable a button when text is entered into native input widget? How do I get the widget's text into a field? I sup
For instance, could I script to enable the button when the user hits the native "Done" button on the native android keyboard?
mobileControlCreate "input" - Setting the text to a field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: mobileControlCreate "input" - Setting the text to a field
You can use
set up a global var
In the script of the widget put
then gMyText will be available as long as global var is declared in the script of the control where it is being used
or in the button
set up a global var
In the script of the widget put
Code: Select all
global gMyText
Code: Select all
on textChanged
put the text of me into gMyText
end textChanged
or in the button
Code: Select all
get the text of widget "myWidget"
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
Re: mobileControlCreate "input" - Setting the text to a field
Hi JereMiami
If you are using text entry controls created with you might find the message useful.
This message is sent when the content of a mobile text input control has changed. You can check the text and enable or disable your button based on whether it is empty or not.
I hope that helps.
Kind regards
Elanor
If you are using text entry controls created with
Code: Select all
mobileControlCreate
Code: Select all
inputTextChanged
This message is sent when the content of a mobile text input control has changed. You can check the text and enable or disable your button based on whether it is empty or not.
I hope that helps.
Kind regards
Elanor
Last edited by elanorb on Thu Jan 14, 2021 4:26 pm, edited 1 time in total.
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode