Example #1
0
        private void InternalConstruct(IDockContent content, DockState dockState, bool flagBounds, Rectangle floatWindowBounds, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
        {
            if (dockState == DockState.Hidden || dockState == DockState.Unknown)
            {
                throw new ArgumentException(Strings.DockPane_SetDockState_InvalidState);
            }

            if (content == null)
            {
                throw new ArgumentNullException(Strings.DockPane_Constructor_NullContent);
            }

            if (content.DockHandler.DockPanel == null)
            {
                throw new ArgumentException(Strings.DockPane_Constructor_NullDockPanel);
            }


            SuspendLayout();
            SetStyle(ControlStyles.Selectable, false);

            m_isFloat = (dockState == DockState.Float);

            m_contents           = new DockContentCollection();
            m_displayingContents = new DockContentCollection(this);
            m_dockPanel          = content.DockHandler.DockPanel;
            m_dockPanel.AddPane(this);

            m_splitter = content.DockHandler.DockPanel.Extender.DockPaneSplitterControlFactory.CreateSplitterControl(this);

            m_nestedDockingStatus = new NestedDockingStatus(this);

            m_captionControl  = DockPanel.DockPaneCaptionFactory.CreateDockPaneCaption(this);
            m_tabStripControl = DockPanel.DockPaneStripFactory.CreateDockPaneStrip(this);
            Controls.AddRange(new Control[] { m_captionControl, m_tabStripControl });

            DockPanel.SuspendLayout(true);
            if (flagBounds)
            {
                FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds);
            }
            else if (prevPane != null)
            {
                DockTo(prevPane.NestedPanesContainer, prevPane, alignment, proportion);
            }

            SetDockState(dockState);
            if (show)
            {
                content.DockHandler.Pane = this;
            }
            else if (this.IsFloat)
            {
                content.DockHandler.FloatPane = this;
            }
            else
            {
                content.DockHandler.PanelPane = this;
            }

            ResumeLayout();
            DockPanel.ResumeLayout(true, true);
        }
Example #2
0
 protected void ShowTabPageContextMenu(Point position)
 {
     DockPane.ShowTabPageContextMenu(this, position);
 }
Example #3
0
 private void SetVisibleContentsToPane(DockPane pane)
 {
     SetVisibleContentsToPane(pane, ActiveContent);
 }
 internal NestedDockingStatus(DockPane pane)
 {
     m_dockPane = pane;
 }
Example #5
0
                private void RefreshChanges()
                {
                    Region    region       = new Region(Rectangle.Empty);
                    Rectangle rectDockArea = FullPanelEdge ? DockPanel.DockArea : DockPanel.DocumentWindowBounds;

                    rectDockArea = RectangleToClient(DockPanel.RectangleToScreen(rectDockArea));
                    if (ShouldPanelIndicatorVisible(DockState.DockLeft))
                    {
                        PanelLeft.Location = new Point(rectDockArea.X + _PanelIndicatorMargin, rectDockArea.Y + (rectDockArea.Height - PanelRight.Height) / 2);
                        PanelLeft.Visible  = true;
                        region.Union(PanelLeft.Bounds);
                    }
                    else
                    {
                        PanelLeft.Visible = false;
                    }

                    if (ShouldPanelIndicatorVisible(DockState.DockRight))
                    {
                        PanelRight.Location = new Point(rectDockArea.X + rectDockArea.Width - PanelRight.Width - _PanelIndicatorMargin, rectDockArea.Y + (rectDockArea.Height - PanelRight.Height) / 2);
                        PanelRight.Visible  = true;
                        region.Union(PanelRight.Bounds);
                    }
                    else
                    {
                        PanelRight.Visible = false;
                    }

                    if (ShouldPanelIndicatorVisible(DockState.DockTop))
                    {
                        PanelTop.Location = new Point(rectDockArea.X + (rectDockArea.Width - PanelTop.Width) / 2, rectDockArea.Y + _PanelIndicatorMargin);
                        PanelTop.Visible  = true;
                        region.Union(PanelTop.Bounds);
                    }
                    else
                    {
                        PanelTop.Visible = false;
                    }

                    if (ShouldPanelIndicatorVisible(DockState.DockBottom))
                    {
                        PanelBottom.Location = new Point(rectDockArea.X + (rectDockArea.Width - PanelBottom.Width) / 2, rectDockArea.Y + rectDockArea.Height - PanelBottom.Height - _PanelIndicatorMargin);
                        PanelBottom.Visible  = true;
                        region.Union(PanelBottom.Bounds);
                    }
                    else
                    {
                        PanelBottom.Visible = false;
                    }

                    if (ShouldPanelIndicatorVisible(DockState.Document))
                    {
                        Rectangle rectDocumentWindow = RectangleToClient(DockPanel.RectangleToScreen(DockPanel.DocumentWindowBounds));
                        PanelFill.Location = new Point(rectDocumentWindow.X + (rectDocumentWindow.Width - PanelFill.Width) / 2, rectDocumentWindow.Y + (rectDocumentWindow.Height - PanelFill.Height) / 2);
                        PanelFill.Visible  = true;
                        region.Union(PanelFill.Bounds);
                    }
                    else
                    {
                        PanelFill.Visible = false;
                    }

                    if (ShouldPaneDiamondVisible())
                    {
                        Rectangle rect = RectangleToClient(DockPane.RectangleToScreen(DockPane.ClientRectangle));
                        PaneDiamond.Location = new Point(rect.Left + (rect.Width - PaneDiamond.Width) / 2, rect.Top + (rect.Height - PaneDiamond.Height) / 2);
                        PaneDiamond.Visible  = true;
                        using (GraphicsPath graphicsPath = PaneDiamond.DisplayingGraphicsPath.Clone() as GraphicsPath)
                        {
                            Point[] pts = new Point[]
                            {
                                new Point(PaneDiamond.Left, PaneDiamond.Top),
                                new Point(PaneDiamond.Right, PaneDiamond.Top),
                                new Point(PaneDiamond.Left, PaneDiamond.Bottom)
                            };
                            using (Matrix matrix = new Matrix(PaneDiamond.ClientRectangle, pts))
                            {
                                graphicsPath.Transform(matrix);
                            }

                            region.Union(graphicsPath);
                        }
                    }
                    else
                    {
                        PaneDiamond.Visible = false;
                    }

                    Region = region;
                }
Example #6
0
 public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane)
 {
     return(new VS2003DockPaneCaption(pane));
 }
Example #7
0
 public DockPaneStripBase CreateDockPaneStrip(DockPane pane)
 {
     return(new VS2003DockPaneStrip(pane));
 }