This function is called when a user right-clicks an item in the library to display a shortcut menu. HotDocs calls this function repeatedly to get the name of each entry in the custom submenu and stops when the function fails, or when menuText is an empty string ("").
ContextGetMenuEntry ( int menuPosition , ref string menuText , ref bool enabled , ref bool callAgain , int commandId )
Parameter | Description |
menuPosition | A counter that tells the plug-in how many times HotDocs has called this function. |
menuText | The text for the menu entry. (If menuText is a hyphen (-), HotDocs adds a separator to the menu.) |
enabled | Specifies whether the menu entry should be enabled (TRUE) or disabled (FALSE). |
callAgain | Indicates whether HotDocs should call this function again to add additional entries to the submenu. |
commandId | An identifier HotDocs passes to the ContextCommand function to specify which menu entry is called. The plug-in should save this identifier so it knows which command is selected from the submenu. |
The following Visual C# example implements the ContextGetMenuEntry function:
public void ContextGetMenuEntry(int menuPosition, ref string menuText, ref bool enabled, ref bool callAgain, int commandId) { switch (menuPosition) { case 0: menuText = "Command 1"; cmd1 = commandId; enabled = true; break; case 1: menuText = "Command 2"; cmd2 = commandId; enabled = true; callAgain = false; break; default: break; } }