This function retrieves the commands that will appear on your plug-in's library window menu. HotDocs calls it repeatedly until it fails, or until menuText is an empty string ("").
void GetMenuEntry( int menuPosition, ref string menuText, ref HotDocs.Icon Icon, ref bool enabled, ref bool callAgain, int commandId )
Parameters | Description |
menuPosition | A 0-based counter that tells your plug-in code how many times HotDocs has called GetMenuEntry. For example, when this counter is 1, your code should return the command you want to appear as the second entry in your plug-in's library window menu. |
menuText | The text for the menu entry. If menuText is a hyphen (-), HotDocs will add a separator to the menu. |
Icon | The icon that will appear next to the menu entry. |
enabled | Indicates if the menu entry should be enabled (TRUE) or disabled (FALSE). |
callAgain | Indicates if the function should be called again to retrieve the next menu entry (TRUE), or if your plug-in is finished adding entries to the menu (FALSE). |
commandId | An identifier for the menu entry. When a user selects an item from your plug-in's menu, HotDocs will pass this identifier to the Command function so your plug-in knows which command was selected. |
The following Visual C# example implements the GetMenuEntry function:
public void GetMenuEntry(int menuPosition, ref string menuText, ref Icon Icon, ref bool enabled, ref bool callAgain, int commandId) { HotDocs.Icon icon = new Icon(); icon.LoadIcon(@"C:\images\MenuEntry.ico"); switch (menuPosition) { case 0: menuText = "HotDocs Website"; enabled = true; callAgain = true; cmd1 = commandId; break; case 1: //Add a separator menuText = "-"; enabled = false; break; case 2: menuText = "Menu Sample w/icon"; Icon = icon; enabled = true; callAgain = false; cmd2 = commandId; break; default: break; } }