12-02-2019 02:55 AM
Hi,
I would like to ask, how can I selectively enable/disable custom menu items. For example, I added "Tools/example item 1" and "Tools/example item 2" to LabVIEW tools menu and I want, based on certain conditions disable/enable these items - based on where they are called from (whether from init screen, from VI or from project). I also want to conditionally disable "example item 2", so that it will disabled until "example item 1" is called and executed. I know this is possible since several LabVIEW toolkits use this. Can someone please advise me on how this is done?
12-02-2019 03:04 AM
Are you referring to the right-click menu item? If so, that's pretty straight forward. Typically I would do that in the OnPopupMenu.vi method. Here's an example of that:
The source code for this provider is available on my GitHub: https://github.com/TomsLabVIEWExtensions/Toggle-Debugging
Hope this helps 🙂
12-02-2019 03:11 AM
Sorry, I re-read your message and you specifically asked about the LV Tools menu.
I haven't been able to find a way to do that (yet) as typically you initialize your tools menu in the init.vi method (which is only run once).
I will edit this reply if I come across anything.
12-02-2019 03:19 AM
Thank you for your reply McQuillan,
yes, I am looking for the disabling of tools menu items. What I want to do looks like this example from Tools/Advanced menu with items "Export Strings..." and "Import Strings...":
12-02-2019 03:39 AM
12-02-2019 03:51 AM
Yeah, I would tend to agree with Hypiz. I'm normally pretty good at finding the source code for the native LV plugins to use as examples - I was able to find Mass Compile. But I couldn't find Export Strings anywhere in program files (I did a global "everything" search on my PC, then manually looked in the <labview>\project directory and the providers directory).
12-02-2019 04:41 AM
It should be possible, for example this Add-on has it.
12-02-2019 09:23 AM - edited 12-02-2019 11:32 AM