12-06-2017 09:07 AM
Hi,
Have some trouble with a string control (and indicator) and mouse key events.
In the application I have several string controls and indicators. For this question I use a test VI.
I want to detect if a mouse key is down and with some keys be able to discard the mouse key pressed.
Also the display style selector is visible and it must be possible to change the display style.
It works but I have to click the display selection twice if I have a ‘Mouse Down?’ event for this string control.
The event ‘Mouse Down?’ is fired once if the display style is clicked.
I can think of workarounds but I cannot find a normal solution.
Does anyone have an idea how to solve this or is it a bug ?
Kees
12-06-2017 09:36 AM - edited 12-06-2017 09:38 AM
To be simple, I would disable that display menu for the string control, and do the changes programmatically via a Menu Ring:
12-06-2017 09:40 AM
Thank you but that is a workaround. I would like to know if I missed something.
12-06-2017 09:45 AM - edited 12-06-2017 09:46 AM
Sorry, I can't open 2017 files so I'm having a hard time understanding what you are trying to do.
There is a Mouse Down? event and there is a Mouse Down event. The one with the question mark is a filter event, allowing you to discard events under certain conditions. If you have both events configured and you don't discard a mouse down, both events will fire for one mouse button press.
If you want to discard the right mouse clicks in this control, in the filter event for mouse down (the one with the question mark), discard all events that occur with button 2. All others will be processed and will still fire the Mouse Down event immediately afterward.
In 2012, I can discard all mouse down events and the Display Style selector is still shown. Sounds to me like that is different than what you are seeing.
12-06-2017 09:47 AM
In 2012, I can discard all mouse down events and the Display Style selector is still shown. Sounds to me like that is different than what you are seeing.
In 2017, if I discard the mouse down events for the buttons, the display selector is shown, but you cannot change its value.
12-06-2017 10:02 AM
I would say it is not a bug, because the mouse key down is fired whenever the mouse is above the area of the control (and the button pushed). Ok, we could argue, that this behavior is not desired, and this event should not fire when we want to select a different display style?
12-06-2017 10:18 AM
@Blokk wrote:
In 2017, if I discard the mouse down events for the buttons, the display selector is shown, but you cannot change its value.
Sure enough. Same here. I made the assumption that if the menu could be shown, the value could be changed. Bad assumption on my part. However, that does seem odd to me. There is no consistency to the behavior. If the menu selection cannot be made, why even show the menu?
Oh....now I see the behavior that the OP mentions about having to click twice. With all mouse events filtered except Left Click, that behavior is still seen. It seems that the filtering action (even though I don't filter the left click) resets the control some how and requires me to pick from the selection menu again. Seems iffy to me.
12-06-2017 10:24 AM
Maybe they will consider it as a bug?
12-06-2017 10:48 AM
@Blokk wrote:
Maybe they will consider it as a bug?
If so, it probably won't get much attention. I bet this is one of those extremely rare edge use cases. After all, how many times have you built an app where the display style selector is shown? I didn't even realize that was a thing.
12-06-2017 10:49 AM
@aputman wrote:
@Blokk wrote:
Maybe they will consider it as a bug?
If so, it probably won't get much attention. I bet this is one of those extremely rare edge use cases. After all, how many times have you built an app where the display style selector is shown? I didn't even realize that was a thing.
Me neither, and the workaround is just very easy 🙂