private System.Windows.Forms.TabAlignment m_TabAlignment = System.Windows.Forms.TabAlignment.Bottom; //记录隐藏区按钮的绘制状态
        #endregion

        public HideAreaTabButtonItem(int iBasePanelID, string text, Image image, TabAlignment eAlignment)
            : base()
        {
            base.Text           = text;
            base.Image          = image;
            this.m_BasePanelID  = iBasePanelID;
            this.m_TabAlignment = eAlignment;
        }
        private void SetDockPanelHideAreaControl()//设置隐藏按钮组并将其加载到对应的隐藏区内(在构造函数里完成)
        {
            DockStyle     eDockStyle;
            DockAreaStyle eDockAreaStyle = this.m_DockPanel.GetDockAreaStyle(out eDockStyle);

            switch (eDockStyle)//添加后会自动处理布局信息
            {
            case DockStyle.Top:
                this.m_AlignmentStyle = TabAlignment.Top;
                this.DockPanelManager.DockPanelHideAreaTop.AddHideAreaTabButtonGroup(this);
                break;

            case DockStyle.Left:
                this.m_AlignmentStyle = TabAlignment.Left;
                this.DockPanelManager.DockPanelHideAreaLeft.AddHideAreaTabButtonGroup(this);
                break;

            case DockStyle.Right:
                this.m_AlignmentStyle = TabAlignment.Right;
                this.DockPanelManager.DockPanelHideAreaRight.AddHideAreaTabButtonGroup(this);
                break;

            case DockStyle.Bottom:
                this.m_AlignmentStyle = TabAlignment.Bottom;
                this.DockPanelManager.DockPanelHideAreaBottom.AddHideAreaTabButtonGroup(this);
                break;

            default:
                break;
            }
            //
            //
            //
            for (int i = 0; i < this.m_DockPanel.BasePanelCount; i++)
            {
                BasePanel temp = this.m_DockPanel.GetBasePanel(i) as BasePanel;
                if (temp == null)
                {
                    continue;
                }
                HideAreaTabButton hideAreaTabButton = new HideAreaTabButton(i, temp.Text, temp.Image, this.eAlignmentStyle);
                this.AddHideAreaTabButton(hideAreaTabButton);
                hideAreaTabButton.MouseClick += new MouseEventHandler(HideAreaTabButton_MouseClick);
                hideAreaTabButton.MouseHover += new EventHandler(HideAreaTabButtonGroupItem_MouseHover);
                hideAreaTabButton.MouseLeave += new EventHandler(HideAreaTabButtonGroupItem_MouseLeave);
            }
        }
Exemplo n.º 3
0
        private void SetDockPanelHideAreaControl()//设置隐藏按钮组并将其加载到对应的隐藏区内(在构造函数里完成)
        {
            DockStyle     eDockStyle;
            DockAreaStyle eDockAreaStyle = this.m_DockPanel.GetDockAreaStyle(out eDockStyle);

            switch (eDockStyle)//添加后会自动处理布局信息
            {
            case DockStyle.Top:
                this.m_TabAlignment = TabAlignment.Top;
                this.DockPanelManager.DockPanelHideAreaTop.BaseItems.Add(this);
                break;

            case DockStyle.Left:
                this.m_TabAlignment = TabAlignment.Left;
                this.DockPanelManager.DockPanelHideAreaLeft.BaseItems.Add(this);
                break;

            case DockStyle.Right:
                this.m_TabAlignment = TabAlignment.Right;
                this.DockPanelManager.DockPanelHideAreaRight.BaseItems.Add(this);
                break;

            case DockStyle.Bottom:
                this.m_TabAlignment = TabAlignment.Bottom;
                this.DockPanelManager.DockPanelHideAreaBottom.BaseItems.Add(this);
                break;

            default:
                break;
            }
            //
            //
            //
            for (int i = 0; i < this.m_DockPanel.BasePanels.Count; i++)
            {
                BasePanel temp = this.m_DockPanel.BasePanels[i] as BasePanel;
                if (temp == null)
                {
                    continue;
                }
                HideAreaTabButtonItem hideAreaTabButtonItem = new HideAreaTabButtonItem(i, temp.Text, temp.Image, this.TabAlignment);
                this.BaseItems.Add(hideAreaTabButtonItem);
                hideAreaTabButtonItem.MouseDown  += new MouseEventHandler(HideAreaTabButtonItem_MouseDown);
                hideAreaTabButtonItem.MouseEnter += new EventHandler(HideAreaTabButtonItem_MouseEnter);
                hideAreaTabButtonItem.MouseLeave += new EventHandler(HideAreaTabButtonItem_MouseLeave);
            }
        }
Exemplo n.º 4
0
        public static DockPosition ToEto(this swf.TabAlignment alignment)
        {
            switch (alignment)
            {
            case swf.TabAlignment.Top:
                return(DockPosition.Top);

            case swf.TabAlignment.Bottom:
                return(DockPosition.Bottom);

            case swf.TabAlignment.Left:
                return(DockPosition.Left);

            case swf.TabAlignment.Right:
                return(DockPosition.Right);

            default:
                throw new NotSupportedException();
            }
        }