EA_MenuClick

Return to Introduction  Previous page  Next page

EA_MenuClick events are received by an Add-In in response to user selection of a menu option.

 

Syntax

 

Sub EA_MenuClick(Repository As EA.Repository, MenuLocation As String, MenuName As String,  ItemName As String)

 

The EA_GetMenuClick function syntax contains the following elements

 

 

Parameter

Type

Direction

Description

Repository

EA.Repository

 

IN

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

MenuName

String

 

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

ItemName

String

 

The name of the option actually clicked, eg. "Create &New Invoice".

 

Return Value

 

None.

 

Details

 

The event is raised when the user clicks on a particular menu option. When a user clicks on one of your non-parent menu options, your Add-In receives a MenuClick event, defined as follows:

 

Sub EA_MenuClick(Repository As EA.Repository, ByVal MenuName As String, ByVal ItemName As String)

 

The code below illustrates an example of use:

 

   If MenuName = "-&Diagram" And ItemName = "&Properties" then

       MsgBox Repository.GetCurrentDiagram.Name, vbInformation

   Else

       MsgBox "Not Implemented", vbCritical

   End If

 

 

Notice that your code can directly access Enterprise Architect data and UI elements using Repository methods.

See Also