LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom XControl Container Menu?

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...

CLA, CTA
0 Kudos
Message 1 of 8
(1,274 Views)

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

Danny Funk -- Group Manager -- LabVIEW R&D -- National Instruments
0 Kudos
Message 2 of 8
(1,260 Views)

@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


  • I want to modify the menu that normally pops up for right clicks.  This is usually done in the Shortcut Menu Activation event.
  • I am using the phrase "container" referring to the selection that occurs when an XControl is dropped onto the front panel.

 

  • Please see the video at http://http://screencast.com/t/fb3DdGu1ZWQ5
    Notice how the "Display Temperature..." menu item is not displayed after the XControl is dropped onto the front panel.  I have also added the "Pane: Shortcut Menu Activation" event and this is not triggered upon right-click of the XControl "container".
CLA, CTA
0 Kudos
Message 3 of 8
(1,257 Views)

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 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 8
(1,246 Views)

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

CLA, CTA
0 Kudos
Message 5 of 8
(1,228 Views)

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

Danny Funk -- Group Manager -- LabVIEW R&D -- National Instruments
0 Kudos
Message 6 of 8
(1,212 Views)

@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.



CLA, CTA
0 Kudos
Message 7 of 8
(1,210 Views)

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

Danny Funk -- Group Manager -- LabVIEW R&D -- National Instruments
0 Kudos
Message 8 of 8
(1,197 Views)