How do you add a MouseUp to an iOS control?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How do you add a MouseUp to an iOS control?
Can anyone provide some insight on how you add a mouseup event to an iOS text field when the text field is created dynamically at runtime? I want to add a DatePick to an IOS text field but can't figure out how to do it. I've searched the forums but didn't find a solution. Any help would be appreciated. Thanks!
LiveCode 5.5.3 -- OS X 10.8.2
Re: How do you add a MouseUp to an iOS control?
Can't you set the script of an object? Eg:
Code: Select all
set the script of field "field1" to "on mouseup" & return & "answer the long date" & return & "end mouseup"
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: How do you add a MouseUp to an iOS control?
Hi donryan,
You can communicate with native mobile controls only via their special accessors.
There are four messages which may help you.
inputBeginEditing, inputEndEditing, inputTextChanged, inputReturnKey
You should use them with mobileControlTarget() function.
Check the attached stack for a simple implementation. Hope it helps
Best,
~ Ender Nafi
You can communicate with native mobile controls only via their special accessors.
There are four messages which may help you.
inputBeginEditing, inputEndEditing, inputTextChanged, inputReturnKey
You should use them with mobileControlTarget() function.
Check the attached stack for a simple implementation. Hope it helps

Best,
~ Ender Nafi
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
Re: How do you add a MouseUp to an iOS control?
Oh right. My assumption was that the field would be locked and the OP wanted it to respond to a touch event e.g.. a mouse up.
Gerry
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: How do you add a MouseUp to an iOS control?
Hi Ender,
Nice stack again. Useful and clear.
I played with it without mistake
Best
Jean-Marc
Nice stack again. Useful and clear.
I played with it without mistake
Best
Jean-Marc
https://alternatic.ch
Re: How do you add a MouseUp to an iOS control?
Hi Jean-Marc,
Thanks, it's your kindness...
Gerry,
Yours was a very intuitive solution but of course it's only viable for native LiveCode objects.
Mobile controls are very different, unfortunately, it causes too much fuss.
Best,
~ Ender Nafi
Thanks, it's your kindness...
Gerry,
Yours was a very intuitive solution but of course it's only viable for native LiveCode objects.
Mobile controls are very different, unfortunately, it causes too much fuss.
Best,
~ Ender Nafi
~... together, we're smarter ...~
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
__________________________________________
macOS Sierra • LiveCode 7 & xCode 8
Re: How do you add a MouseUp to an iOS control?
Ender:endernafi wrote:Hi donryan,
You can communicate with native mobile controls only via their special accessors.
There are four messages which may help you.
inputBeginEditing, inputEndEditing, inputTextChanged, inputReturnKey
You should use them with mobileControlTarget() function.
Check the attached stack for a simple implementation. Hope it helps![]()
Best,
~ Ender Nafi
Thank you very much -- the editBeginEditing took care of what I was looking for. Here's an example for anyone else interested:
Code: Select all
on inputBeginEditing
if the environment is "mobile" then
put iPhoneControlTarget() into tTarget
## DatePicker code goes here ...
if tTarget is "txtTransactionDate" or tTarget is "txtDueDate" then
focus on nothing --> hides the keyboard
mobilePickDate "date" --> loads datePicker with the current date
end if
end if
end inputBeginEditing
LiveCode 5.5.3 -- OS X 10.8.2
Re: How do you add a MouseUp to an iOS control?
...but based on an incorrect reading of the original questionendernafi wrote: Yours was a very intuitive solution

g
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.