Example #1
0
        protected override void OnControlRemoved(ControlEventArgs e)
        {
            base.OnControlRemoved(e);
            //
            //
            //
            DockPanel dockPanel = e.Control as DockPanel;

            if (dockPanel == null)
            {
                return;
            }
            //dockPanel.SetShowHideButton(false);
            //dockPanel.TabButtonList.AutoVisible = true;
            dockPanel.BeforeVisibleExValueSeted -= new BoolValueChangedEventHandler(DockPanel_BeforeVisibleExValueSeted);
            dockPanel.DockPanelActiveChanged    -= new BoolValueChangedEventHandler(DockPanel_DockPanelActiveChanged);
            //
            if (this.Controls.Count > 0)
            {
                return;
            }
            //
            this.Close();
            //
            this.m_DockPanel = null;
            this.m_HideAreaTabButtonGroupItem = null;
        }
Example #2
0
        public void Show(DockPanel dockPanel, HideAreaTabButtonGroupItem hideAreaTabButtonGroupItem)//展现隐藏面板
        {
            if (dockPanel == null)
            {
                return;
            }
            //
            if (base.Visible)
            {
                this.Close();
            }
            //
            if (!this.Controls.Contains(dockPanel))
            {
                this.Controls.Clear();
                this.Size = dockPanel.Size;//key
                //dockPanel.Dock = DockStyle.Fill;
                this.Controls.Add(dockPanel);
                this.m_DockPanel = dockPanel;
                this.m_HideAreaTabButtonGroupItem = hideAreaTabButtonGroupItem;
            }
            //
            switch (this.m_HideAreaTabButtonGroupItem.TabAlignment)
            {
            case TabAlignment.Top:
                this.SplitPanelDock = DockStyle.Top;
                break;

            case TabAlignment.Left:
                this.SplitPanelDock = DockStyle.Left;
                break;

            case TabAlignment.Right:
                this.SplitPanelDock = DockStyle.Right;
                break;

            case TabAlignment.Bottom:
                this.SplitPanelDock = DockStyle.Bottom;
                break;
            }
            //
            if (!base.Visible)
            {
                //this.UpdateLayout();
                this.ShowAnimation(this.bHaveAnimation);
                if (!this.m_DockPanel.Visible)
                {
                    this.m_DockPanel.Visible = true;                           //key
                }
                //base.Visible = true;
            }
            //
            //
            //
            if (this.DockPanel != null)
            {
                ((ISetPanelNodeStateHelper)this.DockPanel).SetPanelNodeState(PanelNodeState.eShow);
            }
        }
Example #3
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         this.m_DockPanel = null;
         this.m_HideAreaTabButtonGroupItem.Dispose();
         this.m_HideAreaTabButtonGroupItem = null;
     }
     //
     base.Dispose(disposing);
 }
Example #4
0
 public void HoldAndHide()//占位并隐藏实体项
 {
     //DockPanel不是隐藏状态、隐藏区HideAreaTabButtonGroupItem已存在、DockPanel的停靠区不是DockPanelDockArea   跳出
     if (!this.m_DockPanel.IsHideState ||
         this.HideAreaTabButtonGroupItem != null ||
         this.m_DockPanel.GetDockAreaStyle() != DockAreaStyle.eDockPanelDockArea)
     {
         return;
     }
     //
     //
     //
     this.m_HideAreaTabButtonGroupItem = new HideAreaTabButtonGroupItem(this.m_DockPanel);//创建停靠区内的隐藏选项卡组 key
     //
     //从父容器中移除 -> 加入到DockPanel的父容器中起占位作用   顺序不能变
     this.LostFocusEx();
     this.RemoveFromParent();
     this.m_DockPanel.Parent.Controls.Add(this);
     //使DockPanel失去焦点 -> 从父容器中移除   顺序不能变
     this.m_DockPanel.LostFocusEx();//使其失去焦点 key
     this.m_DockPanel.RemoveFromParent();
     //设置VisibleEx属性 激发相关事件
     this.VisibleEx = false;//key false
 }