protected override void OnControlRemoved(ControlEventArgs e)
        {
            base.OnControlRemoved(e);
            //
            IDockPanel pDockPanel = e.Control as IDockPanel;

            if (pDockPanel != null)
            {
                this.SetPanelNodeState(pDockPanel, PanelNodeState.eClose);
                //pDockPanel.SetShowHideButton(false);
                pDockPanel.BeforeVisibleExValueSeted -= new BoolValueChangedEventHandler(DockPanel_BeforeVisibleExValueSeted);
            }
            //
            //
            //
            if (this.Controls.Count > 0)
            {
                return;
            }
            if (!this.IsDisposed && this.Visible)
            {
                this.Close();
            }
            this.Dispose();
            GC.Collect();
        }
Beispiel #2
0
        public override void _runCommand()
        {
            IForm      form_      = this._getOwner() as IForm;
            IDockPanel dockPanel_ = form_._childControl("dockPanel1") as IDockPanel;

            dockPanel_._showPad("solutionPad");
        }
Beispiel #3
0
 public void _showGraceful(string nWindowUrl, string nFormDescriptorUrl)
 {
     WindowSingleton windowSingleton_ = __singleton<WindowSingleton>._instance();
     mForm = windowSingleton_._loadForm(nFormDescriptorUrl);
     mDockPanel = mForm._childControl("dockPanel1") as IDockPanel;
     mForm._appShow();
 }
Beispiel #4
0
        public void DockTo(IDockPanel parent, DockPanelState state, int size)
        {
            if (parent != null && !parent.Visible)
            {
                return;     // no need to throw exception if it not visible
            }

            var ctrl = parent != null ? parent.Control : _parent;

            //首先先创建一个DockPanel,然后将控件加上去
            DevExpress.XtraBars.Docking.DockPanel panel = new DevExpress.XtraBars.Docking.DockPanel();
            panel.Name      = ((IDockPanelView)_control).DockName;
            panel.Header    = ((IDockPanelView)_control).Caption;
            panel.Image     = ((IDockPanelView)_control).Image;
            panel.Dock      = DockHelper.MapWindowToDevExpress(((IDockPanelView)_control).DefaultDock);
            panel.FloatSize = ((IDockPanelView)_control).DefaultSize;
            _control.Dock   = DockStyle.Fill;
            panel.Controls.Add(_control);

            if (parent != null)
            {
                DevExpress.XtraBars.Docking.DockPanel parentPanel = _dockingManager.Panels[parent.Name];
                if (parentPanel != null)
                {
                    parentPanel.Controls.Add(panel);
                }
            }
            else
            {
                _dockingManager.AddPanel(panel.Dock, panel);
            }
        }
 internal void SetDockPanel(IDockPanel pDockPanel)
 {
     if (this._pDockPanel == pDockPanel)
     {
         return;
     }
     this._pDockPanel = pDockPanel;
 }
Beispiel #6
0
 public WindowService(Form main)
 {
     this.main = main;
     if (SettingsService.idemode)
     {
         d = Runtime.DockFactory.Panel();
     }
 }
        private void SetPanelNodeState(IDockPanel pDockPanel, PanelNodeState panelNodeState)//设置其所辖的面板节点状态并激发相应事件(将在两个Show(...)和OnFormClosing(...)函数中被调用)
        {
            if (pDockPanel == null)
            {
                return;
            }
            //
            switch (panelNodeState)
            {
            case PanelNodeState.eShow:
                switch (pDockPanel.eDockPanelStyle)
                {
                case DockPanelStyle.eDockPanel:
                    DockPanel dockPanel = pDockPanel as DockPanel;
                    if (dockPanel != null)
                    {
                        ((ISetPanelNodeStateHelper)dockPanel).SetPanelNodeState(PanelNodeState.eShow);
                    }
                    break;

                case DockPanelStyle.eDockPanelContainer:
                    DockPanelContainer dockPanelContainer = pDockPanel as DockPanelContainer;
                    if (dockPanelContainer != null)
                    {
                        ((ISetPanelNodeStateHelper)dockPanelContainer).SetPanelNodeState(PanelNodeState.eShow);
                    }
                    break;

                default:
                    break;
                }
                break;

            case PanelNodeState.eClose:
                switch (pDockPanel.eDockPanelStyle)
                {
                case DockPanelStyle.eDockPanel:
                    DockPanel dockPanel = pDockPanel as DockPanel;
                    if (dockPanel != null)
                    {
                        ((ISetPanelNodeStateHelper)dockPanel).SetPanelNodeState(PanelNodeState.eClose);
                    }
                    break;

                case DockPanelStyle.eDockPanelContainer:
                    DockPanelContainer dockPanelContainer = pDockPanel as DockPanelContainer;
                    if (dockPanelContainer != null)
                    {
                        ((ISetPanelNodeStateHelper)dockPanelContainer).SetPanelNodeState(PanelNodeState.eClose);
                    }
                    break;

                default:
                    break;
                }
                break;
            }
        }
 public void Remove(IDockPanel panel)
 {
     if (panel == null)
     {
         throw new ArgumentException("panel");
     }
     _dockingManager.SetEnableDocking(panel.Control, false);
     _parent.Controls.Remove(panel.Control);
 }
 private void ResetDockPanel(IDockPanel pDockPanel)//将在两个Show(...)函数中被调用
 {
     pDockPanel.RemoveFromParent();
     //
     this.Size     = pDockPanel.DockPanelFloatFormSize;
     this.Location = pDockPanel.DockPanelFloatFormLocation;
     this.Controls.Add(pDockPanel as Control);
     //
     this.Owner = pDockPanel.DockPanelManager.ParentForm;
 }
Beispiel #10
0
        public void DockTo(IDockPanel parent, DockPanelState state, int size)
        {
            if (parent != null && !parent.Visible)
            {
                return;     // no need to throw exception if it not visible
            }

            var ctrl = parent != null ? parent.Control : _parent;

            _dockingManager.DockControl(_control, ctrl, DockHelper.MapWindowToSyncfusion(state), size);
        }
Beispiel #11
0
        public static void ValidateDock(IPanel targetPanel, ILayoutElement targetItem)
        {
            IDockPanel AsDockPanel = (IDockPanel)targetPanel;

            int ControlIndex = AsDockPanel.Items.IndexOf(targetItem);

            if (ControlIndex < 0 || ControlIndex + 1 >= AsDockPanel.Items.Count)
            {
                throw new ParsingException(15, targetItem.Source, $"DockPanel.Dock specified for '{targetItem.FriendlyName}' but this item is the last.");
            }
        }
Beispiel #12
0
        protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);
            //
            IDockPanel pDockPanel = e.Control as IDockPanel;

            if (pDockPanel == null)
            {
                this.Controls.Remove(e.Control); return;
            }
            pDockPanel.BeforeVisibleExValueSeted += new BoolValueChangedEventHandler(DockPanel_BeforeVisibleExValueSeted);
        }
 protected override void OnSizeChanged(EventArgs e)
 {
     base.OnSizeChanged(e);
     //
     if (this.Controls.Count > 0)
     {
         IDockPanel pDockPanel = this.Controls[0] as IDockPanel;
         if (pDockPanel != null)
         {
             pDockPanel.DockPanelFloatFormSize = this.Size;
         }
     }
 }
 protected override void OnLocationChanged(EventArgs e)
 {
     base.OnLocationChanged(e);
     //
     if (this.Controls.Count > 0)
     {
         IDockPanel pDockPanel = this.Controls[0] as IDockPanel;
         if (pDockPanel != null)
         {
             pDockPanel.DockPanelFloatFormLocation = this.Location;
         }
     }
 }
Beispiel #15
0
        public IDockPanel GetIDockPanel()//获取所包含的IDockPanel节点
        {
            IDockPanel pDockPanel = null;

            for (int i = 0; i < this.Controls.Count; i++)
            {
                pDockPanel = this.Controls[0] as IDockPanel;
                if (pDockPanel != null)
                {
                    return(pDockPanel);
                }
            }
            return(pDockPanel);
        }
Beispiel #16
0
        public DockPanelEventArgs(IDockPanel panel, string key)
        {
            if (panel == null)
            {
                throw new ArgumentNullException("panel");
            }
            if (string.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentNullException("key");
            }

            Panel = panel;
            Key   = key;
        }
        public IDockPanel GetIDockPanel()//获取所包含的IDockPanel节点
        {
            if (this.Controls.Count < 1)
            {
                return(null);
            }
            IDockPanel pDockPanel = this.Controls[0] as IDockPanel;

            if (pDockPanel == null)
            {
                return(null);
            }
            return(pDockPanel);
        }
Beispiel #18
0
        public override void _runCommand()
        {
            IDockPanel dockPanel_ = this._getOwner() as IDockPanel;
            IForm      form_      = dockPanel_._contain() as IForm;
            IToolPanel toolPanel_ = form_._childControl("toolPanel") as IToolPanel;

            if (dockPanel_._padsInHide() && toolPanel_._inHide())
            {
                toolPanel_._runShow();
            }
            else
            {
                dockPanel_._padsHide();
                toolPanel_._runHide();
            }
        }
        public void Show(IDockPanel pDockPanel, Point mousePoint)
        {
            this.ResetDockPanel(pDockPanel);
            //
            base.Show();
            //
            if (this.Controls.Count > 0)
            {
                Size size = this.Controls[0].Size;
                this.Size = new Size(size.Width + 2 * CRT_FORMBORDERSIZE, size.Height + CRT_CAPTIONHEIGHT + 2 * CRT_FORMBORDERSIZE);
            }
            //
            Rectangle rectangle = this.MoveRectangle;

            rectangle.Inflate(-1, -1);
            if (mousePoint.X > rectangle.Right)
            {
                mousePoint.X = rectangle.Right;
            }
            else if (mousePoint.X < rectangle.Left)
            {
                mousePoint.X = rectangle.Left;
            }
            //if (mousePoint.Y > rectangle.Bottom) mousePoint.Y = rectangle.Bottom;
            //else if (mousePoint.Y < rectangle.Top) mousePoint.Y = rectangle.Top;
            mousePoint.Y = (rectangle.Top + rectangle.Bottom / 2);
            //
            this.m_MousePoint = mousePoint;
            base.Location     = new Point(Form.MousePosition.X - this.m_MousePoint.X, Form.MousePosition.Y + this.m_MousePoint.Y);
            this.Opacity      = 1;
            //
            if (!this.DockPanelManager.IsDockLayoutState)
            {
                GISShare.Win32.API.PostMessage
                (
                    this.Handle,
                    (int)GISShare.Win32.Msgs.WM_NCLBUTTONDOWN,
                    0x02,
                    (uint)GISShare.Win32.NativeMethods.MousePositionToLParam(this.m_MousePoint)
                );    //0x00a1
            }
            //
            //
            //
            this.SetPanelNodeState(pDockPanel, PanelNodeState.eShow);
        }
        protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);
            //
            IDockPanel pDockPanel = e.Control as IDockPanel;

            if (pDockPanel == null)
            {
                this.Controls.Remove(e.Control); return;
            }
            if (pDockPanel.eDockPanelStyle == DockPanelStyle.eHoldDockPanel)
            {
                this.Controls.Remove(e.Control); return;
            }
            //pDockPanel.SetShowHideButton(false);
            pDockPanel.BeforeVisibleExValueSeted += new BoolValueChangedEventHandler(DockPanel_BeforeVisibleExValueSeted);
        }
 public void Show(IDockPanel pDockPanel)
 {
     this.ResetDockPanel(pDockPanel);
     //
     base.Show();
     //
     if (this.Controls.Count > 0)
     {
         Size size = this.Controls[0].Size;
         this.Size = new Size(size.Width + 2 * CRT_FORMBORDERSIZE, size.Height + CRT_CAPTIONHEIGHT + 2 * CRT_FORMBORDERSIZE);
         //IDockPanel pDockPanel = this.Controls[0] as IDockPanel;
         if (pDockPanel != null)
         {
             this.Location = pDockPanel.DockPanelFloatFormLocation;
         }
     }
     this.Opacity = 1;
     //
     //
     //
     this.SetPanelNodeState(pDockPanel, PanelNodeState.eShow);
 }
        public void Remove(IDockPanel panel, PluginIdentity identity)
        {
            if (panel == null)
            {
                throw new ArgumentException("panel");
            }

            if (!_dict.ContainsKey(panel.Control))
            {
                throw new ApplicationException("Dock panel isn't registed in the collection");
            }

            if (_dict[panel.Control].Identity == identity)
            {
                throw new ApplicationException(
                          "Invalid plugin identity. The panel can be removed only from the same plugin.");
            }

            _dockingManager.SetEnableDocking(panel.Control, false);
            _dict.Remove(panel.Control);
            _mainForm.Controls.Remove(panel.Control);
        }
Beispiel #23
0
 public DockPanelCancelEventArgs(IDockPanel panel, string key) : base(panel, key)
 {
 }
Beispiel #24
0
 public GeneratorDockPanel(IDockPanel panel)
     : base(panel)
 {
 }
Beispiel #25
0
 public Workbench()
 {
     mDockPanel = null;
     mForm = null;
 }
 public BaseDockPanelPopup(IDockPanel pDockPanel)
     : base()
 {
     this._pDockPanel = pDockPanel;
 }
Beispiel #27
0
 public void Show(IDockPanel panel, DockState state)
 {
     Show(panel as DockPanel, (W.DockState)state);
 }
 public DockPanelFloatFormPopup(IDockPanel pDockPanel)
     : base(pDockPanel)
 {
 }
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case (int)GISShare.Win32.Msgs.WM_NCLBUTTONDOWN:    //0x00a1
                if (m.WParam.ToInt32() == 0x02)
                {
                    //Point pt = PointToClient(new Point(MousePosition.X, MousePosition.Y));
                    GISShare.Win32.API.PostMessage(this.Handle, (int)GISShare.Win32.Msgs.WM_SETFOCUS, 0, 0);    //0x0007
                    GISShare.Win32.API.PostMessage
                    (
                        this.Handle,
                        (int)GISShare.Win32.Msgs.WM_LBUTTONDOWN,
                        0,
                        (uint)m.LParam //(uint)GISShare.Win32.NativeMethods.MousePositionToLParam(pt)
                    );                 //0x00201, pt.Y * 65536 + pt.X
                }
                else if (m.WParam.ToInt32() == 0x14)
                {
                    IDockPanel pDockPanel = GetIDockPanel();
                    if (pDockPanel != null)
                    {
                        pDockPanel.Close();
                    }
                    else
                    {
                        base.WndProc(ref m);
                    }
                }
                else
                {
                    base.WndProc(ref m);
                }
                break;

            case (int)GISShare.Win32.Msgs.WM_NCHITTEST:    //0x0084
                base.WndProc(ref m);
                //
                Point point = GISShare.Win32.NativeMethods.LParamToMouseLocation((int)m.LParam);
                point = PointToClient(point);
                if (point.X <= 3)
                {
                    if (point.Y <= 3)
                    {
                        m.Result = (IntPtr)GISShare.Win32.HitTests.HTTOPLEFT;    //const int HTTOPLEFT = 13;
                    }
                    else if (point.Y >= ClientSize.Height - 3)
                    {
                        m.Result = (IntPtr)GISShare.Win32.HitTests.HTBOTTOMLEFT;    //const int HTBOTTOMLEFT = 0x10;
                    }
                    else
                    {
                        m.Result = (IntPtr)GISShare.Win32.HitTests.HTLEFT;     //const int HTLEFT = 10;
                    }
                }
                else if (point.X >= ClientSize.Width - 3)
                {
                    if (point.Y <= 3)
                    {
                        m.Result = (IntPtr)GISShare.Win32.HitTests.HTTOPRIGHT;    //const int HTTOPRIGHT = 14;
                    }
                    else if (point.Y >= ClientSize.Height - 3)
                    {
                        m.Result = (IntPtr)GISShare.Win32.HitTests.HTBOTTOMRIGHT;    //const int HTBOTTOMRIGHT = 17;
                    }
                    else
                    {
                        m.Result = (IntPtr)GISShare.Win32.HitTests.HTRIGHT;     //const int HTRIGHT = 11;
                    }
                }
                else if (point.Y <= 3)
                {
                    m.Result = (IntPtr)GISShare.Win32.HitTests.HTTOP;    //const int HTTOP = 12;
                }
                else if (point.Y >= ClientSize.Height - 3)
                {
                    m.Result = (IntPtr)GISShare.Win32.HitTests.HTBOTTOM;    //const int HTBOTTOM = 15;
                }
                break;

            default:
                base.WndProc(ref m);
                break;
            }
        }
 public void SetMinimumSize(IDockPanel panel, Size size)
 {
     _dockingManager.SetControlMinimumSize(panel.Control, size);
 }
Beispiel #31
0
 bool IDockPanel.AddDockPanel(IDockPanel pDockPanel, DockStyle eDockStyle)
 {
     return(this.m_DockPanel.AddDockPanel(pDockPanel, eDockStyle));
 }