LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
TurboPhil

Fix Custom Right-Click Menus for Controls

Status: Declined

Any idea that has received less than 8 kudos within 8 years after posting will be automatically declined.

As of LV2010SP1, there is no good way to interact with the Right-Click menu of a control programmatically. You can create a custom right-click menu for a control at edit time, and as long as you save the menu with the control (saving it as a discrete *.rtm file doesn't work--see CAR #256160), you're in business.

 

But if you want to make sure multiple controls all have the same menu, you're pretty much out of luck. There is no way to programmatically load an *.rtm file for a control. The best you can do is build up the menu one item at a time using the menu primitive functions. And you have to do that on menu activation event, because you can't get at the control's menu reference any other way.

 

This is pretty kludgy.

 

The other solution is to make those controls strict type definitions, but that isn't ideal in a lot of cases. For instance, I want to make sure all the XY Graphs in my application have the same RTM API, so I could use a single strict typedef, but that sucks if I don't want them all the same size, etc....

 

 

So here's the idea: fix runtime menus for controls.

  • Add an "RTM Path" property for all LVControls to allow loading custom RTM files at runtime.
  • Add a "Runtime Menu" property to all LVControls to grab the menu reference at runtime.
  • Make sure that RTM files are loaded properly in EXEs (see CAR #256160)
2 Comments
tst
Knight of NI Knight of NI
Knight of NI

I don't know about editing context menus (I don't think I ever did that in actual code I used), but I do know that you can edit it programmatically at run-time - the menu activation event should return a reference to the menu, which you can then work on using the menu primitives.


___________________
Try to take over the world!
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 8 kudos within 8 years after posting will be automatically declined.