Exemple #1
0
        void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds)
        {
            if (dockPanel == null)
                throw (new ArgumentNullException(Strings.FloatWindow_Constructor_NullDockPanel));

            m_nestedPanes = new NestedPaneCollection(this);

            FormBorderStyle = FormBorderStyle.SizableToolWindow;
            ShowInTaskbar = false;
            if (dockPanel.RightToLeft != RightToLeft)
                RightToLeft = dockPanel.RightToLeft;
            if (RightToLeftLayout != dockPanel.RightToLeftLayout)
                RightToLeftLayout = dockPanel.RightToLeftLayout;

            SuspendLayout();
            if (boundsSpecified)
            {
                Bounds = bounds;
                StartPosition = FormStartPosition.Manual;
            }
            else
            {
                StartPosition = FormStartPosition.WindowsDefaultLocation;
                Size = dockPanel.DefaultFloatWindowSize;
            }

            m_dockPanel = dockPanel;
            Owner = DockPanel.FindForm();
            DockPanel.AddFloatWindow(this);
            if (pane != null)
                pane.FloatWindow = this;

            ResumeLayout();
        }
Exemple #2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (DockPanel != null)
             DockPanel.RemoveFloatWindow(this);
         m_dockPanel = null;
     }
     base.Dispose(disposing);
 }
Exemple #3
0
        public static FloatWindow FloatWindowAtPoint(Point pt, DockPanel dockPanel)
        {
            for (var control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
            {
                var floatWindow = control as FloatWindow;
                if (floatWindow != null && floatWindow.DockPanel == dockPanel)
                    return floatWindow;
            }

            return null;
        }
Exemple #4
0
        public static DockPane PaneAtPoint(Point pt, DockPanel dockPanel)
        {
            for (var control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
            {
                var content = control as IDockContent;
                if (content != null && content.DockHandler.DockPanel == dockPanel)
                    return content.DockHandler.Pane;

                var pane = control as DockPane;
                if (pane != null && pane.DockPanel == dockPanel)
                    return pane;
            }

            return null;
        }
Exemple #5
0
        internal DockWindow(DockPanel dockPanel, DockState dockState)
        {
            m_nestedPanes = new NestedPaneCollection(this);
            m_dockPanel = dockPanel;
            m_dockState = dockState;
            Visible = false;

            SuspendLayout();

            if (DockState == DockState.DockLeft || DockState == DockState.DockRight || DockState == DockState.DockTop ||
                DockState == DockState.DockBottom)
            {
                m_splitter = new SplitterControl();
                Controls.Add(m_splitter);
            }

            if (DockState == DockState.DockLeft)
            {
                Dock = DockStyle.Left;
                m_splitter.Dock = DockStyle.Right;
            }
            else if (DockState == DockState.DockRight)
            {
                Dock = DockStyle.Right;
                m_splitter.Dock = DockStyle.Left;
            }
            else if (DockState == DockState.DockTop)
            {
                Dock = DockStyle.Top;
                m_splitter.Dock = DockStyle.Bottom;
            }
            else if (DockState == DockState.DockBottom)
            {
                Dock = DockStyle.Bottom;
                m_splitter.Dock = DockStyle.Top;
            }
            else if (DockState == DockState.Document)
                Dock = DockStyle.Fill;

            ResumeLayout();
        }
            public AutoHideWindowControl(DockPanel dockPanel)
            {
                m_dockPanel = dockPanel;

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

                Visible = false;
                m_splitter = new SplitterControl(this);
                Controls.Add(m_splitter);
            }
Exemple #7
0
        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 = new SplitterControl(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 (IsFloat)
                content.DockHandler.FloatPane = this;
            else
                content.DockHandler.PanelPane = this;

            ResumeLayout();
            DockPanel.ResumeLayout(true, true);
        }
 public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane)
 {
     return new FloatWindow(dockPanel, pane);
 }
Exemple #9
0
 public void Show(DockPanel dockPanel, DockState dockState)
 {
     DockHandler.Show(dockPanel, dockState);
 }
Exemple #10
0
 public void DockTo(DockPanel panel, DockStyle dockStyle)
 {
     DockHandler.DockTo(panel, dockStyle);
 }
 protected DragHandler(DockPanel dockPanel)
 {
     m_dockPanel = dockPanel;
 }
Exemple #12
0
        public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
        {
            if (dockPanel == null)
                throw (new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));

            dockPanel.SuspendLayout(true);

            DockPanel = dockPanel;
            if (FloatPane == null)
            {
                IsHidden = true; // to reduce the screen flicker
                FloatPane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, false);
                FloatPane.FloatWindow.StartPosition = FormStartPosition.Manual;
            }

            FloatPane.FloatWindow.Bounds = floatWindowBounds;

            Show(dockPanel, DockState.Float);
            Activate();

            dockPanel.ResumeLayout(true, true);
        }
Exemple #13
0
        public void Show(DockPanel dockPanel, DockState dockState)
        {
            if (dockPanel == null)
                throw (new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));

            if (dockState == DockState.Unknown || dockState == DockState.Hidden)
                throw (new ArgumentException(Strings.DockContentHandler_Show_InvalidDockState));

            dockPanel.SuspendLayout(true);

            DockPanel = dockPanel;

            if (dockState == DockState.Float && FloatPane == null)
                Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, true);
            else if (PanelPane == null)
            {
                DockPane paneExisting = null;
                foreach (var pane in DockPanel.Panes)
                {
                    if (pane.DockState == dockState)
                    {
                        paneExisting = pane;
                        break;
                    }
                }

                if (paneExisting == null)
                    Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, dockState, true);
                else
                    Pane = paneExisting;
            }

            DockState = dockState;
            dockPanel.ResumeLayout(true, true); //we'll resume the layout before activating to ensure that the position
            Activate(); //and size of the form are finally processed before the form is shown
        }
Exemple #14
0
        public void Show(DockPanel dockPanel)
        {
            if (dockPanel == null)
                throw (new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));

            if (DockState == DockState.Unknown)
                Show(dockPanel, DefaultShowState);
            else
                Activate();
        }
Exemple #15
0
        public void DockTo(DockPanel panel, DockStyle dockStyle)
        {
            if (panel != DockPanel)
                throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, "panel");

            DockPane pane;

            if (dockStyle == DockStyle.Top)
                pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockTop, true);
            else if (dockStyle == DockStyle.Bottom)
                pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockBottom, true);
            else if (dockStyle == DockStyle.Left)
                pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockLeft, true);
            else if (dockStyle == DockStyle.Right)
                pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockRight, true);
            else if (dockStyle == DockStyle.Fill)
                pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Document, true);
            else
                return;
        }
 public AutoHideStripBase CreateAutoHideStrip(DockPanel panel)
 {
     return new VS2005AutoHideStrip(panel);
 }
 public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
 {
     return new FloatWindow(dockPanel, pane, bounds);
 }
 public DockDragHandler(DockPanel panel) : base(panel)
 {
 }
                void SetOutline(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge)
                {
                    var rect = fullPanelEdge ? dockPanel.DockArea : dockPanel.DocumentWindowBounds;
                    rect.Location = dockPanel.PointToScreen(rect.Location);
                    if (dock == DockStyle.Top)
                    {
                        var height = dockPanel.GetDockWindowSize(DockState.DockTop);
                        rect = new Rectangle(rect.X, rect.Y, rect.Width, height);
                    }
                    else if (dock == DockStyle.Bottom)
                    {
                        var height = dockPanel.GetDockWindowSize(DockState.DockBottom);
                        rect = new Rectangle(rect.X, rect.Bottom - height, rect.Width, height);
                    }
                    else if (dock == DockStyle.Left)
                    {
                        var width = dockPanel.GetDockWindowSize(DockState.DockLeft);
                        rect = new Rectangle(rect.X, rect.Y, width, rect.Height);
                    }
                    else if (dock == DockStyle.Right)
                    {
                        var width = dockPanel.GetDockWindowSize(DockState.DockRight);
                        rect = new Rectangle(rect.Right - width, rect.Y, width, rect.Height);
                    }
                    else if (dock == DockStyle.Fill)
                    {
                        rect = dockPanel.DocumentWindowBounds;
                        rect.Location = dockPanel.PointToScreen(rect.Location);
                    }

                    SetDragForm(rect);
                }
Exemple #20
0
 protected internal FloatWindow(DockPanel dockPanel, DockPane pane)
 {
     InternalConstruct(dockPanel, pane, false, Rectangle.Empty);
 }
Exemple #21
0
 protected internal FloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
 {
     InternalConstruct(dockPanel, pane, true, bounds);
 }
Exemple #22
0
 public void Show(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge)
 {
     SaveOldValues();
     SetValues(Rectangle.Empty, dockPanel, dock, fullPanelEdge ? -1 : 0);
     TestChange();
 }
Exemple #23
0
 public void Show(DockPanel dockPanel)
 {
     DockHandler.Show(dockPanel);
 }
 public FocusManagerImpl(DockPanel dockPanel)
 {
     m_dockPanel = dockPanel;
     m_localWindowsHook = new LocalWindowsHook(HookType.WH_CALLWNDPROCRET);
     m_hookEventHandler = new EventHandler<HookEventArgs>(HookEventHandler);
     m_localWindowsHook.HookInvoked += m_hookEventHandler;
     m_localWindowsHook.Install();
 }
Exemple #25
0
 public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
 {
     DockHandler.Show(dockPanel, floatWindowBounds);
 }
 internal DockPanelExtender(DockPanel dockPanel)
 {
     m_dockPanel = dockPanel;
 }
 public VS2005AutoHideStrip(DockPanel panel) : base(panel)
 {
     SetStyle(
         ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint |
         ControlStyles.OptimizedDoubleBuffer, true);
     BackColor = SystemColors.ControlLight;
 }
Exemple #28
0
        public void DockTo(DockPanel panel, DockStyle dockStyle)
        {
            if (panel != DockPanel)
                throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, "panel");

            NestedPaneCollection nestedPanesTo = null;

            if (dockStyle == DockStyle.Top)
                nestedPanesTo = DockPanel.DockWindows[DockState.DockTop].NestedPanes;
            else if (dockStyle == DockStyle.Bottom)
                nestedPanesTo = DockPanel.DockWindows[DockState.DockBottom].NestedPanes;
            else if (dockStyle == DockStyle.Left)
                nestedPanesTo = DockPanel.DockWindows[DockState.DockLeft].NestedPanes;
            else if (dockStyle == DockStyle.Right)
                nestedPanesTo = DockPanel.DockWindows[DockState.DockRight].NestedPanes;
            else if (dockStyle == DockStyle.Fill)
                nestedPanesTo = DockPanel.DockWindows[DockState.Document].NestedPanes;

            DockPane prevPane = null;
            for (var i = nestedPanesTo.Count - 1; i >= 0; i--)
            {
                if (nestedPanesTo[i] != VisibleNestedPanes[0])
                    prevPane = nestedPanesTo[i];
            }
            MergeNestedPanes(VisibleNestedPanes, nestedPanesTo, prevPane, DockAlignment.Left, 0.5);
        }
 public SplitterDragHandler(DockPanel dockPanel) : base(dockPanel)
 {
 }
Exemple #30
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                m_dockState = DockState.Unknown;

                if (NestedPanesContainer != null)
                    NestedPanesContainer.NestedPanes.Remove(this);

                if (DockPanel != null)
                {
                    DockPanel.RemovePane(this);
                    m_dockPanel = null;
                }

                Splitter.Dispose();
                if (m_autoHidePane != null)
                    m_autoHidePane.Dispose();
            }
            base.Dispose(disposing);
        }