Comments

JohnnyRoy wrote on 9/9/2008, 5:28 AM
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:


void HandleCmdMenuPopup(Object sender, EventArgs args)
{
CustomCommand cmd = (CustomCommand)sender;
cmd.Checked = myVegas.FindDockView(COMMAND_VIEW_NAME);
if (cmd.Checked)
{
cmd.IconFile = Path.Combine(myIconFolder, "checked_icon.png");
}
else
{
cmd.IconFile = Path.Combine(myIconFolder, "not_checked_icon.png");
}
}

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

~jr
Rosebud wrote on 9/9/2008, 5:45 AM
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.

Gilles.