Пример #1
0
        public void Initialize(IMapWin mapWin, int parenthandle)
        {
            m_MapWin            = mapWin;
            this.m_ParentHandle = parenthandle;

            CreateToolbarAndMenu();
        }
Пример #2
0
 public void Terminate()
 {
     MapWinGIS.Interfaces.Toolbar toolbar = m_MapWin.Toolbar;
     toolbar.RemoveButton("tlbPlugintest");
     toolbar.RemoveButton("sep");
     toolbar.RemoveButton("sep1");
     toolbar.RemoveComboBox("comboBox1");
     toolbar.RemoveToolbar("tlbPluginSample1");
     this.m_MapWin = null;
 }
Пример #3
0
        public void Initialize(IMapWin mapWin, int parenthandle)
        {
            this.m_MapWin       = mapWin;
            this.m_ParentHandle = parenthandle;

            MapWinGIS.Interfaces.Toolbar toolbar = m_MapWin.Toolbar;
            if (toolbar.AddToolbar("tlbPluginSample1"))
            {
                MapWinGIS.Interfaces.ToolbarButton btn = toolbar.AddButton("tlbPlugintest", "tlbPluginSample1", false);
                btn.BeginsGroup = true;
                btn.Text        = "测试";
                btn.Tooltip     = "测试按钮";
                btn.Picture     = res.GetObject("sample");

                toolbar.AddButtonDropDownSeparator("sep", "tlbPluginSample1", "tlbPlugintest");
                toolbar.AddButtonDropDownSeparator("sep1", "tlbZoom", "tbbZoomExtent");
                MapWinGIS.Interfaces.ComboBoxItem cmb = toolbar.AddComboBox("comboBox1", "tlbPluginSample1", "tlbPlugintest");
                cmb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            }
        }
Пример #4
0
        public void Initialize(IMapWin mapWin, int parenthandle)
        {
            this.m_MapWin       = mapWin;
            this.m_ParentHandle = parenthandle;

            MapWinGIS.Interfaces.UIPanel myFormPanel = m_MapWin.UIPanel;
            Panel panel = myFormPanel.CreatePanel("测试窗体", MapWinGISDockStyle.None);

            MapWinGIS.Interfaces.OnPanelClose panelClose = this.OnFormClose;
            //MapWinGIS.Interfaces.OnPanelClose panel2close = this.OnForm2Close;
            System.Windows.Forms.Form form = panel.Parent as System.Windows.Forms.Form;
            if (form != null)
            {
                form.StartPosition = FormStartPosition.CenterScreen;
            }

            Button btn = new Button();

            btn.Name     = "btn";
            btn.Text     = "确定";
            btn.Location = new System.Drawing.Point(20, 20);
            btn.Size     = new System.Drawing.Size(75, 25);

            Button btn2 = new Button();

            btn2.Name     = "btn2";
            btn2.Text     = "取消";
            btn2.Location = new System.Drawing.Point(70, 100);
            btn2.Size     = new System.Drawing.Size(75, 25);

            //panel.Controls.AddRange(new System.Windows.Forms.Control[] { btn, btn2 });
            panel.Controls.Add(btn);
            panel.Controls.Add(btn2);

            m_MapWin.UIPanel.AddOnCloseHandler("测试窗体", panelClose);
        }
Пример #5
0
 /// <summary>
 /// 初始化插件
 /// </summary>
 /// <param name="app">The app.</param>
 /// <param name="parentHandle">The parent handle.</param>
 public virtual void Initialize(IMapWin app, int parentHandle)
 {
     this.App          = app;
     this.ParentHandle = parentHandle;
     this.Initialize();
 }
Пример #6
0
        //  SimMain scConvas;

        //This event is fired when the user loads your plug-in either through the plug-in dialog
        //box, or by checkmarking it in the plug-ins menu.  This is where you would add buttons to the
        //tool bar or menu items to the menu.
        //It is also standard to set a global reference to the IMapWin that is passed through here so that
        //you can access it elsewhere in your project to act on MapWindow.
        public void Initialize(MapWindow.Interfaces.IMapWin m_MapWin, int ParentHandle)
        {
            this.mMapWin = m_MapWin;
            this.convas  = (Form)Control.FromHandle(new IntPtr(ParentHandle));
            //conv
            ResourceManager res     = new ResourceManager("GISTranSim.Properties.Resources", Assembly.GetExecutingAssembly());
            Toolbar         toolbar = mMapWin.Toolbar;;

            toolbar.AddToolbar(strToolBar);
            if (strToolBar.Length > 0)
            {
                toolbar.AddToolbar(strToolBar);
            }

            TBTN_Config          = toolbar.AddButton(strBTNConfig, strToolBar, string.Empty, string.Empty);
            TBTN_Config.Tooltip  = "配置仿真应用程序";
            TBTN_Config.Category = strToolBar;
            TBTN_Config.Picture  = res.GetObject("Config");
            TBTN_Config.Enabled  = true;

            TBTN_Config.Text = strBTNConfig; //this.res.GetString("textCreateShp");

            TBTN_Run          = toolbar.AddButton(strBTNRun, strToolBar, false);
            TBTN_Run.Category = strToolBar;
            TBTN_Run.Text     = strBTNRun;
            TBTN_Run.Tooltip  = "运行仿真应用程序";
            TBTN_Run.Enabled  = false;
            TBTN_Run.Picture  = res.GetObject("Run");


            TBTN_Pause          = toolbar.AddButton(strBTNPause, strToolBar, false);
            TBTN_Pause.Category = strToolBar;
            TBTN_Pause.Text     = strBTNPause;
            TBTN_Pause.Tooltip  = "停止仿真程序";
            TBTN_Pause.Enabled  = false;
            TBTN_Pause.Picture  = res.GetObject("Pause");


            TBTN_ChartSpeedTime          = toolbar.AddButton(strBTNSpaceTime, strToolBar, false);
            TBTN_ChartSpeedTime.Category = strToolBar;
            TBTN_ChartSpeedTime.Text     = strBTNSpaceTime;
            TBTN_ChartSpeedTime.Tooltip  = "输出时空图像";
            TBTN_ChartSpeedTime.Enabled  = false;
            TBTN_ChartSpeedTime.Picture  = res.GetObject("Chart2");


            TBTN_ChartSpaceTime          = toolbar.AddButton(strBTNSpeedTime, strToolBar, false);
            TBTN_ChartSpaceTime.Category = strToolBar;
            TBTN_ChartSpaceTime.Text     = strBTNSpeedTime;
            TBTN_ChartSpaceTime.Tooltip  = "输出速度时间图像";
            TBTN_ChartSpaceTime.Enabled  = false;
            TBTN_ChartSpaceTime.Picture  = res.GetObject("Chart1");


            TBTN_ChartMeanSpeed          = toolbar.AddButton(strBTNMeanSpeed, strToolBar, false);
            TBTN_ChartMeanSpeed.Category = strToolBar;
            TBTN_ChartMeanSpeed.Text     = strBTNSpeedTime;
            TBTN_ChartMeanSpeed.Tooltip  = "输出平均速度图像";
            TBTN_ChartMeanSpeed.Enabled  = false;
            TBTN_ChartMeanSpeed.Picture  = res.GetObject("Save");

            TBTN_ShowData          = toolbar.AddButton(strBTNShowData, strToolBar, false);
            TBTN_ShowData.Category = strToolBar;
            TBTN_ShowData.Text     = strBTNShowData;
            TBTN_ShowData.Tooltip  = "输出仿真数据";
            TBTN_ShowData.Enabled  = false;
            TBTN_ShowData.Picture  = res.GetObject("Data");
        }
Пример #7
0
 /// <summary>
 /// 插件加载时由宿主程序调用
 /// </summary>
 /// <param name="mapWin">和宿主程序交互</param>
 /// <param name="parenthandle">MainProgram form 的handle</param>
 public void Initialize(IMapWin mapWin, int parenthandle)
 {
 }