LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Catch mouse click outside of window/vi

I have a MAIN window that has status indicators and controls on it that remain visible at all times. When a second window is visible above the MAIN window the user can still see the MAIN window indicators but not select any of the controls. Is there a way to catch when the user clicks in the area outside of the second window (trying to click on the MAIN window) and inform them that this area is unavailable until they close the second (current) window.

Hope this makes sense!

~Gold
0 Kudos
Message 1 of 5
(3,831 Views)
Gold,

You can catch the mouse click using an event structure and the Mouse Down event, but you'll have to have it in the MAIN window, not the second window. If the information is needed in the second window, you could send it between windows using a messaging function such as queue, notifier, or VI Server. It might be more straightforward to just have the MAIN window pop up a dialog box.

Allen
0 Kudos
Message 2 of 5
(3,816 Views)
I do currently act on the mouse down event in the Main vi. However, when the second vi is running on top of the Main vi, the main vi can not see the mouse down event. The second vi has control. So, my idea was to catch when a operator clicked outside of the second vi and remind them that the Main vi controls are not active while the second vi is present. Currently the only solution I have come up with is the Outside of Window mouse event. But then that could become annoying to have a message pop-up every time the mouse moved outside the second window area.

~Gold
0 Kudos
Message 3 of 5
(3,805 Views)
why not just make the vi modal that way they cannot interact with the main vi whe it is open.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 4 of 5
(3,792 Views)
Hi gold,

By default, you can still access the Main VI while the subVI is running. Only if you set the subVI to be modal, you can't access the Main VI's front panel, while the subVI is running.

In my attached example, it is possible to access the Main VI while the subVI is running. Notice in the block diagram for the Main VI that the subVI and the rest of the code is running in parallel - that's why the Main VI acts when you click the button.

You could instead of a simple 'Value change' use 'Mouse down' instead if you want.

Have fun!
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 5 of 5
(3,778 Views)