Пример #1
0
        protected override void OnLayout(LayoutEventArgs levent)
        {
            SuspendLayout(true);

            AutoHideStripControl.Bounds = ClientRectangle;

            CalculateDockPadding();

            DockWindows[DockState.DockLeft].Width    = GetDockWindowSize(DockState.DockLeft);
            DockWindows[DockState.DockRight].Width   = GetDockWindowSize(DockState.DockRight);
            DockWindows[DockState.DockTop].Height    = GetDockWindowSize(DockState.DockTop);
            DockWindows[DockState.DockBottom].Height = GetDockWindowSize(DockState.DockBottom);

            AutoHideWindow.Bounds = GetAutoHideWindowBounds(AutoHideWindowRectangle);

            DockWindows[DockState.Document].BringToFront();
            AutoHideWindow.BringToFront();

            base.OnLayout(levent);

            if (DocumentStyle == DocumentStyle.SystemMdi && MdiClientExists)
            {
                SetMdiClientBounds(SystemMdiClientBounds);
                InvalidateWindowRegion();
            }
            else if (DocumentStyle == DocumentStyle.DockingMdi)
            {
                InvalidateWindowRegion();
            }

            ResumeLayout(true, true);
        }
Пример #2
0
 protected override void OnParentChanged(EventArgs e)
 {
     AutoHideWindow.Parent = this.Parent;
     GetMdiClientController().ParentForm = (this.Parent as Form);
     AutoHideWindow.BringToFront();
     base.OnParentChanged(e);
 }
Пример #3
0
        protected override void OnLayout(LayoutEventArgs levent)
        {
            if (Theme == null)
            {
                return;
            }
            if (DockWindows == null)
            {
                return;
            }

            SuspendLayout(true);

            AutoHideStripControl.Bounds = ClientRectangle;

            CalculateDockPadding();

            DockWindows[DockState.DockLeft].Width    = GetDockWindowSize(DockState.DockLeft);
            DockWindows[DockState.DockRight].Width   = GetDockWindowSize(DockState.DockRight);
            DockWindows[DockState.DockTop].Height    = GetDockWindowSize(DockState.DockTop);
            DockWindows[DockState.DockBottom].Height = GetDockWindowSize(DockState.DockBottom);

            AutoHideWindow.Bounds = GetAutoHideWindowBounds(AutoHideWindowRectangle);

            DockWindow documentDockWindow = DockWindows[DockState.Document];

            if (ReferenceEquals(documentDockWindow.Parent, AutoHideWindow.Parent))
            {
                AutoHideWindow.Parent.Controls.SetChildIndex(AutoHideWindow, 0);
                documentDockWindow.Parent.Controls.SetChildIndex(documentDockWindow, 1);
            }
            else
            {
                documentDockWindow.BringToFront();
                AutoHideWindow.BringToFront();
            }

            base.OnLayout(levent);

            if (DocumentStyle == DocumentStyle.SystemMdi && MdiClientExists)
            {
                SetMdiClientBounds(SystemMdiClientBounds);
                InvalidateWindowRegion();
            }
            else if (DocumentStyle == DocumentStyle.DockingMdi)
            {
                InvalidateWindowRegion();
            }

            ResumeLayout(true, true);
        }
Пример #4
0
 private void SetAutoHideWindowParent()
 {
     Control parent;
     if (DocumentStyle == DocumentStyle.DockingMdi ||
         DocumentStyle == DocumentStyle.SystemMdi)
         parent = this.Parent;
     else
         parent = this;
     if (AutoHideWindow.Parent != parent)
     {
         AutoHideWindow.Parent = parent;
         AutoHideWindow.BringToFront();
     }
 }
Пример #5
0
        private void OnParentChangedHandler(object sender, EventArgs e)
        {
            Control parentCtrl = this.Parent;

            if (!(parentCtrl is Form))
            {
                while (!(parentCtrl is Form) && parentCtrl != null)
                {
                    parentCtrl.ParentChanged += OnParentChangedHandler;
                    parentCtrl = parentCtrl.Parent;
                }
            }

            if (parentCtrl is Form)
            {
                AutoHideWindow.Parent = parentCtrl;
                GetMdiClientController().ParentForm = parentCtrl as Form;
                AutoHideWindow.BringToFront();
            }
        }