ArcObjects Library Reference (Controls)  

ControlsEditingVertexContextMenu CoClass

Engine edit vertex context menu.

Product Availability

Available with ArcGIS Engine.

Description

This object is new at ArcGIS 9.3.

The CLSID of this menu is: {4F29BC92-2988-45E8-8317-0169EAB954C6}.

This menu works with the ToolbarControl, PageLayoutControl and MapControl.

If the ArcGIS Engine application using this menu is initialized with an ArcGIS Engine Runtime license or an ArcView license, this menu can be used to edit shapefiles and personal geodatabases.

If the ArcGIS Engine application using this menu is initialized with an ArcGIS Engine GeoDatabase Editing license, or ArcEditor or ArcInfo, this menu can be used to edit data within an enterprise geodatabase.

Interfaces

Interfaces Description
IMenuDef (esriSystemUI) Provides access to members that define a menu.

Remarks

This menu can only be used as a pop up menu or context menu. Create a new ToolbarMenu and add this predefined menu to it using the IToolbarMenu::AddItem method. To display the ToolbarMenu as a right click context menu use the IToolbarMenu::PopupMenu method.

This menu contains commands that only work in conjunction with the "Modify Feature" engine edit task. Therefore, only pop up this menu when the IEngineEditTask::UniqueName of the IEngineEditor::CurrentTask is "ControlToolsEditing_ModifyFeatureTask".

It is essential to execute the IEngineEditSketch::SetEditLocation method prior to calling the commands on this menu. This will ensure that the vertex location, segment and part are made available to each command.

An example of using this context menu is provided in the Feature editing with the control commands sample. 

[C#]
        private EngineEditor m_EngineEditor = new EngineEditorClass();
        private IEngineEditSketch m_EngineEditSketch;
        private IToolbarMenu m_ToolbarMenu;
        private IToolbarControl m_ToolbarControl;

        private void MainForm_Load(object sender, EventArgs e)
        {

            //Create a new ToolbarMenu
            m_ToolbarMenu = new ToolbarMenu();

            //Add Context Menu to the ToolbarMenu
            m_ToolbarMenu.AddItem("esriControls.ControlsEditingVertexContextMenu", 0, 0, false, esriCommandStyles.esriCommandStyleTextOnly);

            //Share the ToolbarControl command pool with the ToolbarMenu command pool
            m_ToolbarControl = (IToolbarControl)axToolbarControl1.Object;
            m_ToolbarMenu.CommandPool = m_ToolbarControl.CommandPool;

            //Set the Engine Edit Sketch
            m_EngineEditSketch = (IEngineEditSketch)m_EngineEditor;

        }

        private void axMapControl1_OnMouseUp(object sender, IMapControlEvents2_OnMouseUpEvent e)
        {

            if (e.button == 2)
            {
                //Call the SetEditLocation method using the OnMouseUp location
                m_EngineEditSketch.SetEditLocation(e.x, e.y);
                //Pop up the ControlsEditingVertexContextMenu when the "Modify Feature" Engine Edit Task is current
                if (m_EngineEditor.CurrentTask.UniqueName == "ControlToolsEditing_ModifyFeatureTask")
                    m_ToolbarMenu.PopupMenu(e.x, e.y, axMapControl1.hWnd);
            }
        }
[Visual Basic .NET]
    Private m_EngineEditor As New EngineEditor()
    Private m_EngineEditSketch As IEngineEditSketch
    Private m_ToolbarMenu As IToolbarMenu
    Private m_ToolbarControl As IToolbarControl

    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load

        'Create a new ToolbarMenu
        m_ToolbarMenu = New ToolbarMenu()

        'Add Context Menu to the ToolbarMenu
        m_ToolbarMenu.AddItem("esriControls.ControlsEditingVertexContextMenu", 0, 0, False, esriCommandStyles.esriCommandStyleTextOnly)

        'Share the ToolbarControl command pool with the ToolbarMenu command pool
        m_ToolbarControl = CType(axToolbarControl1.Object, IToolbarControl)
        m_ToolbarMenu.CommandPool = m_ToolbarControl.CommandPool

        'Set the Engine Edit Sketch
        m_EngineEditSketch = CType(m_EngineEditor, IEngineEditSketch)

    End Sub

    Private Sub axMapControl1_OnMouseUp(ByVal sender As System.Object, ByVal e As ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseUpEvent) Handles axMapControl1.OnMouseUp

        If (e.button = 2) Then

            'Call the SetEditLocation method using the OnMouseUp location
            m_EngineEditSketch.SetEditLocation(e.x, e.y)

            'Pop up the ControlsEditingVertexContextMenu when the "Modify Feature" Engine Edit Task is current
            If (m_EngineEditor.CurrentTask.UniqueName = "ControlToolsEditing_ModifyFeatureTask") Then
                m_ToolbarMenu.PopupMenu(e.x, e.y, axMapControl1.hWnd)
            End If
        End If

    End Sub