10-19-2006 10:38 AM
10-24-2006 07:52 PM
03-31-2009 03:51 AM
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.
09-30-2022 11:26 AM
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
09-30-2022 01:33 PM - edited 09-30-2022 01:35 PM
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.