コード例 #1
0
ファイル: DockBase.cs プロジェクト: Geinome/Gwen.Net
        /// <summary>
        /// Initializes an inner docked control for the specified position.
        /// </summary>
        /// <param name="pos">Dock position.</param>
        protected virtual void SetupChildDock(Dock pos)
        {
            if (m_DockedTabControl == null)
            {
                m_DockedTabControl                  = new DockedTabControl(this);
                m_DockedTabControl.TabRemoved      += OnTabRemoved;
                m_DockedTabControl.TabStripPosition = Dock.Bottom;
                m_DockedTabControl.TitleBarVisible  = true;
            }

            Dock = pos;

            Dock sizeDir;

            if (pos == Dock.Right)
            {
                sizeDir = Dock.Left;
            }
            else if (pos == Dock.Left)
            {
                sizeDir = Dock.Right;
            }
            else if (pos == Dock.Top)
            {
                sizeDir = Dock.Bottom;
            }
            else if (pos == Dock.Bottom)
            {
                sizeDir = Dock.Top;
            }
            else
            {
                throw new ArgumentException("Invalid dock", "pos");
            }

            if (m_Sizer != null)
            {
                m_Sizer.Dispose();
            }

            m_Sizer           = new Resizer(this);
            m_Sizer.Dock      = sizeDir;
            m_Sizer.ResizeDir = sizeDir;
            if (sizeDir == Dock.Left || sizeDir == Dock.Right)
            {
                m_Sizer.Width = 2;
            }
            else
            {
                m_Sizer.Height = 2;
            }
        }
コード例 #2
0
        /// <summary>
        /// Initializes an inner docked control for the specified position.
        /// </summary>
        /// <param name="pos">Dock position.</param>
        protected virtual void SetupChildDock(Pos pos)
        {
            if (m_DockedTabControl == null)
            {
                m_DockedTabControl                  = new DockedTabControl(this);
                m_DockedTabControl.TabRemoved      += OnTabRemoved;
                m_DockedTabControl.TabStripPosition = Pos.Bottom;
                m_DockedTabControl.TitleBarVisible  = true;
            }

            Dock = pos;

            Pos sizeDir;

            if (pos == Pos.Right)
            {
                sizeDir = Pos.Left;
            }
            else if (pos == Pos.Left)
            {
                sizeDir = Pos.Right;
            }
            else if (pos == Pos.Top)
            {
                sizeDir = Pos.Bottom;
            }
            else if (pos == Pos.Bottom)
            {
                sizeDir = Pos.Top;
            }
            else
            {
                throw new ArgumentException("Invalid dock", "pos");
            }

            if (m_Sizer != null)
            {
                m_Sizer.Dispose();
            }

            m_Sizer = new Resizer(this)
            {
                Dock      = sizeDir,
                ResizeDir = sizeDir
            };
            m_Sizer.SetSize(2, 2);
        }