LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle the VISA Name Menu

Well, I am trying to handle the interface for a VISA name control menu. The menu button is way too small for my app, and I would really like not to have to build my own from scratch. I want to show it on mouse over (a status button), then hide it when the mouse leaves. Works great, except, when you open the selection menu, and enter it, mouse over leaves the VISA control and it vanishes (I hide it after I get a mouse leaves). This leaves the menu floating in space until the user finishes. How can I tell the user is still in the menu so the control will not be hidden? If the answer is too messy I can just build my own selection menu, but that seems a bit harsh. Any suggestions?

0 Kudos
Message 1 of 10
(2,977 Views)

An example VI would help - I'm not 100% sure what you're trying to accomplish. Perhaps have it hide the control when the mouse leaves a region, rather than when it loses focus on the control.  (Specify an XY area)

0 Kudos
Message 2 of 10
(2,968 Views)

The events passed to the VISA resource name control do not seem to include anything regarding the right button resource list menu selection box. The left button menu is there, but the right button is not. The mouse leave event is generated for the control when the mouse enters this menu box, so it is not dealt with as if it were a part of the control. I suspect there is some way to get this info from the SubObj but I have not figured out how to get this. The details of the program are really nonsequiter. I just need to select an action based on the mouse pointer leaving the combined space of the control and it's open menu box. Thanks.

0 Kudos
Message 3 of 10
(2,944 Views)

@FredM wrote:

The events passed to the VISA resource name control do not seem to include anything regarding the right button resource list menu selection box. The left button menu is there, but the right button is not. The mouse leave event is generated for the control when the mouse enters this menu box, so it is not dealt with as if it were a part of the control. I suspect there is some way to get this info from the SubObj but I have not figured out how to get this. The details of the program are really nonsequiter. I just need to select an action based on the mouse pointer leaving the combined space of the control and it's open menu box. Thanks.


An example is needed because without knowing how you are trying to accomplish this, we can only make very general comments.  Maybe the method you are using is inappropriate, for example - we'll never know unless you can serve up an example VI.  It doesn't have to be the whole VI in question, but just a bare-bones mockup that demonstrates the problem.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 10
(2,941 Views)

OK. Here is the core of it. Run it and use the OK Button to make the VISA resource name control visible. Drag the mouse across the control and it vanishes when the mouse leaves. Now when the control is visible, enter it and click on the selection menu. Move the mouse into the selection menu. The control vanishes but the menu remains. I can show/hide the control based on the mouse leaving, but I cannot tell if the mouse is in the selection menu, so I end up having the control hidden when the selection menu is still active. I need a way to tell the selection menu is active, that the mouse is in it, or something close to that any way, to construct a mouse leave both the control and the menu. I do not see any way to manipulate the menu, and that does not seem right. It is not obvious how I can even tell when the mouse is in the menu, and that just can't be right. LV knows this so I must just be missing something.

0 Kudos
Message 5 of 10
(2,937 Views)

Excuse me. Got left and right confused - again. Dyslexia. Meant to say the left mouse button menu is not accessible.

0 Kudos
Message 6 of 10
(2,933 Views)

I played with this for awhile, and got nowhere. I couldn't find anything in LabVIEW to tell you when you are in the menu selection.

 

Something that might help:  The user has to generate a "mouse down" event to leave the selection - either by clicking out of the dropdown menu, or by selecting one of the  items. You could have this event hide the control instead of the mouse leaving the control.

0 Kudos
Message 7 of 10
(2,916 Views)

Hi Fred,

 

You can try with the Mouse Enter event for the Pane source. Using this option will leave the VISA resource visible meanwhile the selection menu is visible. Once you select any option from the selection menu, or when you click any other control (including the pane) the VISA Resource Name will disappear.  Just be careful using with this option, be sure to don’t add extremely demanding CPU resources for this event. Remember that it will be executing every time that you click any control.

I´ve included a modified version of your VI. Let me know if this is the behavior that you are expecting.

 

Regards,

 

MCOTO

0 Kudos
Message 8 of 10
(2,883 Views)

Thanks for the effort guys.

1. The user does not "have to" mouse down to leave the menu, unless I cannot find a way to do a mouse leave from the combined menu and control.

 

2. I did try the mouse enter in the pane. As I recall this proved unreliable when the menu was closed by a click. The menu closed but the enter pane event was not sent.

 

It might be possible to combine some logic with a mouse leave from the control, a mouse enter the pane, and some other stuff. This sounds so complex I would be better off building my own. Odd that it is not available in a service - just a bit hidden by some obscure reference path.

0 Kudos
Message 9 of 10
(2,874 Views)

@FredM wrote:

Thanks for the effort guys.

1. The user does not "have to" mouse down to leave the menu, unless I cannot find a way to do a mouse leave from the combined menu and control.

 

2. I did try the mouse enter in the pane. As I recall this proved unreliable when the menu was closed by a click. The menu closed but the enter pane event was not sent.

 

It might be possible to combine some logic with a mouse leave from the control, a mouse enter the pane, and some other stuff. This sounds so complex I would be better off building my own. Odd that it is not available in a service - just a bit hidden by some obscure reference path.


Maybe you can generate an [esc] key press in the same spot where you hide your control?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 10
(2,869 Views)