The custom command I’m writing don’t need a dockable control.
Is there a way to dynamically change the icon displayed in the tools bar to show if the custom command is enabled or disabled (just like the others tools : auto ripple, auto crossfade, lock envelope… etc)
Vegas should take care of this highlighting for you.
If you want to change the icon depending on whether the command is enabled or disabled I'm no sure if Vegas allows this. What you could try is in your event handler for ICustomCommandModule.MenuPopup you could see if your command menu is checked or not and assign the appropriate icon to ICustomCommandModule.IconFile.
As I said I'm not sure if Vegas will pick up on this change (it may just pick up the icon after calling InitializeModule()) but if it does, that would provide a solution. It would look something like:
Edited:I did some testing after posting this and it doesn't work. Vegas only picks up the icon when it's set in the InitializeModule() method. Swapping it on the fly like that does not cause a refresh of the menu icon. Too bad. :(
Thx Johnny,
This is what I did first but it doesn’t seem to work (I think the icon is set at Vegas initialisation).
Not a big deal, I will just add a message box to alert user.