Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
EA_MenuClick
Topics:
Topic |
Detail |
See Also |
---|---|---|
Details |
EA_MenuClick events are received by an Add-In in response to user selection of a menu option. 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. Also look at EA_GetMenuItems. |
Syntax
Sub EA_MenuClick(Repository As EA.Repository, MenuLocation As String, MenuName As String, ItemName As String)
The EA_GetMenuClick function syntax has the following elements:
Parameter |
Type |
Direction |
Description |
---|---|---|---|
ItemName |
String |
|
The name of the option actually clicked, for example, Create a New Invoice. |
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. |
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. |
Return Value
None.