AGI Ui Plugins 11 Send comments on this topic.
OnDisplayContextMenu Method (IAgUiPlugin)
See Also  Example





Description

Allows the UI plugin to add its own custom context menus.

Syntax

[Visual Basic .NET]
Public Sub OnDisplayContextMenu( _
   ByVal MenuBuilder As IAgUiPluginMenuBuilder _
) 

[C#]
public void OnDisplayContextMenu(
IAgUiPluginMenuBuilder MenuBuilder
);

[Managed C++]
public: void OnDisplayContextMenu(
IAgUiPluginMenuBuilder ^ MenuBuilder
);

[Java]
public  onDisplayContextMenu(
IAgUiPluginMenuBuilder MenuBuilder
);

[Unmanaged C++]
public: HRESULT OnDisplayContextMenu(
IAgUiPluginMenuBuilder * MenuBuilder
);

Parameters

MenuBuilder
The menu builder object provided by the hosting environment. The menu builder exposes methods to create custom context menus.

Remarks

The hosting environment calls OnDisplayContextMenu method whenever the context menu associated with a currently selected scenario's element is displayed. User Interface plugins can merge their custom menus to extend the default functionality provided by the hosting environment.

Example

In the example below, MyFirstContextMenuCommand is a named command which is passed to the IAgUiPluginCommandTarget.Exec method when user clicks on the custom menu item.
Add a custom context menu item. Copy Code
void IAgUiPlugin.OnDisplayContextMenu(IAgUiPluginMenuBuilder MenuBuilder) 

    //Add a Menu Item 
    MenuBuilder.AddMenuItem("MyFirstContextMenuCommand""A CSharp Menu Item""Open a Custom user interface."null); 

 

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1