I have card with number of buttons labels and fields. One of the fields is for selection of fonts (fld "fonts"). When clicking or tapping on it fonts are selected and the field gets hidden. I'd like to make it possible to hide that field with click/tap outside of it.
I grouped all the objects (except the font field) on that card (grp "settingsGroup") and put the code below on the group level
Code: Select all
on mouseUp
put the effective rect of fld "fonts" into tHideFonts
if the mouseH < item 1 of tHideFonts or the mouseH > item 3 of tHideFonts \
or the mouseV < item 2 of tHideFonts or the mouseV > item 4 of tHideFonts then hide fld "fonts"
end mouseUp
Code: Select all
on mouseUp
send mouseUp to grp "settingsGroup"
end mouseUp
I could put the same code in each button on the card, but would prefer to make it with least coding, preferably on one place.
How to make it?
keram