09-15-2011 02:18 PM
I am experiencing some unexpected behavior with XControl custom menus. There does not seem to be an event to handle the XControl "container" right-click menu. This behavior can be observed in the "Simple Dual Mode Thermometer XControl?" example finder project by the following steps:
1. Drop an XControl on the front panel of a VI, the XControl "container is selected.
2. Right-click on the container selection.
How do I add to this menu? I have tried the Pane Shortcut menu along with all of the contained controls but none of these display in the "container" menu...
09-16-2011 05:34 PM
LVB,
I'm trying to get a better idea of your question. Do you need to modify the menu that normally pops up for right clicks, but now for a XControl container? Or are you trying to catch the event of right clicking on a XControl?
Regards,
Danny F
09-16-2011 06:45 PM
@Danny F wrote:
LVB,
I'm trying to get a better idea of your question. Do you need to modify the menu that normally pops up for right clicks, but now for a XControl container? Or are you trying to catch the event of right clicking on a XControl?
Regards,
Danny F
09-17-2011 04:35 PM
Perhaps you can register for the Shortcut Menu Event of the Control itself (one of the elements offered inside the facade VI is the actual control ref on the owning VI).
Ton
09-19-2011 09:26 AM
I don't see a way to add an event case for the XControl refnum itself.
So I have to spawn a helper VI and register a dynamic event to the XControl?
Using Dynamic Events with XControls
09-20-2011 10:47 AM
LVB,
I was able to get this to work by modifying the event structure in the facade VI. I had to add an event case that catches the Shortcut Menu filter event for the Pane, then just copied the code from case 4 (original shortcut menu activation) into the new event case. I've attached the facade VI.
Regards,
Danny F
09-20-2011 10:56 AM
@Danny F wrote:
LVB,
I was able to get this to work by modifying the event structure in the facade VI. I had to add an event case that catches the Shortcut Menu filter event for the Pane, then just copied the code from case 4 (original shortcut menu activation) into the new event case. I've attached the facade VI.
Regards,
Danny F
Thank you for the response Danny. Your example does show the menu when the user right-clicks within the pane. However, your example does not show the menu when the user right-clicks when the container (entire XControl) is selected. No custom menu is displayed when dropping a new XControl onto a front panel and then right-clicking.
09-21-2011 01:36 PM
LVB,
Thank you for pointing this out, it may be a User Interface bug. I have submited a report of this behavior (CAR# 316025).
Regards,
Danny F