When no document is open, the menuitem is disabled. When document is open, the menuitem is enabled.
But it would be smarter if you could control in which documents/codetypes the menuitem should be enabled.
Let's say I write a plugin to process only PHP code, then there's no need for the menuitem to be enabled in HTML/CSS code etc.
Current implementation:
Code: Select all
Script.RegisterDocumentAction(<submenu>, <menuitem>, <shortcut>, <function>);
Code: Select all
Script.RegisterDocumentAction(<submenu>, <menuitem>, <shortcut>, <codeTypeList>, <function>);
Or even better:
Code: Select all
Script.RegisterDocumentAction(<submenu>, <menuitem>, <shortcut>, <iconfile>, <codeTypeList>, <function>);