![]() |
This document is archived and information here might be outdated. Recommended version. |
Engine edit vertex context menu.
This object was 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 ArcGIS for Desktop Basic 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 ArcGIS for Desktop Standard or ArcGIS for Desktop Advanced, this menu can be used to edit data within an enterprise geodatabase.
| Interfaces | Description |
|---|---|
| IMenuDef (esriSystemUI) | Provides access to members that define a menu. |
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.
privateEngineEditor m_EngineEditor =newEngineEditorClass();privateIEngineEditSketch m_EngineEditSketch;privateIToolbarMenu m_ToolbarMenu;privateIToolbarControl m_ToolbarControl;private voidMainForm_Load(objectsender, EventArgs e) {//Create a new ToolbarMenum_ToolbarMenu =newToolbarMenu();//Add Context Menu to the ToolbarMenum_ToolbarMenu.AddItem("esriControls.ControlsEditingVertexContextMenu", 0, 0,false, esriCommandStyles.esriCommandStyleTextOnly);//Share the ToolbarControl command pool with the ToolbarMenu command poolm_ToolbarControl = (IToolbarControl)axToolbarControl1.Object; m_ToolbarMenu.CommandPool = m_ToolbarControl.CommandPool;//Set the Engine Edit Sketchm_EngineEditSketch = (IEngineEditSketch)m_EngineEditor; }private voidaxMapControl1_OnMouseUp(objectsender, IMapControlEvents2_OnMouseUpEvent e) {if(e.button == 2) {//Call the SetEditLocation method using the OnMouseUp locationm_EngineEditSketch.SetEditLocation(e.x, e.y);//Pop up the ControlsEditingVertexContextMenu when the "Modify Feature" Engine Edit Task is currentif(m_EngineEditor.CurrentTask.UniqueName == "ControlToolsEditing_ModifyFeatureTask") m_ToolbarMenu.PopupMenu(e.x, e.y, axMapControl1.hWnd); } }
Privatem_EngineEditorAs NewEngineEditor()Privatem_EngineEditSketchAsIEngineEditSketchPrivatem_ToolbarMenuAsIToolbarMenuPrivatem_ToolbarControlAsIToolbarControlPrivate SubMainForm_Load(ByValsenderAsSystem.Object,ByValeAsEventArgs)HandlesMyBase.Load'Create a new ToolbarMenum_ToolbarMenu =NewToolbarMenu()'Add Context Menu to the ToolbarMenum_ToolbarMenu.AddItem("esriControls.ControlsEditingVertexContextMenu", 0, 0,False, esriCommandStyles.esriCommandStyleTextOnly)'Share the ToolbarControl command pool with the ToolbarMenu command poolm_ToolbarControl =CType(axToolbarControl1.Object, IToolbarControl) m_ToolbarMenu.CommandPool = m_ToolbarControl.CommandPool'Set the Engine Edit Sketchm_EngineEditSketch =CType(m_EngineEditor, IEngineEditSketch)End Sub Private SubaxMapControl1_OnMouseUp(ByValsenderAsSystem.Object,ByValeAsESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseUpEvent)HandlesaxMapControl1.OnMouseUpIf(e.button = 2)Then'Call the SetEditLocation method using the OnMouseUp locationm_EngineEditSketch.SetEditLocation(e.x, e.y)'Pop up the ControlsEditingVertexContextMenu when the "Modify Feature" Engine Edit Task is currentIf(m_EngineEditor.CurrentTask.UniqueName = "ControlToolsEditing_ModifyFeatureTask")Thenm_ToolbarMenu.PopupMenu(e.x, e.y, axMapControl1.hWnd)End If End If EndSub