Пример #1
0
 public override void Run()
 {
     try
     {
         if (!CommonPars.WorkspaceOpen)
         {
             Application.ActiveApplication.MessageBox.Show("未打开工程!");
             return;
         }
         if (Application.ActiveApplication.MainForm.FormManager.Count == 0)
         {
             Application.ActiveApplication.MessageBox.Show("未打开场景!");
             return;
         }
         else if (!(Application.ActiveApplication.MainForm.FormManager.ActiveForm is IFormScene))
         {
             Application.ActiveApplication.MessageBox.Show("未打开场景!");
             return;
         }
         else
         {
             IDockBar dockBar = Application.ActiveApplication.MainForm.DockBarManager[typeof(VisualMonitorSettingControl)];
             if (dockBar != null)
             {
                 dockBar.Visible = true;
                 (dockBar.Control as VisualMonitorSettingControl).MonitorType = MonitorType.SCADA;
             }
         }
     }
     catch (Exception ex)
     {
         Log.OutputBox(ex);
     }
 }
Пример #2
0
 public override void Run()
 {
     try
     {
         if (!CommonPars.WorkspaceOpen)
         {
             m_Application.MessageBox.Show("未打开工程!");
             return;
         }
         if (m_Application.MainForm.FormManager.Count == 0)
         {
             m_Application.MessageBox.Show("未打开场景!");
             return;
         }
         else if (!(m_Application.MainForm.FormManager.ActiveForm is IFormScene))
         {
             m_Application.MessageBox.Show("未打开场景!");
             return;
         }
         else
         {
             IDockBar dockBar = Application.ActiveApplication.MainForm.DockBarManager[typeof(FilesManagerControl)];
             if (dockBar != null)
             {
                 dockBar.Visible = true;
             }
         }
     }
     catch (Exception ex)
     {
         Log.OutputBox(ex);
     }
 }
        public AddOrRemoveDropDownList(IDockBar dockBar)
        {
            this.DropShadowEnabled = false;
            //
            AddOrRemoveDropDownItem item = new AddOrRemoveDropDownItem(dockBar);

            item.Overflow = ToolStripItemOverflow.Always;
            this.Items.Add(item);
        }
Пример #4
0
        override public void Run()
        {
            //To do your work.
            //Example:

            IDockBar   myDockBar = SuperMap.Desktop.Application.ActiveApplication.MainForm.DockBarManager[typeof(MyControl)];
            CheckState state     = this.Check();

            myDockBar.Visible = (state == CheckState.Checked) ? false : true;
        }
 protected override void OnClick(EventArgs e)
 {
     if (this.m_pDockBar == null)
     {
         this.m_pDockBar = this.Owner as IDockBar;
     }
     //
     this.SetMenuItemList();
     //
     base.OnClick(e);
 }
Пример #6
0
        private void MenuItemDockBar_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem toolStripMenuItem = sender as ToolStripMenuItem;

            if (toolStripMenuItem == null)
            {
                return;
            }
            IDockBar pDockBar = toolStripMenuItem.Tag as IDockBar;

            if (pDockBar == null)
            {
                return;
            }
            toolStripMenuItem.Checked = !toolStripMenuItem.Checked;
            pDockBar.VisibleEx        = toolStripMenuItem.Checked;
        }
Пример #7
0
 public void Show(IDockBar dockBar, Point location)
 {
     this.m_pDockBar = dockBar;
     //
     pDockBar.RemoveFromParent();
     pDockBar.Visible = true;
     //pDockBar.Dock = DockStyle.None;
     pDockBar.GripStyle   = ToolStripGripStyle.Hidden;//if (pDockBar.eDockBarStyle == DockBarStyle.eToolBar)
     pDockBar.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow;
     this.Controls.Add(pDockBar as Control);
     this.Owner    = pDockBar.DockBarManager.ParentForm;
     this.Location = location;
     if (this.IsDisposed)
     {
         return;
     }
     base.Show();
     //
     GISShare.Win32.API.SendMessage(this.Handle,
                                    (int)GISShare.Win32.Msgs.WM_LBUTTONDOWN,
                                    0,
                                    (uint)GISShare.Win32.NativeMethods.MousePositionToLParam(new Point(10, 10)));
     //
     this.pDockBar.Resize += new EventHandler(DockBar_Resize);
     this.pDockBar.BeforeVisibleExValueSeted += new BoolValueChangedEventHandler(DockBar_BeforeVisibleExValueSeted);
     //
     //if (pDockBar.eDockBarStyle == DockBarStyle.eToolBar) this.Width = pDockBar.Size.Width + 3;// 6 - 3
     //else this.Width = pDockBar.Size.Width;
     //this.Width = pDockBar.MaxLength;
     if (pDockBar.DockBarFloatFormSize.Width <= 0)
     {
         this.Width = pDockBar.MaxWidth + 2 * CRT_BOUNDSSPACE;
     }
     else
     {
         this.Width = pDockBar.DockBarFloatFormSize.Width;
     }
     //this.Height = pDockBar.Size.Height + 20;
     //this.m_MaxWidth = this.Width;
     //this.m_MinHeight = this.Height;
     //
     pDockBar.Dock        = DockStyle.Top;
     pDockBar.LayoutStyle = ToolStripLayoutStyle.Flow;
 }
Пример #8
0
 public void Show(IDockBar dockBar)
 {
     this.m_pDockBar = dockBar;
     //
     pDockBar.RemoveFromParent();
     pDockBar.Visible = true;
     //pDockBar.Dock = DockStyle.None;
     pDockBar.GripStyle   = ToolStripGripStyle.Hidden; //if (pDockBar.eDockBarStyle == DockBarStyle.eToolBar)
     pDockBar.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow;
     this.Controls.Add(pDockBar as Control);
     this.Owner    = pDockBar.DockBarManager.ParentForm;
     this.Location = pDockBar.DockBarFloatFormLocation;
     if (this.IsDisposed)
     {
         return;
     }
     base.Show();
     //
     pDockBar.Dock        = DockStyle.Top;
     pDockBar.LayoutStyle = ToolStripLayoutStyle.Flow;
     //
     this.pDockBar.Resize += new EventHandler(DockBar_Resize);
     this.pDockBar.BeforeVisibleExValueSeted += new BoolValueChangedEventHandler(DockBar_BeforeVisibleExValueSeted);
     //
     //if (pDockBar.eDockBarStyle == DockBarStyle.eToolBar) this.Width = pDockBar.Size.Width + 3;// 6 - 3
     //else this.Width = pDockBar.Size.Width;
     if (pDockBar.DockBarFloatFormSize.Width <= 0)
     {
         this.Width = pDockBar.MaxWidth + 2 * CRT_BOUNDSSPACE;
     }
     else
     {
         this.Width = pDockBar.DockBarFloatFormSize.Width;
     }
     //this.Height = pDockBar.Size.Height + 20;
     //this.m_MaxWidth = this.Width;
     //this.m_MinHeight = this.Height;
 }
 public AddOrRemoveDropDownItem(IDockBar dockBar)
     : this()//"添加或移除按钮"
 {
     this.m_pDockBar = dockBar;
 }
Пример #10
0
        private void checkedListBox_Bar_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = this.checkedListBox_Bar.SelectedIndex;

            if (index == 0)
            {
                if (this.m_DockBarManager.MenuBar != null)
                {
                    this.m_pDockBar = this.m_DockBarManager.MenuBar;
                }
                else if (this.m_DockBarManager.StatusBar != null)
                {
                    this.m_pDockBar = this.m_DockBarManager.StatusBar;
                }
                else if (index < this.m_DockBarManager.ToolBars.Count)
                {
                    this.m_pDockBar = this.m_DockBarManager.ToolBars[index];
                }
                else
                {
                    this.m_pDockBar = this.m_DockBarManager.CustomizeToolBars[index];
                }
            }
            else if (index == 1)
            {
                if (this.m_DockBarManager.MenuBar != null &&
                    this.m_DockBarManager.StatusBar != null)
                {
                    this.m_pDockBar = this.m_DockBarManager.StatusBar;
                }
                else if (index < this.m_DockBarManager.ToolBars.Count)
                {
                    this.m_pDockBar = this.m_DockBarManager.ToolBars[index];
                }
                else
                {
                    this.m_pDockBar = this.m_DockBarManager.CustomizeToolBars[index];
                }
            }
            else
            {
                if (this.m_DockBarManager.MenuBar != null)
                {
                    index--;
                }
                if (this.m_DockBarManager.StatusBar != null)
                {
                    index--;
                }
                if (index < this.m_DockBarManager.ToolBars.Count)
                {
                    this.m_pDockBar = this.m_DockBarManager.ToolBars[index];
                }
                else
                {
                    index          -= this.m_DockBarManager.ToolBars.Count;
                    this.m_pDockBar = this.m_DockBarManager.CustomizeToolBars[index];
                }
            }
            //
            if (this.m_pDockBar != null)
            {
                switch (this.m_pDockBar.eDockBarStyle)
                {
                case DockBarStyle.eMenuBar:
                case DockBarStyle.eToolBar:
                case DockBarStyle.eStatusBar:
                    this.button_RenameBar.Enabled = false;
                    this.button_DeleteBar.Enabled = false;
                    this.button_ResetBar.Enabled  = true;
                    break;

                case DockBarStyle.eCustomizeToolBar:
                    this.button_RenameBar.Enabled = true;
                    this.button_DeleteBar.Enabled = true;
                    this.button_ResetBar.Enabled  = true;
                    break;
                }
            }
            else
            {
                this.button_RenameBar.Enabled = false;
                this.button_DeleteBar.Enabled = false;
                this.button_ResetBar.Enabled  = false;
            }
        }