/// <summary>
        /// A message handler for the Deactivate event of the parent window.
        /// Needed to refresh the child controls.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">An <see cref="EventArgs"/> that contains the event data.</param>
        private void DeactivateParent(object sender, EventArgs e)
        {
            try
            {
                foreach (DockPanel p in DockManager.ListDocument)
                {
                    DockContainer c = p.Form.HostContainer;
                    if (c == null)
                    {
                        continue;
                    }

                    if ((c.ActivePanel == p) && (c.ContainsFocus))
                    {
                        activeDoc = p;
                        p.SetFocus(false);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("DockManager.DeactivateParent: " + ex.Message);
            }
            finally
            {
                Invalidate(true);
            }
        }
        internal void AutoHideContainer(DockContainer c, DockStyle dst, bool hide)
        {
            if (c == null)
            {
                return;
            }

            switch (dst)
            {
            case DockStyle.Left:
                dockOffsetL = UpdateAutoHideList(c, hide, autoHideL);
                break;

            case DockStyle.Top:
                dockOffsetT = UpdateAutoHideList(c, hide, autoHideT);
                break;

            case DockStyle.Right:
                dockOffsetR = UpdateAutoHideList(c, hide, autoHideR);
                break;

            case DockStyle.Bottom:
                dockOffsetB = UpdateAutoHideList(c, hide, autoHideB);
                break;

            default:
                dockOffsetL = UpdateAutoHideList(c, false, autoHideL);
                dockOffsetT = UpdateAutoHideList(c, false, autoHideT);
                dockOffsetR = UpdateAutoHideList(c, false, autoHideR);
                dockOffsetB = UpdateAutoHideList(c, false, autoHideB);
                break;
            }

            AdjustBorders();
        }
Exemple #3
0
        internal void AutoHideContainer(DockContainer c, DockStyle dst, bool hide)
        {
            if (c != null)
            {
                switch (dst)
                {
                case DockStyle.Top:
                    base.dockOffsetT = this.UpdateAutoHideList(c, hide, this.autoHideT);
                    break;

                case DockStyle.Bottom:
                    base.dockOffsetB = this.UpdateAutoHideList(c, hide, this.autoHideB);
                    break;

                case DockStyle.Left:
                    base.dockOffsetL = this.UpdateAutoHideList(c, hide, this.autoHideL);
                    break;

                case DockStyle.Right:
                    base.dockOffsetR = this.UpdateAutoHideList(c, hide, this.autoHideR);
                    break;

                default:
                    base.dockOffsetL = this.UpdateAutoHideList(c, false, this.autoHideL);
                    base.dockOffsetT = this.UpdateAutoHideList(c, false, this.autoHideT);
                    base.dockOffsetR = this.UpdateAutoHideList(c, false, this.autoHideR);
                    base.dockOffsetB = this.UpdateAutoHideList(c, false, this.autoHideB);
                    break;
                }
                base.AdjustBorders();
            }
        }
 public OverlayForm()
 {
     this.targetHost = null;
     this.components = null;
     this.Init();
     this.targetHost = null;
 }
Exemple #5
0
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);
            do
            {
                if (!(component is DockContainer))
                {
                    goto label_4;
                }
label_3:
                ISelectionService service = (ISelectionService)this.GetService(typeof(ISelectionService));
                this.x4cd3df9bd5e139a3    = (IComponentChangeService)this.GetService(typeof(IComponentChangeService));
                this.xff9c60b45aa37b1e    = (IDesignerHost)this.GetService(typeof(IDesignerHost));
                continue;
label_4:
                SandDockLanguage.ShowCachedAssemblyError(component.GetType().Assembly, this.GetType().Assembly);
                if (false)
                {
                    goto label_2;
                }
                else
                {
                    goto label_3;
                }
            }while (false);
            this.x4cd3df9bd5e139a3.ComponentRemoving += new ComponentEventHandler(this.x97263465e88c9d8e);
            this.x4cd3df9bd5e139a3.ComponentRemoved  += new ComponentEventHandler(this.x5c6da9d6db2adc7a);
label_2:
            this.x0467b00af7810f0c = (DockContainer)component;
        }
 public OverlayForm(DockContainer target)
 {
     this.targetHost = null;
     this.components = null;
     this.Init();
     this.targetHost = target;
 }
Exemple #7
0
 protected internal override void DrawDockContainerBackground(
     Graphics graphics,
     DockContainer container,
     Rectangle bounds)
 {
     xa811784015ed8842.x91433b5e99eb7cac(graphics, container.BackColor);
 }
Exemple #8
0
        private void SetOutline(DockContainer dockPanel, DockStyle dock, bool fullPanelEdge)
        {
            Rectangle rect = fullPanelEdge ? dockPanel.DockArea : dockPanel.DocumentWindowBounds;

            rect.Location = dockPanel.PointToScreen(rect.Location);
            if (dock == DockStyle.Top)
            {
                int height = (int)(rect.Height * dockPanel.DockBottomPortion);
                rect = new Rectangle(rect.X, rect.Y, rect.Width, height);
            }
            else if (dock == DockStyle.Bottom)
            {
                int height = (int)(rect.Height * dockPanel.DockBottomPortion);
                rect = new Rectangle(rect.X, rect.Bottom - height, rect.Width, height);
            }
            else if (dock == DockStyle.Left)
            {
                int width = (int)(rect.Width * dockPanel.DockLeftPortion);
                rect = new Rectangle(rect.X, rect.Y, width, rect.Height);
            }
            else if (dock == DockStyle.Right)
            {
                int width = (int)(rect.Width * dockPanel.DockRightPortion);
                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 #9
0
 /// <include file='CodeDoc/AutoHideStripVS2003.xml' path='//CodeDoc/Class[@name="AutoHideStripVS2003"]/Construct[@name="(DockPanel)"]/*'/>
 protected internal AutoHideStripVS2003(DockContainer panel) : base(panel)
 {
     SetStyle(ControlStyles.ResizeRedraw, true);
     SetStyle(ControlStyles.UserPaint, true);
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     BackColor = Color.WhiteSmoke;
 }
        public DockForm(Panel dragObject)
        {
            InitializeComponent();

            this.Opacity = 0;

            if (dragObject is DockContainer)
            {
                DockContainer c = dragObject as DockContainer;

                if (c.panList.Count == 1)
                {
                    this.ClientSize = (c.panList[0] as DockPanel).Form.ClientSize;
                }
                else
                {
                    this.ClientSize = dragObject.Size;
                }

                if (c.removeable)
                {
                    rootContainer = c;
                }
                else
                {
                    rootContainer = new DockContainer();
                    rootContainer.Controls.AddRange((DockPanel[])c.panList.ToArray(typeof(DockPanel)));
                    rootContainer.Controls.AddRange((DockContainer[])c.conList.ToArray(typeof(DockContainer)));

                    ArrayList list = new ArrayList();
                    rootContainer.GetPanels(list);
                    if (list.Count > 0)
                    {
                        rootContainer.DockType = (list[0] as DockPanel).Form.DockType;
                    }
                }
            }
            else if (dragObject is DockPanel)
            {
                DockPanel p = dragObject as DockPanel;

                this.ClientSize = p.Form.ClientSize;

                rootContainer = new DockContainer();
                p.Form.CopyToDockForm(this);
            }

            if (rootContainer.panList.Count > 0)
            {
                (rootContainer.panList[0] as DockPanel).Form.CopyPropToDockForm(this);
                rootContainer.SetFormSizeBounds(this);
                rootContainer.SelectTab(0);
            }

            rootContainer.Dock = DockStyle.Fill;
            this.Controls.Add(rootContainer);

            RegisterToMdiContainer();
        }
Exemple #11
0
 internal static void UnRegisterContainer(DockContainer cont)
 {
     if (contList.Contains(cont))
     {
         dragEvent = (DockEventHandler)Delegate.Remove(dragEvent, cont.dragWindowHandler);
         contList.Remove(cont);
     }
 }
Exemple #12
0
        /// <summary>Get the bounds of a dock site in parent (DockContainer or containing Branch) space</summary>
        public Rect ChildBounds(EDockSite location)
        {
            var display_rect = new Rect(RenderSize);

            display_rect.Width  = Math.Max(0, display_rect.Width);
            display_rect.Height = Math.Max(0, display_rect.Height);
            return(DockContainer.DockSiteBounds(location, display_rect, DockedMask, DockSizes));
        }
 internal DockWindowCollection(DockContainer dockPanel)
 {
     InnerList.Add(new DockWindow(dockPanel, DockState.Document));
     InnerList.Add(new DockWindow(dockPanel, DockState.DockLeft));
     InnerList.Add(new DockWindow(dockPanel, DockState.DockRight));
     InnerList.Add(new DockWindow(dockPanel, DockState.DockTop));
     InnerList.Add(new DockWindow(dockPanel, DockState.DockBottom));
 }
        /// <summary>
        /// Since there are no non-client area notifications in .NET, this message loop hook is needed.
        /// Captures a window move event and starts own movement procedure with an attached drag window.
        /// </summary>
        /// <param name="m">The Windows Message to process.</param>
        protected override void WndProc(ref Message m)
        {
            if ((m.Msg == (int)Win32.Msgs.WM_NCLBUTTONDOWN) & (m.WParam == (IntPtr)Win32.HitTest.HTCAPTION))
            {
                StartMoving(new Point(MousePosition.X, MousePosition.Y));
                return;
            }
            else if (moving)
            {
                if (m.Msg == (int)Win32.Msgs.WM_MOUSEMOVE)
                {
                    Application.DoEvents();

                    if (this.IsDisposed)
                    {
                        return;
                    }

                    if (MouseButtons == MouseButtons.None)
                    {
                        EndMoving();
                        Show();
                    }
                    else
                    {
                        if (DockManager.FastMoveDraw & this.Visible)
                        {
                            Hide();
                        }

                        this.Location = new Point(ptRef.X + MousePosition.X - ptStart.X, ptRef.Y + MousePosition.Y - ptStart.Y);
                        MoveWindow();
                        this.Capture = true;
                    }
                    return;
                }
                else if ((m.Msg == (int)Win32.Msgs.WM_LBUTTONUP) | ((m.Msg == (int)Win32.Msgs.WM_NCMOUSEMOVE) & (MouseButtons == MouseButtons.None)))
                {
                    EndMoving();

                    if (SendDockEvent(true) != null)
                    {
                        rootContainer = null;
                        this.Close();
                        return;
                    }

                    Show();
                }
                else if (m.Msg == (int)Win32.Msgs.WM_MOUSELEAVE)
                {
                    EndMoving();
                    Show();
                }
            }

            base.WndProc(ref m);
        }
Exemple #15
0
        void DockContainer_ActiveDocumentChanged(object sender, EventArgs e)
        {
            DockContainer container = (DockContainer)sender;

            if (container.ActiveDocument is FireEditorTabItem)
            {
                this.CheckForToolbarState((FireEditorTabItem)container.ActiveDocument);
            }
        }
 internal AutoHidePaneCollection(DockContainer panel, DockState dockState)
 {
     m_dockPanel = panel;
     m_states    = new AutoHideStateCollection();
     States[DockState.DockTopAutoHide].Selected    = (dockState == DockState.DockTopAutoHide);
     States[DockState.DockBottomAutoHide].Selected = (dockState == DockState.DockBottomAutoHide);
     States[DockState.DockLeftAutoHide].Selected   = (dockState == DockState.DockLeftAutoHide);
     States[DockState.DockRightAutoHide].Selected  = (dockState == DockState.DockRightAutoHide);
 }
        internal void Release()
        {
            DockContainer parent = this.controlContainer.Parent as DockContainer;

            if (parent != null)
            {
                parent.ReleaseWindow(this);
            }
        }
Exemple #18
0
 /// <summary>
 /// Creates a new DockEventArgs object.
 /// </summary>
 /// <param name="point">The point where to dock the window.</param>
 /// <param name="dockType">The needed target container type.</param>
 /// <param name="release">The state of the dock process. True, if dock is finally performed.</param>
 public DockEventArgs(Point point, DockContainerType dockType, bool release)
 {
     this.point         = point;
     this.dockType      = dockType;
     this.release       = release;
     this.target        = null;
     this.handled       = false;
     this.showDockGuide = false;
 }
Exemple #19
0
 public static T FindObjectByName <T>(this DockingManager dm, string name)
     where T : DependencyObject
 {
     return(dm?.Layout?.Descendents()
            .OfType <DependencyObject>()
            .Where(x => DockContainer.GetName(x) == name)
            .OfType <T>()
            .FirstOrDefault());
 }
        internal static void UnRegisterContainer(DockContainer cont)
        {
            if (!contList.Contains(cont))
            {
                return;
            }

            dragEvent -= cont.dragWindowHandler;
            contList.Remove(cont);
        }
Exemple #21
0
 /// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show(DockPanel)"]/*'/>
 public void Show(DockContainer dockPanel)
 {
     try
     {
         DockHandler.Show(dockPanel);
     }
     catch (Exception)
     {
     }
 }
 public DockForm(Panel dragObject)
 {
     this.dragWindow    = null;
     this.dragTarget    = null;
     this.rootContainer = null;
     this.moving        = false;
     this.allowDock     = true;
     this.components    = null;
     this.InitializeComponent();
     base.Opacity = 0.0;
     if (dragObject is DockContainer)
     {
         DockContainer container = dragObject as DockContainer;
         if (container.panList.Count == 1)
         {
             base.ClientSize = (container.panList[0] as DockPanel).Form.ClientSize;
         }
         else
         {
             base.ClientSize = dragObject.Size;
         }
         if (container.removeable)
         {
             this.rootContainer = container;
         }
         else
         {
             this.rootContainer = new DockContainer();
             this.rootContainer.Controls.AddRange((DockPanel[])container.panList.ToArray(typeof(DockPanel)));
             this.rootContainer.Controls.AddRange((DockContainer[])container.conList.ToArray(typeof(DockContainer)));
             ArrayList list = new ArrayList();
             this.rootContainer.GetPanels(list);
             if (list.Count > 0)
             {
                 this.rootContainer.DockType = (list[0] as DockPanel).Form.DockType;
             }
         }
     }
     else if (dragObject is DockPanel)
     {
         DockPanel panel = dragObject as DockPanel;
         base.ClientSize    = panel.Form.ClientSize;
         this.rootContainer = new DockContainer();
         panel.Form.CopyToDockForm(this);
     }
     if (this.rootContainer.IsPanelContainer)
     {
         (this.rootContainer.panList[0] as DockPanel).Form.CopyPropToDockForm(this);
         this.rootContainer.SetFormSizeBounds(this);
         this.rootContainer.SelectTab(0);
     }
     this.rootContainer.Dock = DockStyle.Fill;
     base.Controls.Add(this.rootContainer);
     this.RegisterToMdiContainer();
 }
        public DockForm()
        {
            InitializeComponent();

            // Create and initialize the root container.
            rootContainer      = new DockContainer();
            rootContainer.Dock = DockStyle.Fill;
            this.Controls.Add(rootContainer);

            RegisterToMdiContainer();
        }
Exemple #24
0
        public Branch(DockContainer dc, DockSizeData dock_sizes)
        {
            DockContainer = dc;
            DockSizes     = new DockSizeData(dock_sizes)
            {
                Owner = this
            };

            // Create the collection to hold the five child controls (DockPanes or Branches)
            Descendants = new DescendantCollection(this);
        }
Exemple #25
0
        public AutoHideWindow(DockContainer dockPanel)
        {
            _dockPanel = dockPanel;

            _timerMouseTrack       = new Timer();
            _timerMouseTrack.Tick += new EventHandler(TimerMouseTrack_Tick);

            Visible   = false;
            _splitter = new AutoHideWindowSplitter();
            Controls.Add(_splitter);
        }
        /// <include file='CodeDoc/AutoHideStripBase.xml' path='//CodeDoc/Class[@name="AutoHideStripBase"]/Construct[@name="(DockPanel)"]/*'/>
        protected internal AutoHideStripBase(DockContainer panel)
        {
            m_dockPanel   = panel;
            m_panesTop    = new AutoHidePaneCollection(panel, DockState.DockTopAutoHide);
            m_panesBottom = new AutoHidePaneCollection(panel, DockState.DockBottomAutoHide);
            m_panesLeft   = new AutoHidePaneCollection(panel, DockState.DockLeftAutoHide);
            m_panesRight  = new AutoHidePaneCollection(panel, DockState.DockRightAutoHide);

            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.Selectable, false);
        }
 protected override void WndProc(ref Message m)
 {
     if ((m.Msg == 0xa1) & (m.WParam == ((IntPtr)2L)))
     {
         this.StartMoving(new Point(Control.MousePosition.X, Control.MousePosition.Y));
     }
     else
     {
         if (this.moving)
         {
             if (m.Msg == 0x200)
             {
                 Application.DoEvents();
                 if (!base.IsDisposed)
                 {
                     if (Control.MouseButtons == MouseButtons.None)
                     {
                         this.EndMoving();
                         base.Show();
                     }
                     else
                     {
                         if (DockManager.FastMoveDraw & base.Visible)
                         {
                             base.Hide();
                         }
                         base.Location = new Point((this.ptRef.X + Control.MousePosition.X) - this.ptStart.X, (this.ptRef.Y + Control.MousePosition.Y) - this.ptStart.Y);
                         this.MoveWindow();
                         base.Capture = true;
                     }
                 }
                 return;
             }
             if ((m.Msg == 0x202) | ((m.Msg == 160) & (Control.MouseButtons == MouseButtons.None)))
             {
                 this.EndMoving();
                 if (this.SendDockEvent(true) != null)
                 {
                     this.rootContainer = null;
                     base.Close();
                     return;
                 }
                 base.Show();
             }
             else if (m.Msg == 0x2a3)
             {
                 this.EndMoving();
                 base.Show();
             }
         }
         base.WndProc(ref m);
     }
 }
        /// <summary>
        /// Releases the window from its host container.
        /// </summary>
        internal void Release()
        {
            /*if (this.HostContainer != null)
             *      HostContainer.ReleaseWindow(this);*/

            DockContainer host = controlContainer.Parent as DockContainer;

            if (host != null)
            {
                host.ReleaseWindow(this);
            }
        }
Exemple #29
0
 public DockManager()
 {
     this.components        = null;
     this.activeDoc         = null;
     this.autoHideContainer = null;
     this.autoHideL         = new Collection <DockContainer>();
     this.autoHideT         = new Collection <DockContainer>();
     this.autoHideR         = new Collection <DockContainer>();
     this.autoHideB         = new Collection <DockContainer>();
     this.InitializeComponent();
     this.Init();
 }
        private void init()
        {
            VBox1         = new Gtk.Box(Orientation.Vertical, 0);
            VBox1.Visible = true;
            this.Add(VBox1);

            dock = new DockContainer(null);
            //xxxdock.Name = "xxxdock";
            dock.Visible = true;
            dock.Expand  = true;
            VBox1.PackEnd(dock, true, true, 0);
        }
Exemple #31
0
		protected internal override void DrawDockContainerBackground(Graphics graphics, DockContainer container, Rectangle bounds)
		{
		    if (bounds.Width <= 0 || bounds.Height <= 0) return;

		    if (!(container is DocumentContainer))
		    {
		        RenderHelper.ClearBackground(graphics, Background);
		    }
		    else
		    {
		        using (var brush = CreateLinearGradientBrush(bounds, DocumentContainerBackground, LinearGradientMode.Vertical))
		            graphics.FillRectangle(brush, bounds);
		    }
		}
Exemple #32
0
		protected internal override void DrawDockContainerBackground(Graphics graphics, DockContainer container, Rectangle bounds)
		{
			RenderHelper.ClearBackground(graphics, container.BackColor);
		}
Exemple #33
0
 protected internal abstract void DrawDockContainerBackground(Graphics graphics, DockContainer container, Rectangle bounds);