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: 958
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Option menu btn cancel a closefield?

Post by trevix » Wed Feb 28, 2018 8:01 pm

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 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Option menu btn cancel a closefield?

Post by dunbarx » Wed Feb 28, 2018 11:19 pm

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Option menu btn cancel a closefield?

Post by bogs » Wed Feb 28, 2018 11:35 pm

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: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Option menu btn cancel a closefield?

Post by dunbarx » Thu Mar 01, 2018 12:34 am

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Option menu btn cancel a closefield?

Post by bogs » Thu Mar 01, 2018 2:53 am

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: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Option menu btn cancel a closefield?

Post by Klaus » Thu Mar 01, 2018 5:44 pm

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: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Option menu btn cancel a closefield?

Post by Klaus » 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)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Option menu btn cancel a closefield?

Post by dunbarx » Thu Mar 01, 2018 6:30 pm

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: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Option menu btn cancel a closefield?

Post by Klaus » Thu Mar 01, 2018 6:35 pm

This is in the inspector in version 8.x and 9.x!

trevix
Posts: 958
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Option menu btn cancel a closefield?

Post by trevix » Thu Mar 01, 2018 6:39 pm

Doesn't seem in LC8.2
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Option menu btn cancel a closefield?

Post by Klaus » Thu Mar 01, 2018 6:43 pm

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Option menu btn cancel a closefield?

Post by bogs » Thu Mar 01, 2018 9:00 pm

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

Return to “Getting Started with LiveCode - Experienced Developers”