预订演示
前页 后页

EA_GetMenuItems

The EA_GetMenuItems event enables the Add-In to provide the Enterprise Architect user interface with additional Add-In menu options in various context menus. When a user selects an Add-In menu option, an event is raised and passed back to the Add-In that originally defined that menu option.

This event is raised just before Enterprise Architect has to show particular menu options to the user, and its use is described in the Define Menu Items topic.

Syntax

Function EA_GetMenuItems (Repository As EA.Repository, MenuLocation As String, MenuName As String) As Variant

The EA_GetMenuItems function syntax has these parameters.

Parameter

Type

See also

Repository

EA.Repository

Direction: IN

Description: An EA.Repository object representing the currently open Enterprise Architect model. Poll its members to retrieve model data and user interface status information.

Repository Class

MenuLocation

String

Direction: IN

Description: A string representing the part of the user interface that brought up the context menu. This can be TreeView, MainMenu, Diagram or Other. You can add further values for MenuLocation at any time.

A MenuLocation of 'TreeView' would indicate that the menu was displayed in the Browser window; 'MainMenu' would indicate that the menu was displayed from a ribbon option, and 'Diagram' that the menu was displayed within a diagram. 'Other' would indicate an unspecified location, which might be one of these:

  • Calendar
  • Dialog
  • Element List
  • Gantt
  • Model View
  • Project View
  • Relationship Matrix
  • Reviews
  • Search
  • Specification Manager
EASelection Class

MenuName

String

Direction: IN

Description: The name of the parent menu for which sub-items are to be defined. In the case of the top-level menu this is an empty string.

Return Value

One of these types:

  • A string indicating the label for a single menu option
  • An array of strings indicating multiple menu options
  • Empty (Visual Basic/VB.NET) or null (C#) to indicate that no menu should be displayed

In the case of the top-level menu it should be a single string or an array containing only one item, or empty/null.

Learn more