LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reference for Run-Time Shortcut Menu

Is there a method for obtaining a reference to a Run-Time Shortcut Menu for a specific control/indicator?

There is a provision for obtaining the "MenuRef" for any control/indicator by using an event structure ("Pane": Shortcut Menu Activation?) but I would really like to use something along the lines of a property node such that the Run-Time Shortcut Menu could be programmatically set apart from the user accessing the menu.
0 Kudos
Message 1 of 5
(5,328 Views)
njg,

I believe these menus are generated on the fly and therefore the references are only valid for the duration of the click, hence why you can only get the reference from the event structure.

Hope this helps,
--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
Message 2 of 5
(5,313 Views)

There is an event for the control called "Shortcut Menu Activation?". This event provides you with a reference to the menu.

 

The activation event will fire the instant the user requests to see the menu. Put menu functions in this event case to build the menu that you want the user to see and choose from.

Message 3 of 5
(5,031 Views)

Using LabVIEW 2020 -

It appears the Event structure 'Event' of Shortcut Meun Activation? provides the MenuRef...

 

When I set the Event Structure Event to Shortcut Menu Activation - USER - It DOES NOT Expose the controls MenuRef.

 

Don't know why the menu ref is not expose for all control menu events...

 

Jack

0 Kudos
Message 4 of 5
(2,157 Views)

popup menus are dynamic in LabVIEW. They are created/build each time and occupy a slot in a global menu array variable. So the menu really only exists from the time the Menu Activation? event is called until a selection is made or the menu tracking determined that the user left the menu without making any selection. After this point in time the menu is not exactly destroyed but simply left until that slot is used again for another popup menu.

 

So no, there is no way to get a refnum for a control popup menu outside of the actual menu tracking process since that menu factually doesn't exist. The only thing that might exist is the menu definition that is assigned to a control but that is not the menu itself. It is simply the template that is used to create the initial menu at the moment the right mouse click is selected on a control. Then that is served to the Menu Activation? event if it exists and then the menu tracking is entered where LabVIEW will capture mouse move events until either a menu selection is done, or the mouse leaves the menu area.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(2,140 Views)