コード例 #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
ファイル: DockingGrid.xaml.cs プロジェクト: truonghinh/TnX
        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
ファイル: DockablePaneGroup.cs プロジェクト: truonghinh/TnX
 /// <summary>
 /// Create a group with a single pane
 /// </summary>
 /// <param name="pane">Attached pane</param>
 public DockablePaneGroup(Pane pane)
 {
     _attachedPane = pane;
 }
コード例 #5
0
ファイル: DockablePaneGroup.cs プロジェクト: truonghinh/TnX
        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
ファイル: DockablePaneGroup.cs プロジェクト: truonghinh/TnX
        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
ファイル: DockingGrid.cs プロジェクト: truonghinh/TnX
        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
ファイル: DockingGrid.xaml.cs プロジェクト: truonghinh/TnX
 DockablePaneGroup GetPaneGroup(Pane pane)
 {
     return _rootGroup.GetPaneGroup(pane);
 }
コード例 #12
0
ファイル: DockingGrid.xaml.cs プロジェクト: truonghinh/TnX
 public void MoveTo(DockablePane sourcePane, Pane destinationPane, Dock relativeDock)
 {
     Remove(sourcePane);
     Add(sourcePane, destinationPane, relativeDock);
 }
コード例 #13
0
ファイル: DockingGrid.xaml.cs プロジェクト: truonghinh/TnX
 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
ファイル: DockingGrid.cs プロジェクト: truonghinh/TnX
        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
ファイル: ManagedContent.cs プロジェクト: truonghinh/TnX
 internal void SetContainerPane(Pane pane)
 {
     _containerPane = pane;
 }