Option menu btn cancel a closefield?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trevix
Posts: 1102
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Option menu btn cancel a closefield?

Post by trevix »

The lookAndFeel is set to "Appearance Manager".

I have a field with

Code: Select all

on closeField
put true into sHasChanged
end closeField
and an Option menu btn.

If I change the field content and then try to change the option menu, the "closeField" is not triggered. It only triggers if I put a "Focus on nothing" in the beginning of the menupick.

Is this how it should be? (does not make sense to me)

Regards
Trevix
Trevix
OSX 15.7 xCode 26.01 LC 10.0.3 RC1 iOS 15> Android 7>
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Option menu btn cancel a closefield?

Post by dunbarx »

So this is interesting. Know that "exitField" is the message of choice when you leave a field without changing its content, whereas "closeField" only fires when you do.

But in both cases, leaving a field and going immediately to an option menu does not trigger either. In fact, the field messages are on hold until after you fool around with the option menu. So you can place both handlers in the field script, and if you click on the card you will get a message whether you change the text or not. But if you click on the option menu, and then the card, the appropriate message is only sent at the card click.

I am not sure if this is intended behavior or not.

One way around it is to place a "mouseLeave" handler in the field.

Craig Newman
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Option menu btn cancel a closefield?

Post by bogs »

dunbarx wrote: Wed Feb 28, 2018 11:19 pm One way around it is to place a "mouseLeave" handler in the field.
Except that, if your like me, you generally move the mouse out of the field right after clicking in it, which might throw mushi on your plans.
Image
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Option menu btn cancel a closefield?

Post by dunbarx »

Bogs.

Yep. You might just get two messages. Set a custom property for each message, clearing them all if you click anywhere?

"Mushi"?

Craig
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Option menu btn cancel a closefield?

Post by bogs »

Thats as good as anything I came up with :)
dunbarx wrote: Thu Mar 01, 2018 12:34 am"Mushi"?
Well, not knowing how old you might be, it is a reference to a line muttered by Jack Soo during an episode of Barney Miller (an old tv series).

Someone brought brownies into the precinct laced with hashish, Soo's character got stoned (as almost all the detectives in the room did), and at one point said "Mushi mushi". Probably you would have had to see it to get the joke, but I still remember it all these decades later.
Image
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Option menu btn cancel a closefield?

Post by Klaus »

If the option menu button has its "traversalon" property set, this should work right out of the box!
Just made a little test on my Mac and it worked as exspected.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Option menu btn cancel a closefield?

Post by Klaus »

bogs wrote: Thu Mar 01, 2018 2:53 am
dunbarx wrote: Thu Mar 01, 2018 12:34 am"Mushi"?
Well, not knowing how old you might be, ...
Question should be: where are you from?
Not every shitty american TV-series is running outside ot the US of A! 8)
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Option menu btn cancel a closefield?

Post by dunbarx »

Crappy US television aside, setting the traversalOn does indeed work as Klaus mentioned.

It is not clear that this property exists for option menus, though, and does not appear in the inspector. It never occurred to me, but makes sense...

Craig
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Option menu btn cancel a closefield?

Post by Klaus »

This is in the inspector in version 8.x and 9.x!
trevix
Posts: 1102
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Re: Option menu btn cancel a closefield?

Post by trevix »

Doesn't seem in LC8.2
Trevix
OSX 15.7 xCode 26.01 LC 10.0.3 RC1 iOS 15> Android 7>
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Option menu btn cancel a closefield?

Post by Klaus »

I see this in LC 8.1.9 and LC 9 DP 11, never touched 8.2x so far...
But if this is not in the inspector, use the message box to set this property!
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Option menu btn cancel a closefield?

Post by bogs »

Klaus wrote: Thu Mar 01, 2018 5:48 pm
bogs wrote: Thu Mar 01, 2018 2:53 am
dunbarx wrote: Thu Mar 01, 2018 12:34 am"Mushi"?
Well, not knowing how old you might be, ...
Question should be: where are you from?
Not every shitty american TV-series is running outside ot the US of A! 8)
Huh, from all I read, that is all they show over there, the crud they produce over here, so I wouldn't have expected you to see this show, which actually had some merit value during its production run :P

Topics that were presented (through humor) all the way back then are *still* in the headlines of today. Repeatedly. It is almost like watching the future, with a chuckle.
... although Craig likes to stay on the quieter side of the spectrum, so that his location is harder to pin down, I tend to believe he actually was on this side of the pond as it were (don't ask me why, I don't think I ever tried to confirm it or not). If I am wrong, my apologies my friend :wink:
Image
Post Reply