예제 #1
0
 public MapContextMenu(object hook)
 {
     m_toolbarMenu = new ToolbarMenuClass();
     m_toolbarMenu.SetHook(hook);
     _lstView = new List<LandpriceViewPair>();
     //AddItems();
 }
예제 #2
0
        /// <summary>
        /// class constructor
        /// </summary>
        /// <param name="hook"></param>
        public TocContextMenuClass(object hook)
        {
            m_toolbarMenu = new ToolbarMenuClass();
              m_toolbarMenu.SetHook(hook);

              AddItems();
        }
예제 #3
0
        /// <summary>
        /// class constructor
        /// </summary>
        /// <param name="hook"></param>
        public TocMapContextMenu(object hook)
        {
            //Add custom commands to the map menu
              m_menu = new ToolbarMenuClass();
              m_menu.AddItem(new LayerVisibility(), 1, 0, false, esriCommandStyles.esriCommandStyleTextOnly);
              m_menu.AddItem(new LayerVisibility(), 2, 1, false, esriCommandStyles.esriCommandStyleTextOnly);

              m_menu.SetHook(hook);
        }
 /// <summary>
 /// ToolbarMenuʵ��������ӹ���/���ť
 /// </summary>
 public void SetHook(object hook)
 {
     m_toolbarMenu = new ToolbarMenuClass();
     m_toolbarMenu.SetHook(hook);
     //��ӹ���/����
     m_toolbarMenu.AddItem(new LayerVisibility(), 1, 0, false, esriCommandStyles.esriCommandStyleTextOnly);
     m_toolbarMenu.AddItem(new LayerVisibility(), 2, 1, false, esriCommandStyles.esriCommandStyleTextOnly);
     AddItem("esriControls.ControlsAddDataCommand", -1);
 }
예제 #5
0
 /// <summary>
 /// ToolbarMenu实例化和添加工具/命令按钮
 /// </summary>
 public void SetHook(object hook)
 {
     m_toolbarMenu = new ToolbarMenuClass();
     m_toolbarMenu.SetHook(hook);
     //添加工具/命令
     m_toolbarMenu.AddItem(new LayerVisibility(), 1, 0, false, esriCommandStyles.esriCommandStyleTextOnly);
     m_toolbarMenu.AddItem(new LayerVisibility(), 2, 1, false, esriCommandStyles.esriCommandStyleTextOnly);
     AddItem("esriControls.ControlsAddDataCommand", -1);
 }
예제 #6
0
 /// <summary>
 /// ToolbarMenu实例化和添加工具/命令按钮
 /// </summary>
 public void SetHook(object hook)
 {
     m_toolbarMenu = new ToolbarMenuClass();
     m_toolbarMenu.SetHook(hook);
     //添加工具/命令
     //m_toolbarMenu.AddItem(new RemoveLayer(), -1, 0, false, esriCommandStyles.esriCommandStyleTextOnly);
     //m_toolbarMenu.AddItem(new LayerSelectable(), 1, 0, true, esriCommandStyles.esriCommandStyleTextOnly);
     //m_toolbarMenu.AddItem(new LayerSelectable(), 2, 1, false, esriCommandStyles.esriCommandStyleTextOnly);
     m_toolbarMenu.AddItem(new LayerVisible(), 1, 0, false, esriCommandStyles.esriCommandStyleTextOnly);
     m_toolbarMenu.AddItem(new LayerVisible(), 2, 1, false, esriCommandStyles.esriCommandStyleTextOnly);
     m_toolbarMenu.AddItem(new ZoomToLayer(), -1, 2, true, esriCommandStyles.esriCommandStyleTextOnly);
 }
 /// <summary>
 /// ToolbarMenuʵ��������ӹ���/���ť
 /// </summary>
 public void SetHook(object hook)
 {
     m_toolbarMenu = new ToolbarMenuClass();
     m_toolbarMenu.SetHook(hook);
     //��ӹ���/����
     //m_toolbarMenu.AddItem(new RemoveLayer(), -1, 0, false, esriCommandStyles.esriCommandStyleTextOnly);
     //m_toolbarMenu.AddItem(new LayerSelectable(), 1, 0, true, esriCommandStyles.esriCommandStyleTextOnly);
     //m_toolbarMenu.AddItem(new LayerSelectable(), 2, 1, false, esriCommandStyles.esriCommandStyleTextOnly);
     m_toolbarMenu.AddItem(new LayerVisible(), 1, 0, false, esriCommandStyles.esriCommandStyleTextOnly);
     m_toolbarMenu.AddItem(new LayerVisible(), 2, 1, false, esriCommandStyles.esriCommandStyleTextOnly);
     m_toolbarMenu.AddItem(new ZoomToLayer(), -1, 2, true, esriCommandStyles.esriCommandStyleTextOnly);
 }
예제 #8
0
        /// <summary>
        /// ToolbarMenu实例化和添加工具/命令按钮
        /// </summary>
        public void SetHook(object hook)
        {
            //#region 系统右键功能菜单
            //IToolbarMenu toolmenu = new ToolbarMenuClass();	 //右键菜单
            //toolmenu.AddItem(new MenuCommand.CommandZoomIn(), -1, toolmenu.Count, false, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandZoomOut(), -1, toolmenu.Count, false, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandPan(), -1, toolmenu.Count, true, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandExtent(), -1, toolmenu.Count, false, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandMouseSelect(), -1, toolmenu.Count, true, esriCommandStyles.esriCommandStyleTextOnly);
            ////toolmenu.AddItem(new MenuCommand.CommandRectanleSelect(), -1, toolmenu.Count, false, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandMeasureLength(), -1, toolmenu.Count, true, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandMeasureArea(), -1, toolmenu.Count, false, esriCommandStyles.esriCommandStyleTextOnly);
            //#endregion



            m_toolbarMenu = new ToolbarMenuClass();
            m_toolbarMenu.SetHook(hook);
            //添加工具/命令
            //AddItem("esriControls.ControlsMapZoomOutFixedCommand", -1);
            //AddItem("esriControls.ControlsMapZoomInFixedCommand", -1);
            m_toolbarMenu.AddItem(new GIS.View.ZoomInTool(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.View.ZoomOutTool(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.View.PanTool(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.View.RefreshViewCommand(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.View.FullExtentTool(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            BeginGroup();
            m_toolbarMenu.AddItem(new GIS.GraphicEdit.FeatureSelect(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.GraphicModify.EditCopyCommand(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.GraphicModify.EditCutCommand(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.GraphicModify.EditPasteCommand(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            //BeginGroup();
            //AddItem("GIS.View.ZoomInTool",-1);
            //AddItem("GIS.View.ZoomOutTool", -1);
            //AddItem("GIS.View.PanTool", -1);
            //AddItem("GIS.View.RefreshViewCommand", -1);
            //AddItem("GIS.View.FullExtentCommand", -1);
            //BeginGroup(); //分隔条
            ////AddItem("{380FB31E-6C24-4F5C-B1DF-47F33586B885}", -1); //撤销
            ////AddItem(new Guid("B0675372-0271-4680-9A2C-269B3F0C01E8"), -1); //重做
            //AddItem("GIS.GraphicEdit.UndoEdit",-1);
            //AddItem("GIS.GraphicEdit.RedoEdit",-1);
            //BeginGroup();
            ////AddItem("esriControls.ControlsEditingCopyCommand", -1);
            ////AddItem("esriControls.ControlsEditingPasteCommand", -1);
            ////AddItem("esriControls.ControlsEditingCutCommand", -1);
            //AddItem("GIS.GraphicModify.EditCopyCommand", -1);
            //AddItem("GIS.GraphicModify.EditCutCommand", -1);
            //AddItem("GIS.GraphicModify.EditPasteCommand", -1);
        }
        /// <summary>
        /// ToolbarMenuʵ��������ӹ���/���ť
        /// </summary>
        public void SetHook(object hook)
        {
            //#region ϵͳ�Ҽ����ܲ˵�
            //IToolbarMenu toolmenu = new ToolbarMenuClass();	 //�Ҽ��˵�
            //toolmenu.AddItem(new MenuCommand.CommandZoomIn(), -1, toolmenu.Count, false, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandZoomOut(), -1, toolmenu.Count, false, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandPan(), -1, toolmenu.Count, true, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandExtent(), -1, toolmenu.Count, false, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandMouseSelect(), -1, toolmenu.Count, true, esriCommandStyles.esriCommandStyleTextOnly);
            ////toolmenu.AddItem(new MenuCommand.CommandRectanleSelect(), -1, toolmenu.Count, false, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandMeasureLength(), -1, toolmenu.Count, true, esriCommandStyles.esriCommandStyleTextOnly);
            //toolmenu.AddItem(new MenuCommand.CommandMeasureArea(), -1, toolmenu.Count, false, esriCommandStyles.esriCommandStyleTextOnly);
            //#endregion

            m_toolbarMenu = new ToolbarMenuClass();
            m_toolbarMenu.SetHook(hook);
            //��ӹ���/����
            //AddItem("esriControls.ControlsMapZoomOutFixedCommand", -1);
            //AddItem("esriControls.ControlsMapZoomInFixedCommand", -1);
            m_toolbarMenu.AddItem(new GIS.View.ZoomInTool(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.View.ZoomOutTool(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.View.PanTool(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.View.RefreshViewCommand(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.View.FullExtentTool(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            BeginGroup();
            m_toolbarMenu.AddItem(new GIS.GraphicEdit.FeatureSelect(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.GraphicModify.EditCopyCommand(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.GraphicModify.EditCutCommand(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            m_toolbarMenu.AddItem(new GIS.GraphicModify.EditPasteCommand(), -1, m_toolbarMenu.Count, false, esriCommandStyles.esriCommandStyleIconAndText);
            //BeginGroup();
            //AddItem("GIS.View.ZoomInTool",-1);
            //AddItem("GIS.View.ZoomOutTool", -1);
            //AddItem("GIS.View.PanTool", -1);
            //AddItem("GIS.View.RefreshViewCommand", -1);
            //AddItem("GIS.View.FullExtentCommand", -1);
            //BeginGroup(); //�ָ���
            ////AddItem("{380FB31E-6C24-4F5C-B1DF-47F33586B885}", -1); //����
            ////AddItem(new Guid("B0675372-0271-4680-9A2C-269B3F0C01E8"), -1); //����
            //AddItem("GIS.GraphicEdit.UndoEdit",-1);
            //AddItem("GIS.GraphicEdit.RedoEdit",-1);
            //BeginGroup();
            ////AddItem("esriControls.ControlsEditingCopyCommand", -1);
            ////AddItem("esriControls.ControlsEditingPasteCommand", -1);
            ////AddItem("esriControls.ControlsEditingCutCommand", -1);
            //AddItem("GIS.GraphicModify.EditCopyCommand", -1);
            //AddItem("GIS.GraphicModify.EditCutCommand", -1);
            //AddItem("GIS.GraphicModify.EditPasteCommand", -1);
        }
        /// <summary>
        /// Instantiate the underlying ToolbarMenu and set the hook object to be
        /// passed into the OnCreate event of each command item.
        /// </summary>
        public void SetHook(object hook)
        {
            m_toolbarMenu = new ToolbarMenuClass();
            m_toolbarMenu.SetHook(hook);

            //
            // TODO: Define context menu items here
            //
            //AddItem("esriControls.ControlsMapZoomOutFixedCommand", -1);
            //AddItem("esriControls.ControlsMapZoomInFixedCommand", -1);
            //BeginGroup(); //Separator
            //AddItem("{380FB31E-6C24-4F5C-B1DF-47F33586B885}", -1); //undo command
            //AddItem(new Guid("B0675372-0271-4680-9A2C-269B3F0C01E8"), -1); //redo command
            //BeginGroup(); //Separator
            //AddItem("MyCustomCommandCLSIDorProgID", -1);
        }
예제 #11
0
        private void axPageLayoutControl1_OnMouseUp(object sender, IPageLayoutControlEvents_OnMouseUpEvent e)
        {
            //Display the Popup Menu so that it appears to the right of the mouse click

            if (e.button == 2)
            {
                //Cast to the IToolbarMenu2 interface of the m_pToolbarMenu
                IToolbarMenu2 m_pToolbarMenu2 = (IToolbarMenu2)m_pToolbarMenu;

                //Align the Menu so that it appears to the right of the user mouse click
                m_pToolbarMenu2.AlignLeft = true;

                //Popup the menu
                m_pToolbarMenu.PopupMenu(e.x, e.y, axPageLayoutControl1.hWnd);
            }
        }
    /// <summary>
    /// Instantiate the underlying ToolbarMenu and set the hook object to be
    /// passed into the OnCreate event of each command item.
    /// </summary>
    public void SetHook(object hook)
    {
      m_toolbarMenu = new ToolbarMenuClass();
      m_toolbarMenu.SetHook(hook);

      //
      // TODO: Define context menu items here
      //
      //AddItem("esriControls.ControlsMapZoomOutFixedCommand", -1);
      //AddItem("esriControls.ControlsMapZoomInFixedCommand", -1);
      //BeginGroup(); //Separator
      //AddItem("{380FB31E-6C24-4F5C-B1DF-47F33586B885}", -1); //undo command
      //AddItem(new Guid("B0675372-0271-4680-9A2C-269B3F0C01E8"), -1); //redo command
      //BeginGroup(); //Separator
      //AddItem("MyCustomCommandCLSIDorProgID", -1);
    }
예제 #13
0
        /// <summary>
        /// class constructor
        /// </summary>
        /// <param name="hook"></param>
        public MapControlContextMenu(object hook)
        {
            int index = 0;

            m_menu = new ToolbarMenuClass();
            m_menu.AddItem(new MapZoomin(), -1, index++, false, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new MapZoomout(), -1, index++, false, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new MapZoominFixed(), -1, index++, false, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new MapZoomoutFixed(), -1, index++, false, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new MapZoompan(), -1, index++, true, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new MapZoomToLastExtentBack(), -1, index++, true, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new MapZoomToLastExtentFoward(), -1, index++, false, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new MapZoomfullextent(), -1, index++, true, esriCommandStyles.esriCommandStyleTextOnly);
            //Set the hook of each menu
            m_menu.SetHook(hook);
        }
예제 #14
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            //get the MapControl
            m_mapControl = (IMapControl3)axMapControl1.Object;

            //disable the Save menu (since there is no document yet)
            menuSaveDoc.Enabled = false;


            m_MenuTOC = new ToolbarMenuClass();
            //添加自定义菜单项到TOCCOntrol的图层菜单中
            m_MenuLayer  = new ToolbarMenuClass();
            m_TOCControl = (ITOCControl2)this.axTOCControl1.Object;
            m_MenuLayer.AddItem(new OpenAttributeTb(axMapControl1), -1, 0, true, esriCommandStyles.esriCommandStyleTextOnly);
            m_MenuLayer.SetHook(m_mapControl);
            m_MenuTOC.SetHook(m_mapControl);
        }
예제 #15
0
        /// <summary>
        /// class constructor
        /// </summary>
        /// <param name="hook"></param>
        public TocLayerContextMenu(object hook)
        {
            int index = 0;
            m_menu = new ToolbarMenuClass();
            m_menu.AddItem(new LayerThresholds(), 1, index++, false, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new LayerThresholds(), 2, index++, false, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new LayerThresholds(), 3, index++, false, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new LayerSelectable(), 1, index++, true, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new LayerSelectable(), 2, index++, false, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new LayerZoomTo()    ,-1, index++, true, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new LayerAnnotation(), 1, index++, true, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new LayerAnnotation(), 2, index++, false, esriCommandStyles.esriCommandStyleTextOnly);
            m_menu.AddItem(new LayerColor(), -1, index++, true, esriCommandStyles.esriCommandStyleTextOnly);
            //m_menu.AddItem(new LayerProperty(), -1, index++, true, esriCommandStyles.esriCommandStyleTextOnly);

            //Set the hook of each menu
            m_menu.SetHook(hook);
        }
예제 #16
0
 public void SetHook(object hook)
 {
     m_toolbarMenu = new ToolbarMenuClass();
     m_toolbarMenu.SetHook(hook);
 }