From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String (Ctl/Ind) mouse events

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

0 Kudos
Message 1 of 12
(3,122 Views)

To be simple, I would disable that display menu for the string control, and do the changes programmatically via a Menu Ring:

 

Str. Ev. Test.png

 

ring.png

0 Kudos
Message 2 of 12
(3,105 Views)

Thank you but that is a workaround. I would like to know if I missed something.

 

0 Kudos
Message 3 of 12
(3,098 Views)

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. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 12
(3,095 Views)

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.

0 Kudos
Message 5 of 12
(3,088 Views)

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?

0 Kudos
Message 6 of 12
(3,076 Views)

@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.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 7 of 12
(3,066 Views)

Maybe they will consider it as a bug?

0 Kudos
Message 8 of 12
(3,062 Views)

@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.  Smiley Very Happy

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 9 of 12
(3,057 Views)

@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.  Smiley Very Happy


Me neither, and the workaround is just very easy 🙂

0 Kudos
Message 10 of 12
(3,051 Views)