com.esri.arcgis.systemUI
Interface IMenuDef

All Superinterfaces:
Serializable
All Known Implementing Classes:
ControlsArcWebMenu, ControlsEditingEditorMenu, ControlsEditingSketchContextMenu, ControlsEditingSnapToFeatureMenu, ControlsEditingVertexContextMenu, ControlsFeatureSelectionMenu, ControlsMapBookmarkMenu, ControlsMapViewMenu, ControlsNetworkAnalystSolverMenu

public interface IMenuDef
extends Serializable

Provides access to members that define a menu.

When To Use

The IMenuDef interface is used to define the properties of a custom menu. When creating your own menu, you would implement the IMenuDef interface in your class code. You can set the caption and name of the menu and specify what commanditems are on the menu.

If you want your custom menu to appear in the Menus category in the Customize dialog you also need to implement the IRootLevelMenu interface. IRootLevelMenu is an indicator interface that is used only to indicate to the application that the menu should be treated as a root menu.
If you are creating a context menu you would implement both IMenuDef and IShortcutMenu. IShortcutMenu is an indicator interface that is used only to indicate to the application that this menu should be treated as a context menu.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
com.esri.arcgis.framework.IShortcutMenu, com.esri.arcgis.framework.IRootLevelMenu

Method Summary
 String getCaption()
          The caption of this menu.
 int getItemCount()
          The number of items in this menu.
 void getItemInfo(int pos, IItemDef itemDef)
          The CLSID for the item on this menu at the specified index.
 String getName()
          The name of this menu.
 

Method Detail

getItemCount

int getItemCount()
                 throws IOException,
                        AutomationException
The number of items in this menu.

Remarks

When implementing IMenuDef to create a custom menu, use the ItemCount property to specify how many items will be on this menu.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The numItems
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getItemInfo

void getItemInfo(int pos,
                 IItemDef itemDef)
                 throws IOException,
                        AutomationException
The CLSID for the item on this menu at the specified index.

Description


pos represents the locational index number of this item on the menu.

itemDef is an IItemDef object that defines the item at this position of the menu.

Remarks

When implementing IMenuDef to create a custom menu, use the GetItemInfo method to define what items are on this menu.

To find the CLSID, ProgID, and subtype of a built-in command or menu in ArcMap or ArcCatalog, refer to the following technical documents:

ArcObjects Developer Help > Technical Documents > ArcMap: Names and IDs of commands and commandbars

ArcObjects Developer Help > Technical Documents > ArcCatalog: Names and IDs of commands and commandbars

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
pos - The pos (in)
itemDef - A reference to a com.esri.arcgis.systemUI.IItemDef (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IItemDef

getName

String getName()
               throws IOException,
                      AutomationException
The name of this menu.

Remarks

When implementing IMenuDef to create a custom menu, use the Name property to set the name of this menu.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCaption

String getCaption()
                  throws IOException,
                         AutomationException
The caption of this menu.

Remarks

When implementing IMenuDef to create a custom menu, use the Caption property to set the caption of this menu.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.