-
Notifications
You must be signed in to change notification settings - Fork 4
Menu Entry
Tom Bogle edited this page Aug 19, 2021
·
9 revisions
There are three places where a plugin can insert menu entries:
- In the main menu for actions that are not associated with any particular project
- In the tab menu for a project
- In the tab menu for the parent window for the plugin
There are two concrete classes that are used to define menu entries for plugins for the first two cases where programmers can decide where to place the menu entry:
- PluginMenuEntry, which is used for plugins that implement the IParatextStandalonePlugin interface.
- WindowPluginMenuEntry, which is used for plugins that implement the IParatextWindowPlugin interface.
Both classes have similar members:
- Text to be displayed in the menu
- Action to be run when the menu is clicked
- Location in the menu hierarchy for the entry. See the enum
PluginMenuLocation
for the standard places to insert menu entries. Those that start withScrText
are associated with a project. - Image path for an image to be displayed in the menu
The action has slightly different parameters for the two classes:
- The action for the PluginMenuEntry class specifies an IPluginHost
- The action for the WindowPluginMenuEntry class specifies an IWindowPluginHost
The IWindowPluginHost is derived from IPluginHost and adds the
ShowEmbeddedUi
method.
PluginAnnotationMenuEntry is used for plugins that implement the IParatextScrTextAnnotationPlugin interface. The menu entry will always display in the view section of a project so the constructor does not take a location like the constructors of the other two plugin menu entry classes do.