Exemplo n.º 1
0
        private void InternalConstruct(ContentWindow contentWindow, bool isFloatStyle)
        {
            IsFloatStyle = isFloatStyle;

            m_buttonClose    = new InertButton(ImageCloseEnabled, ImageCloseDisabled);
            m_buttonAutoHide = new InertButton(IsAutoHide ? ImageAutoHideYes : ImageAutoHideNo);

            m_buttonClose.ToolTipText = ToolTipClose;
            m_buttonClose.Anchor      = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonClose.Click      += new EventHandler(Close_Click);

            m_buttonAutoHide.ToolTipText = ToolTipAutoHide;
            m_buttonAutoHide.Anchor      = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonAutoHide.Click      += new EventHandler(AutoHide_Click);

            Controls.AddRange(new Control[] { m_buttonAutoHide, m_buttonClose });

            m_timerMouseTrack       = new Timer(components);
            m_timerMouseTrack.Tick += new EventHandler(TimerMouseTrack_Tick);

            if (isFloatStyle)
            {
                m_buttonAutoHide.Visible = false;
            }
        }
Exemplo n.º 2
0
        private void InternalConstruct(DockManager dockManager, ContentWindow contentWindow, bool boundsSpecified, Rectangle bounds)
        {
            m_contentWindows = new ContentWindowCollection();

            FormBorderStyle = FormBorderStyle.SizableToolWindow;
            ShowInTaskbar   = false;
            if (boundsSpecified)
            {
                Bounds        = bounds;
                StartPosition = FormStartPosition.Manual;
            }
            else
            {
                StartPosition = FormStartPosition.WindowsDefaultLocation;
            }

            m_dummyControl        = new Control();
            m_dummyControl.Bounds = Rectangle.Empty;
            Controls.Add(m_dummyControl);

            m_dockManager = dockManager;
            Owner         = DockManager.FindForm();
            DockManager.AddFloatWindow(this);
            if (contentWindow != null)
            {
                contentWindow.FloatWindow = this;
            }
        }
Exemplo n.º 3
0
        internal void InsertContentWindowBefore(ContentWindow cw, LayoutStyles layoutStyle, double layoutSize)
        {
            if (DockState == DockState.Float)
            {
                cw.FloatWindow = FloatWindow;
                int index = FloatWindow.ContentWindows.IndexOf(ContentWindow);
                FloatWindow.SetContentWindowIndex(cw, index);
            }
            else
            {
                int index = DockManager.ContentWindows.IndexOf(ContentWindow);
                DockManager.SetContentWindowIndex(cw, index);
            }
            cw.VisibleState = DockState;

            cw.TabWindow.LayoutStyle = layoutStyle;
            if (Next != null && layoutStyle == LayoutStyle)
            {
                cw.TabWindow.LayoutSize = (1 - LayoutSize) * layoutSize;
                LayoutSize *= (1 - layoutSize);
            }
            else
            {
                cw.TabWindow.LayoutSize = layoutSize;
            }

            cw.Refresh();
            ContentWindow.Refresh();
        }
Exemplo n.º 4
0
        public bool Contains(ContentWindow contentWindow)
        {
            if (contentWindow.DockState != DockState ||
                DockState == DockState.Hidden || DockState == DockState.Unknown ||
                DockHelper.IsDockStateAutoHide(DockState))
            {
                return(false);
            }

            if (DockState == DockState.Float)
            {
                if (FloatWindow != contentWindow.FloatWindow)
                {
                    return(false);
                }
                else
                {
                    return(FloatWindow.ContentWindows.IndexOf(contentWindow) > FloatWindow.ContentWindows.IndexOf(this));
                }
            }
            else
            {
                return(DockManager.ContentWindows.IndexOf(contentWindow) > DockManager.ContentWindows.IndexOf(this));
            }
        }
Exemplo n.º 5
0
        internal void SetText()
        {
            ContentWindow first          = null;
            int           visibleWindows = 0;

            foreach (ContentWindow cw in ContentWindows)
            {
                if (cw.DockState != DockState.Float)
                {
                    continue;
                }

                if (first == null)
                {
                    first = cw;
                }
                visibleWindows++;
            }

            if (visibleWindows == 1)
            {
                Text = (first.ActiveContent == null ? string.Empty : first.ActiveContent.Text);
            }
            else
            {
                Text = string.Empty;
            }
        }
Exemplo n.º 6
0
        internal int Add(ContentWindow cw)
        {
            if (InnerList.Contains(cw))
            {
                return(InnerList.IndexOf(cw));
            }

            return(InnerList.Add(cw));
        }
Exemplo n.º 7
0
 internal void Add(ContentWindow cw, ContentWindow beforeContentWindow)
 {
     if (beforeContentWindow == null)
     {
         Add(cw);
     }
     else
     {
         InnerList.Insert(IndexOf(beforeContentWindow), cw);
     }
 }
Exemplo n.º 8
0
 private void AutoHide_Click(object sender, EventArgs e)
 {
     ContentWindow.VisibleState = DockHelper.ToggleAutoHideState(DockState);
     if (IsAutoHide)
     {
         bool oldAnimateAutoHide = DockManager.AnimateAutoHide;
         DockManager.AnimateAutoHide       = false;
         DockManager.ActiveAutoHideContent = ActiveContent;
         DockManager.AnimateAutoHide       = oldAnimateAutoHide;
     }
     ContentWindow.Activate();
 }
Exemplo n.º 9
0
        public FloatWindow(DockManager dockManager, ContentWindow contentWindow, Rectangle bounds)
        {
            if (dockManager == null)
            {
                throw(new ArgumentNullException(ResourceHelper.GetString("FloatWindow.Constructor.NullDockManager")));
            }

            if (contentWindow == null)
            {
                throw(new ArgumentNullException(ResourceHelper.GetString("FloatWindow.Constructor.NullContentWindow")));
            }

            InternalConstruct(dockManager, contentWindow, true, bounds);
        }
Exemplo n.º 10
0
        internal void AddAt(ContentWindow cw, int index)
        {
            if (index < 0 || index > InnerList.Count - 1)
            {
                return;
            }

            if (Contains(cw))
            {
                return;
            }

            InnerList.Insert(index, cw);
        }
Exemplo n.º 11
0
        private Size m_sizeFrame;               // The size of the window including non client area. This variable
        // will be set in WM_NCCALCSIZE and used in WM_NCPAINT.

        public TabWindow(ContentWindow contentWindow)
        {
            m_contentWindow = contentWindow;

            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.Selectable, true);
            Font = SystemInformation.MenuFont;

            m_components = new Container();
            m_toolTip    = new ToolTip(m_components);
            m_splitter   = new TabWindowSplitter();
            Controls.Add(m_splitter);
        }
Exemplo n.º 12
0
        internal void RefreshContentWindows()
        {
            int visibleWindows = CountOfVisibleContentWindows;

            if (visibleWindows == 0)
            {
                if (Owner != null)
                {
                    Owner.Activate();
                }
                Hide();
                return;
            }

            ContentWindow first = null;
            ContentWindow prev  = null;

            foreach (ContentWindow cw in ContentWindows)
            {
                if (cw.DockState != DockState.Float)
                {
                    if (cw.TabWindowFloat != null)
                    {
                        cw.TabWindowFloat.SetParent(null);
                    }
                    continue;
                }

                if (first == null)
                {
                    first = cw;
                    cw.SetParent(this);
                    cw.TabWindow.Dock = DockStyle.Fill;
                }
                else
                {
                    cw.SetParent(prev.TabWindow);
                    cw.TabWindow.Dock = DockStyle.None;
                }
                ((DockWindow)cw.TabWindow).HasCaption = (visibleWindows > 1);
                cw.Refresh();
                prev = cw;
            }

            SetText();
            Show();
        }
Exemplo n.º 13
0
        protected override void OnTextChanged(EventArgs e)
        {
            if (m_hiddenMdiChild != null)
            {
                m_hiddenMdiChild.Text = this.Text;
            }
            if (ContentWindow != null)
            {
                if (ContentWindow.FloatWindow != null)
                {
                    ContentWindow.FloatWindow.SetText();
                }
                ContentWindow.Refresh();
            }

            base.OnTextChanged(e);
        }
Exemplo n.º 14
0
 public new void Activate()
 {
     if (DockManager == null)
     {
         base.Activate();
     }
     else if (ContentWindow == null)
     {
         Show(DockManager);
     }
     else
     {
         IsHidden = false;
         ContentWindow.ActiveContent = this;
         ContentWindow.Activate();
     }
 }
Exemplo n.º 15
0
        private void ContentWindow_OnDragging()
        {
            Point         ptMouse = Control.MousePosition;
            ContentWindow cw      = ((TabWindow)DragControl).ContentWindow;

            if (!TestDrop(ptMouse))
            {
                return;
            }

            if (DropTarget.DropTo == null && IsDockStateValid(DockState.Float))
            {
                Point location = new Point(ptMouse.X + m_mouseOffset.X, ptMouse.Y + m_mouseOffset.Y);
                Size  size;
                if (cw.FloatWindow == null)
                {
                    size = FloatWindow.DefaultWindowSize;
                }
                else if (cw.FloatWindow.ContentWindows.Count == 1)
                {
                    size = ((TabWindow)DragControl).ContentWindow.FloatWindow.Size;
                }
                else
                {
                    size = FloatWindow.DefaultWindowSize;
                }

                if (ptMouse.X > location.X + size.Width)
                {
                    location.X += ptMouse.X - (location.X + size.Width) + DragBorderWidth;
                }

                DragFrame = DrawHelper.CreateDragFrame(new Rectangle(location, size), DragBorderWidth);
            }

            if (DragFrame == null)
            {
                User32.SetCursor(Cursors.No.Handle);
            }
            else
            {
                User32.SetCursor(DragControl.Cursor.Handle);
            }
        }
Exemplo n.º 16
0
        public void SetContentWindowIndex(ContentWindow cw, int index)
        {
            int oldIndex = ContentWindows.IndexOf(cw);

            if (oldIndex == -1)
            {
                throw(new ArgumentException(ResourceHelper.GetString("FloatWindow.SetContentWindowIndex.InvalidContentWindow")));
            }

            if (index < 0 || index > ContentWindows.Count - 1)
            {
                if (index != -1)
                {
                    throw(new ArgumentOutOfRangeException(ResourceHelper.GetString("FloatWindow.SetContentWindowIndex.InvalidIndex")));
                }
            }

            if (oldIndex == index)
            {
                return;
            }
            if (oldIndex == ContentWindows.Count - 1 && index == -1)
            {
                return;
            }

            ContentWindows.Remove(cw);
            if (index == -1)
            {
                ContentWindows.Add(cw);
            }
            else if (oldIndex < index)
            {
                ContentWindows.AddAt(cw, index - 1);
            }
            else
            {
                ContentWindows.AddAt(cw, index);
            }

            RefreshContentWindows();
        }
Exemplo n.º 17
0
        internal void RemoveContentWindow(ContentWindow cw)
        {
            m_contentWindows.Remove(cw);
            if (Contains(cw.TabWindow))
            {
                cw.SetParent(null);
            }

            if (ContentWindows.Count == 0)
            {
                if (Owner != null)
                {
                    Owner.Activate();
                }
                Close();
            }
            else
            {
                RefreshContentWindows();
            }
        }
Exemplo n.º 18
0
        public void Show(DockManager dockManager, DockState dockState)
        {
            if (dockManager == null)
            {
                throw(new ArgumentNullException(ResourceHelper.GetString("Content.Show.NullDockManager")));
            }

            if (dockState == DockState.Unknown || dockState == DockState.Hidden)
            {
                throw(new ArgumentException(ResourceHelper.GetString("Content.Show.InvalidDockState")));
            }

            DockManager = dockManager;

            if (ContentWindow == null)
            {
                ContentWindow cwExisting = null;
                foreach (ContentWindow cw in DockManager.ContentWindows)
                {
                    if (cw.VisibleState == dockState)
                    {
                        cwExisting = cw;
                        break;
                    }
                }

                if (cwExisting == null || dockState == DockState.Float)
                {
                    ContentWindow = new ContentWindow(this, dockState);
                }
                else
                {
                    ContentWindow = cwExisting;
                }
            }

            Activate();
        }
Exemplo n.º 19
0
        public DocumentWindow(ContentWindow contentWindow) : base(contentWindow)
        {
            m_buttonClose       = new InertButton(ImageCloseEnabled, ImageCloseDisabled);
            m_buttonScrollLeft  = new InertButton(ImageScrollLeftEnabled, ImageScrollLeftDisabled);
            m_buttonScrollRight = new InertButton(ImageScrollRightEnabled, ImageScrollRightDisabled);

            m_buttonClose.ToolTipText = ToolTipClose;
            m_buttonClose.Anchor      = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonClose.Click      += new EventHandler(Close_Click);

            m_buttonScrollLeft.Enabled     = false;
            m_buttonScrollLeft.ToolTipText = ToolTipScrollLeft;
            m_buttonScrollLeft.Anchor      = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonScrollLeft.Click      += new EventHandler(ScrollLeft_Click);

            m_buttonScrollRight.Enabled     = false;
            m_buttonScrollRight.ToolTipText = ToolTipScrollRight;
            m_buttonScrollRight.Anchor      = AnchorStyles.Top | AnchorStyles.Right;
            m_buttonScrollRight.Click      += new EventHandler(ScrollRight_Click);

            Controls.AddRange(new Control[] { m_buttonScrollLeft,
                                              m_buttonScrollRight,
                                              m_buttonClose });
        }
Exemplo n.º 20
0
 internal void Remove(ContentWindow cw)
 {
     InnerList.Remove(cw);
 }
Exemplo n.º 21
0
        private void Content_OnEndDrag(bool abort)
        {
            User32.SetCursor(DragControl.Cursor.Handle);

            if (abort)
            {
                return;
            }

            Content content = ((TabWindow)DragControl).ActiveContent;

            if (DropTarget.DropTo is TabWindow)
            {
                TabWindow tabWindow = DropTarget.DropTo as TabWindow;

                if (DropTarget.Dock == DockStyle.Fill)
                {
                    bool sameContentWindow = (content.ContentWindow == tabWindow.ContentWindow);
                    if (!sameContentWindow)
                    {
                        content.ContentWindow = tabWindow.ContentWindow;
                    }

                    if (DropTarget.ContentIndex == -1 || !sameContentWindow)
                    {
                        tabWindow.ContentWindow.SetContentIndex(content, DropTarget.ContentIndex);
                    }
                    else
                    {
                        ContentCollection contents = content.ContentWindow.Contents;
                        int oldIndex = contents.IndexOf(content);
                        int newIndex = DropTarget.ContentIndex;
                        if (oldIndex < newIndex)
                        {
                            newIndex += 1;
                            if (newIndex > contents.Count - 1)
                            {
                                newIndex = -1;
                            }
                        }
                        tabWindow.ContentWindow.SetContentIndex(content, newIndex);
                    }

                    content.Activate();
                }
                else
                {
                    ContentWindow cw = new ContentWindow(content, tabWindow.DockState);
                    if (!tabWindow.ContentWindow.IsDisposed)
                    {
                        if (DropTarget.Dock == DockStyle.Left)
                        {
                            tabWindow.InsertContentWindowBefore(cw, LayoutStyles.Horizontal, 0.5);
                        }
                        else if (DropTarget.Dock == DockStyle.Right)
                        {
                            tabWindow.InsertContentWindowAfter(cw, LayoutStyles.Horizontal, 0.5);
                        }
                        else if (DropTarget.Dock == DockStyle.Top)
                        {
                            tabWindow.InsertContentWindowBefore(cw, LayoutStyles.Vertical, 0.5);
                        }
                        else if (DropTarget.Dock == DockStyle.Bottom)
                        {
                            tabWindow.InsertContentWindowAfter(cw, LayoutStyles.Vertical, 0.5);
                        }
                    }

                    cw.Activate();
                }
            }
            else if (DropTarget.DropTo is DockManager)
            {
                ContentWindow cw;
                if (DropTarget.Dock == DockStyle.Top)
                {
                    cw = new ContentWindow(content, DockState.DockTop);
                }
                else if (DropTarget.Dock == DockStyle.Bottom)
                {
                    cw = new ContentWindow(content, DockState.DockBottom);
                }
                else if (DropTarget.Dock == DockStyle.Left)
                {
                    cw = new ContentWindow(content, DockState.DockLeft);
                }
                else if (DropTarget.Dock == DockStyle.Right)
                {
                    cw = new ContentWindow(content, DockState.DockRight);
                }
                else if (DropTarget.Dock == DockStyle.Fill)
                {
                    cw = new ContentWindow(content, DockState.Document);
                }
                else
                {
                    return;
                }

                cw.DockManager.SetContentWindowIndex(cw, 0);
                cw.Activate();
            }
            else if (IsDockStateValid(DockState.Float))
            {
                Point         ptMouse = Control.MousePosition;
                ContentWindow cw      = content.ContentWindow;

                Size  size = FloatWindow.DefaultWindowSize;
                Point location;
                if (cw.DockState == DockState.Document)
                {
                    location = new Point(ptMouse.X + m_mouseOffset.X, ptMouse.Y + m_mouseOffset.Y);
                }
                else
                {
                    location = new Point(ptMouse.X + m_mouseOffset.X, ptMouse.Y + m_mouseOffset.Y - size.Height);
                }

                if (ptMouse.X > location.X + size.Width)
                {
                    location.X += ptMouse.X - (location.X + size.Width) + DragBorderWidth;
                }

                cw = new ContentWindow(content, new Rectangle(location, size));
                cw.Activate();
            }
        }
Exemplo n.º 22
0
        private void ContentWindow_OnEndDrag(bool abort)
        {
            User32.SetCursor(DragControl.Cursor.Handle);

            if (abort)
            {
                return;
            }

            ContentWindow cw = ((TabWindow)DragControl).ContentWindow;

            if (DropTarget.DropTo is TabWindow)
            {
                TabWindow tabWindow = DropTarget.DropTo as TabWindow;

                if (DropTarget.Dock == DockStyle.Fill)
                {
                    for (int i = cw.Contents.Count - 1; i >= 0; i--)
                    {
                        Content c = cw.Contents[i];
                        c.ContentWindow = tabWindow.ContentWindow;
                        if (DropTarget.ContentIndex != -1)
                        {
                            tabWindow.ContentWindow.SetContentIndex(c, DropTarget.ContentIndex);
                        }
                        c.Activate();
                    }
                }
                else
                {
                    if (DropTarget.Dock == DockStyle.Left)
                    {
                        tabWindow.InsertContentWindowBefore(cw, LayoutStyles.Horizontal, 0.5);
                    }
                    else if (DropTarget.Dock == DockStyle.Right)
                    {
                        tabWindow.InsertContentWindowAfter(cw, LayoutStyles.Horizontal, 0.5);
                    }
                    else if (DropTarget.Dock == DockStyle.Top)
                    {
                        tabWindow.InsertContentWindowBefore(cw, LayoutStyles.Vertical, 0.5);
                    }
                    else if (DropTarget.Dock == DockStyle.Bottom)
                    {
                        tabWindow.InsertContentWindowAfter(cw, LayoutStyles.Vertical, 0.5);
                    }

                    cw.Activate();
                }
            }
            else if (DropTarget.DropTo is DockManager)
            {
                if (DropTarget.Dock == DockStyle.Top)
                {
                    cw.VisibleState = DockState.DockTop;
                }
                else if (DropTarget.Dock == DockStyle.Bottom)
                {
                    cw.VisibleState = DockState.DockBottom;
                }
                else if (DropTarget.Dock == DockStyle.Left)
                {
                    cw.VisibleState = DockState.DockLeft;
                }
                else if (DropTarget.Dock == DockStyle.Right)
                {
                    cw.VisibleState = DockState.DockRight;
                }
                else if (DropTarget.Dock == DockStyle.Fill)
                {
                    cw.VisibleState = DockState.Document;
                }

                cw.DockManager.SetContentWindowIndex(cw, 0);
                cw.Activate();
            }
            else if (IsDockStateValid(DockState.Float))
            {
                Point ptMouse = Control.MousePosition;

                Point location = new Point(ptMouse.X + m_mouseOffset.X, ptMouse.Y + m_mouseOffset.Y);
                Size  size;
                bool  createFloatWindow = true;
                if (cw.FloatWindow == null)
                {
                    size = FloatWindow.DefaultWindowSize;
                }
                else if (cw.FloatWindow.ContentWindows.Count == 1)
                {
                    size = ((TabWindow)DragControl).ContentWindow.FloatWindow.Size;
                    createFloatWindow = false;
                }
                else
                {
                    size = FloatWindow.DefaultWindowSize;
                }

                if (ptMouse.X > location.X + size.Width)
                {
                    location.X += ptMouse.X - (location.X + size.Width) + DragBorderWidth;
                }

                if (createFloatWindow)
                {
                    cw.FloatWindow = new FloatWindow(cw.DockManager, cw, new Rectangle(location, size));
                }
                else
                {
                    cw.FloatWindow.Bounds = new Rectangle(location, size);
                }

                cw.VisibleState = DockState.Float;
                cw.Activate();
            }
        }
Exemplo n.º 23
0
 internal void AddContentWindow(ContentWindow cw)
 {
     m_contentWindows.Add(cw);
     RefreshContentWindows();
 }
Exemplo n.º 24
0
 private void Close_Click(object sender, EventArgs e)
 {
     ContentWindow.CloseActiveContent();
 }
Exemplo n.º 25
0
 public DockWindow(ContentWindow contentWindow) : base(contentWindow)
 {
     InternalConstruct(contentWindow, false);
 }
Exemplo n.º 26
0
 public int IndexOf(ContentWindow cw)
 {
     return(InnerList.IndexOf(cw));
 }
Exemplo n.º 27
0
 public bool Contains(ContentWindow cw)
 {
     return(InnerList.Contains(cw));
 }
Exemplo n.º 28
0
 public DockWindow(ContentWindow contentWindow, bool isFloat) : base(contentWindow)
 {
     InternalConstruct(contentWindow, true);
 }
Exemplo n.º 29
0
        private void FloatWindow_OnEndDrag(bool abort)
        {
            if (abort)
            {
                return;
            }

            FloatWindow floatWindow = (FloatWindow)DragControl;

            if (DropTarget.DropTo == null)
            {
                Rectangle rect = DragControl.Bounds;
                rect.X             = Control.MousePosition.X + m_mouseOffset.X;
                rect.Y             = Control.MousePosition.Y + m_mouseOffset.Y;
                DragControl.Bounds = rect;
            }
            else if (DropTarget.DropTo is TabWindow)
            {
                TabWindow tabWindow = DropTarget.DropTo as TabWindow;

                if (DropTarget.Dock == DockStyle.Fill)
                {
                    for (int i = floatWindow.ContentWindows.Count - 1; i >= 0; i--)
                    {
                        ContentWindow cw = floatWindow.ContentWindows[i];
                        for (int j = cw.Contents.Count - 1; j >= 0; j--)
                        {
                            Content c = cw.Contents[j];
                            c.ContentWindow = tabWindow.ContentWindow;
                            if (DropTarget.ContentIndex != -1)
                            {
                                tabWindow.ContentWindow.SetContentIndex(c, DropTarget.ContentIndex);
                            }
                            c.Activate();
                        }
                    }
                }
                else
                {
                    TabWindow lastTabWindow = null;
                    for (int i = floatWindow.ContentWindows.Count - 1; i >= 0; i--)
                    {
                        ContentWindow cw = floatWindow.ContentWindows[i];
                        if (i == floatWindow.ContentWindows.Count - 1)
                        {
                            if (DropTarget.Dock == DockStyle.Left)
                            {
                                tabWindow.InsertContentWindowBefore(cw, LayoutStyles.Horizontal, 0.5);
                            }
                            else if (DropTarget.Dock == DockStyle.Right)
                            {
                                tabWindow.InsertContentWindowAfter(cw, LayoutStyles.Horizontal, 0.5);
                            }
                            else if (DropTarget.Dock == DockStyle.Top)
                            {
                                tabWindow.InsertContentWindowBefore(cw, LayoutStyles.Vertical, 0.5);
                            }
                            else if (DropTarget.Dock == DockStyle.Bottom)
                            {
                                tabWindow.InsertContentWindowAfter(cw, LayoutStyles.Vertical, 0.5);
                            }
                        }
                        else
                        {
                            lastTabWindow.InsertContentWindowBefore(cw, cw.TabWindow.LayoutStyle, cw.TabWindow.LayoutSize);
                        }

                        lastTabWindow = cw.TabWindow;
                    }
                }
            }
            else if (DropTarget.DropTo is DockManager)
            {
                for (int i = floatWindow.ContentWindows.Count - 1; i >= 0; i--)
                {
                    ContentWindow cw = floatWindow.ContentWindows[i];
                    if (DropTarget.Dock == DockStyle.Top)
                    {
                        cw.VisibleState = DockState.DockTop;
                    }
                    else if (DropTarget.Dock == DockStyle.Bottom)
                    {
                        cw.VisibleState = DockState.DockBottom;
                    }
                    else if (DropTarget.Dock == DockStyle.Left)
                    {
                        cw.VisibleState = DockState.DockLeft;
                    }
                    else if (DropTarget.Dock == DockStyle.Right)
                    {
                        cw.VisibleState = DockState.DockRight;
                    }
                    else if (DropTarget.Dock == DockStyle.Fill)
                    {
                        cw.VisibleState = DockState.Document;
                    }

                    cw.DockManager.SetContentWindowIndex(cw, 0);
                    cw.LayoutDock = cw.LayoutFloat;
                    cw.SizeDock   = cw.SizeFloat;
                    floatWindow.ContentWindows[i].Activate();
                }
            }
        }
Exemplo n.º 30
0
 internal void AddAt(ContentWindow cw, ContentWindow beforeContentWindow)
 {
     AddAt(cw, IndexOf(beforeContentWindow));
 }