Ejemplo n.º 1
0
 private void axPageLayoutControl_OnMouseUp(object sender, IPageLayoutControlEvents_OnMouseUpEvent e)
 {
     if (_App.CurrentTool != null)
     {
         _Tool = _ToolCol[_App.CurrentTool];
         _Tool.OnMouseUp(e.button, e.shift, (int)e.pageX, (int)e.pageY);
     }
 }
Ejemplo n.º 2
0
 private void axPageLayoutControl_OnViewRefreshed(object sender, IPageLayoutControlEvents_OnViewRefreshedEvent e)
 {
     if (_App != null && _App.CurrentTool != null)
     {
         _Tool = _ToolCol[_App.CurrentTool];
         _Tool.Refresh(0);
     }
 }
Ejemplo n.º 3
0
 private void axPageLayoutControl_OnKeyUp(object sender, IPageLayoutControlEvents_OnKeyUpEvent e)
 {
     if (_App.CurrentTool != null)
     {
         _Tool = _ToolCol[_App.CurrentTool];
         _Tool.OnKeyUp(e.keyCode, e.shift);
     }
 }
Ejemplo n.º 4
0
 private void axPageLayoutControl_OnMouseDown(object sender, IPageLayoutControlEvents_OnMouseDownEvent e)
 {
     if (_App != null && _App.CurrentTool != null)
     {
         _Tool = _ToolCol[_App.CurrentTool];
         //左键
         if (e.button == 1)
         {
             _Tool.OnMouseDown(e.button, e.shift, (int)e.pageX, (int)e.pageY);
         }
         else if (e.button == 2)//右键
         {
             _Tool.OnContextMenu(e.x, e.y);
         }
     }
 }
Ejemplo n.º 5
0
 private void axMapControl_OnMouseUp(object sender, IMapControlEvents2_OnMouseUpEvent e)
 {
     if (_App.CurrentTool != null)
     {
         _Tool = _ToolCol[_App.CurrentTool];
         _Tool.OnMouseUp(e.button, e.shift, (int)e.mapX, (int)e.mapY);
     }
     statusButton2.Text = " 当前坐标X:" + e.mapX.ToString() + "  Y:" + e.mapY.ToString();
 }
Ejemplo n.º 6
0
 private void axPageLayoutControl_OnDoubleClick(object sender, IPageLayoutControlEvents_OnDoubleClickEvent e)
 {
     if (_App.CurrentTool != null)
     {
         _Tool = _ToolCol[_App.CurrentTool];
         _Tool.OnDblClick();
     }
 }
Ejemplo n.º 7
0
 private void axMapControl_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
 {
     if (_App.CurrentTool != null)
     {
         _Tool = _ToolCol[_App.CurrentTool];
         //左键
         if (e.button == 1)
         {
             _Tool.OnMouseDown(e.button, e.shift, (int)e.mapX, (int)e.mapY);
         }
         else if (e.button == 2)//右键
         {
             _Tool.OnContextMenu(e.x, e.y);
         }
     }
     statusButton2.Text = " 当前坐标X:" + e.mapX.ToString() + "  Y:" + e.mapY.ToString();
 }
Ejemplo n.º 8
0
 private void axMapControl_OnMouseMove(object sender, IMapControlEvents2_OnMouseMoveEvent e)
 {
     if (_App.CurrentTool != null)
     {
         _Tool = _ToolCol[_App.CurrentTool];
         _Tool.OnMouseMove(e.button, e.shift, (int)e.mapX, (int)e.mapY);
     }
     statusButton2.Text = " 当前坐标X:" + e.mapX.ToString() + "  Y:" + e.mapY.ToString();
     statusButton3.Text = "比例尺:" + ((long)(_mapControl.MapScale)).ToString();
 }
Ejemplo n.º 9
0
 private void axPageLayoutControl_OnViewRefreshed(object sender, IPageLayoutControlEvents_OnViewRefreshedEvent e)
 {
     try
     {
         if (_App != null && _App.CurrentTool != null)
         {
             _Tool = _ToolCol[_App.CurrentTool];
             _Tool.Refresh(0);
         }
     }
     catch (System.Exception ex)
     {
         return;
     }
 }
Ejemplo n.º 10
0
 private void axMapControl_OnKeyDown(object sender, IMapControlEvents2_OnKeyDownEvent e)
 {
     if (_App.CurrentTool != null)
     {
         _Tool = _ToolCol[_App.CurrentTool];
         _Tool.OnKeyDown(e.keyCode, e.shift);
     }
 }
Ejemplo n.º 11
0
 private void axPageLayoutControl_OnMouseUp(object sender, IPageLayoutControlEvents_OnMouseUpEvent e)
 {
     try
     {
         if (_App.CurrentTool != null)
         {
             _Tool = _ToolCol[_App.CurrentTool];
             _Tool.OnMouseUp(e.button, e.shift, (int)e.pageX, (int)e.pageY);
         }
     }
     catch (System.Exception ex)
     {
         return;
     }
 }
Ejemplo n.º 12
0
 private void axPageLayoutControl_OnKeyUp(object sender, IPageLayoutControlEvents_OnKeyUpEvent e)
 {
     try
     {
         if (_App.CurrentTool != null)
         {
             _Tool = _ToolCol[_App.CurrentTool];
             _Tool.OnKeyUp(e.keyCode, e.shift);
         }
     }
     catch (System.Exception ex)
     {
         return;
     }
 }
Ejemplo n.º 13
0
 private void axPageLayoutControl_OnDoubleClick(object sender, IPageLayoutControlEvents_OnDoubleClickEvent e)
 {
     try
     {
         if (_App.CurrentTool != null)
         {
             _Tool = _ToolCol[_App.CurrentTool];
             _Tool.OnDblClick();
         }
     }
     catch (System.Exception ex)
     {
         return;
     }
 }
Ejemplo n.º 14
0
 private void axMapControl_OnKeyDown(object sender, IMapControlEvents2_OnKeyDownEvent e)
 {
     try
     {
         if (_App.CurrentTool != null)
         {
             _Tool = _ToolCol[_App.CurrentTool];
             _Tool.OnKeyDown(e.keyCode, e.shift);
         }
     }
     catch (System.Exception ex)
     {
         return;
     }
 }
Ejemplo n.º 15
0
        /// <summary>
        /// 创建ToolBar的UI层对象
        /// </summary>
        /// <param name="toolBars"></param>
        private void CreateToolBars(Dictionary <string, MyPluginEngine.IToolBarDef> toolBars)
        {
            foreach (KeyValuePair <string, MyPluginEngine.IToolBarDef> toolbar in toolBars)
            {
                MyPluginEngine.IToolBarDef nbtoolbar = toolbar.Value;
                //产生UICommandBar对象
                //ToolStrip UIToolbar = new ToolStrip();
                RibbonPanel UIToolPanel = new RibbonPanel();
                //设置UICommandBar的属性
                //UIToolbar.CommandManager = this.uiCommandManager;
                UIToolPanel.Name = nbtoolbar.Name;
                //UIToolPanel.Text = nbtoolbar.Caption;
                UIToolPanel.Tag            = nbtoolbar;
                UIToolPanel.AccessibleName = nbtoolbar.ToString();
                UIToolPanel.Dock           = DockStyle.Fill;

                RibbonBar UIToolBar = new RibbonBar();
                //UIToolBar.Text = nbtoolbar.Caption;

                //将Command和Tool插入到ToolBar中
                MyPluginEngine.ItemDef itemDef = new ItemDef();
                for (int i = 0; i < nbtoolbar.ItemCount; i++)
                {
                    nbtoolbar.GetItemInfo(i, itemDef);
                    MyPluginEngine.ICommand nbcmd = m_DicPlugins[itemDef.ID] as MyPluginEngine.ICommand;
                    if (nbcmd != null)
                    {
                        //产生一个UICommand对象
                        //ToolStripButton UICommand = new ToolStripButton();
                        ButtonItem UICommand = new ButtonItem();
                        //UICommand.sty = ;
                        //根据ICommand的信息设置UICommand的属性
                        //UICommand.ToolTipText = nbcmd.Tooltip;
                        UICommand.Text           = nbcmd.Caption;
                        UICommand.Image          = nbcmd.Bitmap;
                        UICommand.AccessibleName = nbcmd.ToString();
                        UICommand.Enabled        = nbcmd.Enabled;
                        //UICommand的Checked与command的属性一致
                        UICommand.Checked = nbcmd.Checked;
                        //产生UICommand是调用OnCreate方法,将主框架对象传递给插件对象
                        nbcmd.OnCreate(this._App);
                        //使用委托机制处理Command的事件
                        //所有的UICommand对象Click事件均使用this.Command_Click方法处理
                        UICommand.Click += new EventHandler(UICommand_Click);
                        //将生成的UICommand添加到CommandManager中
                        //如果分组,则在该UI对象前加上一个分隔符
                        if (itemDef.Group)
                        {
                            UIToolBar = new RibbonBar();
                            //UIToolBar.Text = nbtoolbar.Caption;
                        }
                        UIToolBar.Items.Add(UICommand);
                    }

                    //获得一个ITool对象
                    MyPluginEngine.ITool nbtool = m_DicPlugins[itemDef.ID] as MyPluginEngine.ITool;
                    if (nbtool != null)
                    {
                        //产生一个ITool对象
                        //ToolStripButton UITool = new ToolStripButton();
                        ButtonItem UITool = new ButtonItem();
                        //UITool.DisplayStyle = ToolStripItemDisplayStyle.Image;
                        //根据ITool的信息设置UITool的属性
                        //UITool.ToolTipText = nbtool.Tooltip;
                        UITool.Text           = nbtool.Caption;
                        UITool.Image          = nbtool.Bitmap;
                        UITool.AccessibleName = nbtool.ToString();
                        //UITool.Key = nbtool.ToString();
                        UITool.Enabled = nbtool.Enabled;
                        UITool.Checked = nbtool.Checked;
                        //产生UICommand是调用OnCreate方法,将主框架对象传递给插件对象
                        nbtool.OnCreate(this._App);
                        //使用委托机制处理Command的事件
                        //所有的UICommand对象Click事件均使用this.UITool_Click方法处理
                        UITool.Click += new EventHandler(UITool_Click);
                        //将生成的UICommand添加到CommandManager中
                        if (itemDef.Group)
                        {
                            //UIToolbar.Items.Add(new ToolStripSeparator());
                            UIToolBar = new RibbonBar();
                            //UIToolBar.Text = nbtoolbar.Caption;
                            //UIToolBar.Items.Add();
                        }
                        UIToolBar.Items.Add(UITool);
                    }
                    UIToolPanel.Controls.Add(UIToolBar);
                }

                this.MainTool.Controls.Add(UIToolPanel);
            }
        }