Make group invisible after loosing focus - Solved
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Make group invisible after loosing focus - Solved
I have been struggling with this for a long time.
I have tried using "FocusOut" and numerous other work-arounds, but I have not found any that work with a group.
I am wanting my math calculator to become invisible, when a different object is touched in my mobile app.
Any help will be appreciated.
Thanks,
David
I have tried using "FocusOut" and numerous other work-arounds, but I have not found any that work with a group.
I am wanting my math calculator to become invisible, when a different object is touched in my mobile app.
Any help will be appreciated.
Thanks,
David
Last edited by DR White on Sat Oct 13, 2018 10:03 pm, edited 1 time in total.
Re: Make group invisible after loosing focus
I am sure this cat can be skinned in many ways, but a top of the head thought (not tested, typed on my phone)
You know what to put in the "hideTheGroup" handler
Code: Select all
on mouseMove
if the mouseLoc is not within the rect of group "groupToHide" then
--either hide it directly or
send "hideTheGroup" to <the correct target> in 2 seconds
end mouseMove
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Make group invisible after loosing focus
Another way would be to use a mouseDown handler in the card script. On mouseDown, check the target and if the long name doesn't include the name of the calculator group, hide the group. Using mouseDown will still allow all existing mouseUp handlers to work and you wouldn't need to track the mouse position. If you already have mouseDown handlers in any control, you'd need to pass the message.
There are probably other ways to do this too.
There are probably other ways to do this too.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Make group invisible after loosing focus
I used :
on mouseDown pButtonNumber
set the vis of grp "Calculator" of card "CircuitHome" to false
end mouseDown
I thought that there was something about "focus" of the group that I could used,
but the above worked fine. I will just have to add some "pass" commands to some controls.
Thanks,
David
on mouseDown pButtonNumber
set the vis of grp "Calculator" of card "CircuitHome" to false
end mouseDown
I thought that there was something about "focus" of the group that I could used,
but the above worked fine. I will just have to add some "pass" commands to some controls.
Thanks,
David
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Make group invisible after loosing focus - Solved
I thought the focus commands worked that way too but the dictionary refers to keyboard access only.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Make group invisible after loosing focus - Solved
If the calculator group has clickable buttons you'll probably need to put a blocking, empty mouseDown handler in the group too, since the card script handler doesn't check that.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com