User | Kudos |
---|---|
9 | |
5 | |
4 | |
4 | |
2 |
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea that has received less than 8 kudos within 8 years after posting will be automatically declined.