Ejemplo n.º 1
0
        internal void Relayout()//布局管理,防止停靠时出现遮盖情况
        {
            DockPanelManager dockPanelManager = this.DockPanelManager;

            if (dockPanelManager == null)
            {
                return;
            }
            Size size = dockPanelManager.GetParentFormWorkRegionSize(false);

            //
            switch (this.Dock)
            {
            case DockStyle.Top:
            case DockStyle.Bottom:
                if (size.Height < this.OuterMinWidth)
                {
                    dockPanelManager.RelayoutDockAreas(Orientation.Vertical, this.OuterMinWidth);
                }
                break;

            case DockStyle.Left:
            case DockStyle.Right:
                if (size.Width < this.OuterMinWidth)
                {
                    dockPanelManager.RelayoutDockAreas(Orientation.Horizontal, this.OuterMinWidth);
                }
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            //
            DockPanelManager dockPanelManager = this.DockPanelManager;

            if (dockPanelManager != null)
            {
                Size size = dockPanelManager.GetParentFormWorkRegionSize(false);
                this.OutSize = new Size(size.Width + this.Width - (this.OuterMinWidth + this.SplitLineWidth), size.Height + this.Height - (this.OuterMinWidth + this.SplitLineWidth));
            }
            //else { this.OutSize = new Size(this.Parent.Width - (this.OuterMinWidth + this.SplitLineWidth), this.Parent.Height - (this.OuterMinWidth + this.SplitLineWidth)); }
        }
Ejemplo n.º 3
0
        protected override void SetOutSize()//在鼠标按下时计算OutSize
        {
            if (this.m_DockPanel != null)
            {
                ((ISetDockPanelHelper)this.m_DockPanel).SetActiveState(this.m_DockPanel);
            }
            //
            DockPanelManager dockPanelManager = this.DockPanelManager;

            if (dockPanelManager != null)
            {
                Size size = dockPanelManager.GetParentFormWorkRegionSize(false, this.SplitPanelDock);
                this.OutSize = new Size(size.Width /*+ this.Width*/ - (this.OuterMinWidth + this.SplitLineWidth), size.Height /*+ this.Height*/ - (this.OuterMinWidth + this.SplitLineWidth));
            }
            //else { this.OutSize = new Size(this.Parent.Width - (this.OuterMinWidth + this.SplitLineWidth), this.Parent.Height - (this.OuterMinWidth + this.SplitLineWidth)); }
        }