예제 #1
0
        public void HideOverlayPaneDockingOptions(Pane surfaceElement)
        {
            owdBottom.Enabled = false;
            owdTop.Enabled = false;
            owdLeft.Enabled = false;
            owdRight.Enabled = false;
            owdInto.Enabled = false;

            gridPaneRelativeDockingOptions.Visibility = Visibility.Collapsed;
            CurrentDropPane = null;
        }
예제 #2
0
        public void Add(DockablePane pane, Pane relativePane, Dock relativeDock)
        {
            Console.WriteLine("Add(...)");
            AttachPaneEvents(pane);
            DockablePaneGroup group = GetPaneGroup(relativePane);
            //group.ParentGroup.ReplaceChildGroup(group, new DockablePaneGroup(group, new DockablePaneGroup(relativePane), relativeDock));

            switch (relativeDock)
            {
                case Dock.Right:
                case Dock.Bottom:
                    {
                        if (group == _rootGroup)
                        {
                            _rootGroup = new DockablePaneGroup(group, new DockablePaneGroup(pane), relativeDock);
                        }
                        else
                        {
                            DockablePaneGroup parentGroup = group.ParentGroup;
                            DockablePaneGroup newChildGroup = new DockablePaneGroup(group, new DockablePaneGroup(pane), relativeDock);
                            parentGroup.ReplaceChildGroup(group, newChildGroup);
                        }
                    }
                    break;
                case Dock.Left:
                case Dock.Top:
                    {
                        if (group == _rootGroup)
                        {
                            _rootGroup = new DockablePaneGroup(new DockablePaneGroup(pane), group, relativeDock);
                        }
                        else
                        {
                            DockablePaneGroup parentGroup = group.ParentGroup;
                            DockablePaneGroup newChildGroup = new DockablePaneGroup(new DockablePaneGroup(pane), group, relativeDock);
                            parentGroup.ReplaceChildGroup(group, newChildGroup);
                        }
                    }
                    break;
                    //return new DockablePaneGroup(new DockablePaneGroup(pane), this, pane.Dock);
            }

            //group.ChildGroup = new DockablePaneGroup(group.ChildGroup, pane, relativeDock);
            ArrangeLayout();
        }
예제 #3
0
 internal void SetContainerPane(Pane pane)
 {
     _containerPane = pane;
 }
예제 #4
0
 /// <summary>
 /// Create a group with a single pane
 /// </summary>
 /// <param name="pane">Attached pane</param>
 public DockablePaneGroup(Pane pane)
 {
     _attachedPane = pane;
 }
예제 #5
0
        public DockablePaneGroup GetPaneGroup(Pane pane)
        {
            if (AttachedPane == pane)
                return this;

            if (FirstChildGroup != null)
            {
                DockablePaneGroup paneGroup = FirstChildGroup.GetPaneGroup(pane);
                if (paneGroup!=null)
                    return paneGroup;
            }
            if (SecondChildGroup != null)
            {
                DockablePaneGroup paneGroup = SecondChildGroup.GetPaneGroup(pane);
                if (paneGroup!=null)
                    return paneGroup;
            }

            return null;
        }
예제 #6
0
        public void Deserialize(DockManager managerToAttach, System.Xml.XmlNode node, GetContentFromTypeString getObjectHandler)
        {
            _dock = (Dock)Enum.Parse(typeof(Dock), node.Attributes["Dock"].Value);

            if (node.ChildNodes[0].Name == "DockablePane")
            {
                DockablePane pane = new DockablePane(managerToAttach);
                pane.Deserialize(managerToAttach, node.ChildNodes[0], getObjectHandler);
                _attachedPane = pane;
            }
            else if (node.ChildNodes[0].Name == "DocumentsPane")
            {
                DocumentsPane pane = managerToAttach.GetDocumentsPane();
                pane.Deserialize(managerToAttach, node.ChildNodes[0], getObjectHandler);
                _attachedPane = pane;
            }
            else
            {
                _firstChildGroup = new DockablePaneGroup();
                _firstChildGroup._parentGroup = this;
                _firstChildGroup.Deserialize(managerToAttach, node.ChildNodes[0].ChildNodes[0], getObjectHandler);

                _secondChildGroup = new DockablePaneGroup();
                _secondChildGroup._parentGroup = this;
                _secondChildGroup.Deserialize(managerToAttach, node.ChildNodes[0].ChildNodes[1], getObjectHandler);

            }
        }
예제 #7
0
 /// <summary>
 /// Handle dockable pane layout changing
 /// </summary>
 /// <param name="sourcePane">Source pane to move</param>
 /// <param name="destinationPane">Relative pane</param>
 /// <param name="relativeDock"></param>
 internal void MoveTo(DockablePane sourcePane, Pane destinationPane, Dock relativeDock)
 {
     gridDocking.MoveTo(sourcePane, destinationPane, relativeDock);
 }
예제 #8
0
        public void Move(Pane source, Pane destination, Dock dock)
        {
            IPane resultPane = Remove(_rootPane, source);
            if (resultPane != null)
                _rootPane = resultPane;

            PaneGroup parentGroup = FindParentGroup(_rootPane as PaneGroup, destination);

            if (parentGroup.First == destination)
            {
                switch (dock)
                {
                    case Dock.Left:
                        parentGroup.First = new PaneGroup(source, destination, SplitOrientation.Vertical);
                        break;
                    case Dock.Right:
                        parentGroup.First = new PaneGroup(destination, source, SplitOrientation.Vertical);
                        break;
                    case Dock.Top:
                        parentGroup.First = new PaneGroup(source, destination, SplitOrientation.Horizontal);
                        break;
                    case Dock.Bottom:
                        parentGroup.First = new PaneGroup(destination, source, SplitOrientation.Horizontal);
                        break;
                }
            }
            else
            {
                switch (dock)
                {
                    case Dock.Left:
                        parentGroup.Second = new PaneGroup(source, destination, SplitOrientation.Vertical);
                        break;
                    case Dock.Right:
                        parentGroup.Second = new PaneGroup(destination, source, SplitOrientation.Vertical);
                        break;
                    case Dock.Top:
                        parentGroup.Second = new PaneGroup(source, destination, SplitOrientation.Horizontal);
                        break;
                    case Dock.Bottom:
                        parentGroup.Second = new PaneGroup(destination, source, SplitOrientation.Horizontal);
                        break;
                }
            }

            if (source is DockablePane)
                (source as DockablePane).Dock = dock;
        }
예제 #9
0
        /// <summary>
        /// Move contained contents into a destination pane and close this one
        /// </summary>
        /// <param name="destinationPane"></param>
        internal void MoveInto(Pane destinationPane)
        {
            //DockablePane dockableDestPane = destinationPane as DockablePane;
            //if (dockableDestPane != null)
            //    ChangeDock(dockableDestPane.Dock);

            DockManager.MoveInto(this, destinationPane);

            //if (destinationPane is DocumentsPane)
            //    ChangeState(PaneState.TabbedDocument);
            //else
            //    ChangeState(PaneState.Docked);
        }
예제 #10
0
 /// <summary>
 /// Called from a pane when it's dropped into an other pane
 /// </summary>
 /// <param name="sourcePane">Source pane which is going to be closed</param>
 /// <param name="destinationPane">Destination pane which is about to host contents from SourcePane</param>
 internal void MoveInto(DockablePane sourcePane, Pane destinationPane)
 {
     gridDocking.MoveInto(sourcePane, destinationPane);
 }
예제 #11
0
 DockablePaneGroup GetPaneGroup(Pane pane)
 {
     return _rootGroup.GetPaneGroup(pane);
 }
예제 #12
0
 public void MoveTo(DockablePane sourcePane, Pane destinationPane, Dock relativeDock)
 {
     Remove(sourcePane);
     Add(sourcePane, destinationPane, relativeDock);
 }
예제 #13
0
 public void MoveInto(DockablePane sourcePane, Pane destinationPane)
 {
     Remove(sourcePane);
     while (sourcePane.Contents.Count > 0)
     {
         DockableContent content = sourcePane.Contents[0];
         sourcePane.Remove(content);
         destinationPane.Add(content);
         destinationPane.Show(content);
     }
     sourcePane.Close();
 }
예제 #14
0
 /// <summary>
 /// Create a group with a single pane
 /// </summary>
 /// <param name="pane">Attached pane</param>
 public DockablePaneGroup(Pane pane)
 {
     _attachedPane = pane;
 }
예제 #15
0
 /// <summary>
 /// Called from a pane when it's dropped into an other pane
 /// </summary>
 /// <param name="sourcePane">Source pane which is going to be closed</param>
 /// <param name="destinationPane">Destination pane which is about to host contents from SourcePane</param>
 internal void MoveInto(DockablePane sourcePane, Pane destinationPane)
 {
     gridDocking.MoveInto(sourcePane, destinationPane);
 }
예제 #16
0
 /// <summary>
 /// Handle dockable pane layout changing
 /// </summary>
 /// <param name="sourcePane">Source pane to move</param>
 /// <param name="destinationPane">Relative pane</param>
 /// <param name="relativeDock"></param>
 internal void MoveTo(DockablePane sourcePane, Pane destinationPane, Dock relativeDock)
 {
     gridDocking.MoveTo(sourcePane, destinationPane, relativeDock);
 }
예제 #17
0
        public void ShowOverlayPaneDockingOptions(Pane pane)
        {
            Rect rectPane = pane.SurfaceRectangle;

            Point myScreenTopLeft = PointToScreen(new Point(0, 0));
            rectPane.Offset(-myScreenTopLeft.X, -myScreenTopLeft.Y);//relative to me
            gridPaneRelativeDockingOptions.SetValue(Canvas.LeftProperty, rectPane.Left+rectPane.Width/2-gridPaneRelativeDockingOptions.Width/2);
            gridPaneRelativeDockingOptions.SetValue(Canvas.TopProperty, rectPane.Top + rectPane.Height/2-gridPaneRelativeDockingOptions.Height/2);
            gridPaneRelativeDockingOptions.Visibility = Visibility.Visible;

            owdBottom.Enabled = true;
            owdTop   .Enabled = true;
            owdLeft  .Enabled = true;
            owdRight .Enabled = true;
            owdInto  .Enabled = true;
            CurrentDropPane = pane;
        }
예제 #18
0
 public void MoveTo(DockablePane sourcePane, Pane destinationPane, Dock relativeDock)
 {
     Remove(sourcePane);
     Add(sourcePane, destinationPane, relativeDock);
 }
예제 #19
0
        /// <summary>
        /// Dock this pane to a destination pane border
        /// </summary>
        /// <param name="destinationPane"></param>
        /// <param name="relativeDock"></param>
        internal void MoveTo(Pane destinationPane, Dock relativeDock)
        {
            DockablePane dockableDestPane = destinationPane as DockablePane;
            if (dockableDestPane != null)
                ChangeDock(dockableDestPane.Dock);
            else
                ChangeDock(relativeDock);

            DockManager.MoveTo(this, destinationPane, relativeDock);
            ChangeState(PaneState.Docked);
            //Show();
            //ChangeState(PaneState.Docked);
        }
예제 #20
0
 DockablePaneGroup GetPaneGroup(Pane pane)
 {
     return(_rootGroup.GetPaneGroup(pane));
 }
예제 #21
0
        public void MoveInto(Pane source, Pane destination)
        {
            IPane resultPane = Remove(_rootPane, source);
            if (resultPane != null)
                _rootPane = resultPane;

            List<ManagedContent> ar = new List<ManagedContent>();
            foreach (ManagedContent content in source.Contents)
            {
                ar.Add(content);
                destination.Add(content);
            }

            foreach (ManagedContent content in ar)
                source.Remove(content);
        }
예제 #22
0
 internal void SetContainerPane(Pane pane)
 {
     _containerPane = pane;
 }