Пример #1
0
        /// <summary>
        /// Initiate a dragging operation of this pane, relative DockManager is also involved
        /// </summary>
        /// <param name="startDragPoint"></param>
        /// <param name="offset"></param>
        protected virtual void DragPane(Point startDragPoint, Point offset)
        {
            FloatingWindow wnd = new FloatingWindow(this);

            SetFloatingWindowSizeAndPosition(wnd);

            ChangeState(PaneState.DockableWindow);

            DockManager.Drag(wnd, startDragPoint, offset);
        }
Пример #2
0
        /// <summary>
        /// Create and show a dockable window hosting this pane
        /// </summary>
        public virtual void DockableWindow()
        {
            FloatingWindow wnd = new FloatingWindow(this);

            SetFloatingWindowSizeAndPosition(wnd);

            ChangeState(PaneState.DockableWindow);

            wnd.Owner = DockManager.ParentWindow;
            wnd.Show();
        }
Пример #3
0
        /// <summary>
        /// Begins dragging operations
        /// </summary>
        /// <param name="floatingWindow">Floating window containing pane which is dragged by user</param>
        /// <param name="point">Current mouse position</param>
        /// <param name="offset">Offset to be use to set floating window screen position</param>
        /// <returns>Retruns True is drag is completed, false otherwise</returns>
        public bool Drag(FloatingWindow floatingWindow, Point point, Point offset)
        {
            if (!IsMouseCaptured)
            {
                if (CaptureMouse())
                {
                    floatingWindow.Owner = ParentWindow;
                    DragPaneServices.StartDrag(floatingWindow, point, offset);

                    return true;
                }
            }

            return false;
        }
Пример #4
0
        protected virtual void DragContent(DockableContent contentToDrag, Point startDragPoint, Point offset)
        {
            Remove(contentToDrag);
            DockablePane pane = new DockablePane(DockManager);

            //pane = new DockablePane();
            //pane.DockManager = DockManager;
            pane.Add(contentToDrag);
            pane.Show();
            DockManager.Add(pane);
            //DockManager.Add(contentToDrag);
            FloatingWindow wnd = new FloatingWindow(pane);

            pane.ChangeState(PaneState.DockableWindow);
            DockManager.Drag(wnd, startDragPoint, offset);
        }
        public FloatingWindowHostedPane(FloatingWindow floatingWindow, DockablePane referencedPane) : base(referencedPane.DockManager)
        {
            ReferencedPane  = referencedPane;
            _floatingWindow = floatingWindow;

            DockableContent lastSelectedContent = ReferencedPane.ActiveContent;

            ChangeState(ReferencedPane.State);
            //ReferencedPane.Hide();

            //DockManager = ReferencedPane.DockManager;
            foreach (DockableContent content in ReferencedPane.Contents)
            {
                ReferencedPane.Hide(content);
                Add(content);
                Show(content);
                content.SetContainerPane(ReferencedPane);
            }

            ActiveContent = lastSelectedContent;
            ShowHeader    = false;
        }
        public FloatingWindowHostedPane(FloatingWindow floatingWindow, DockablePane referencedPane)
            : base(referencedPane.DockManager)
        {
            ReferencedPane = referencedPane;
            _floatingWindow = floatingWindow;

            DockableContent lastSelectedContent = ReferencedPane.ActiveContent;

            ChangeState(ReferencedPane.State);
            //ReferencedPane.Hide();

            //DockManager = ReferencedPane.DockManager;
            foreach (DockableContent content in ReferencedPane.Contents)
            {
                ReferencedPane.Hide(content);
                Add(content);
                Show(content);
                content.SetContainerPane(ReferencedPane);
            }

            ActiveContent = lastSelectedContent;
            ShowHeader = false;
        }
Пример #7
0
        /// <summary>
        /// Initiate a dragging operation of this pane, relative DockManager is also involved
        /// </summary>
        /// <param name="startDragPoint"></param>
        /// <param name="offset"></param>
        protected virtual void DragPane(Point startDragPoint, Point offset)
        {
            FloatingWindow wnd = new FloatingWindow(this);
            SetFloatingWindowSizeAndPosition(wnd);

            ChangeState(PaneState.DockableWindow);

            DockManager.Drag(wnd, startDragPoint, offset);
        }
Пример #8
0
 internal void SetFloatingWindowSizeAndPosition(FloatingWindow fw)
 {
     fw.Left = ptFloatingWindow.X;
     fw.Top = ptFloatingWindow.Y;
     fw.Width = sizeFloatingWindow.Width;
     fw.Height = sizeFloatingWindow.Height;
 }
Пример #9
0
        /// <summary>
        /// Create and show a floating window hosting this pane
        /// </summary>
        public virtual void FloatingWindow()
        {
            ChangeState(PaneState.FloatingWindow);

            FloatingWindow wnd = new FloatingWindow(this);
            SetFloatingWindowSizeAndPosition(wnd);

            wnd.Owner = DockManager.ParentWindow;
            wnd.Show();
        }
        /// <summary>
        /// TODO
        /// </summary>
        private void InitiateFloating()
        {
            if (ManagedView.ParentContent == null)
                return;

            FloatingWindow floatingWindow = new FloatingWindow(_mouseXForFloatingWindow, ManagedView.ParentContent as FrameworkElement)
            {
                Owner = Window.GetWindow(ManagedItem)
            };

            //store the view or it will get destroyed
            View floatingView = ManagedView;

            floatingView.DockManager.AddFunctionalChild(floatingWindow);
            floatingView.ViewGroup.Remove(floatingView);

            //Initialize the floating window content
            TabGroup floatingTabGroup = new TabGroup();
            floatingTabGroup.Add(floatingView);
            floatingWindow.Content = floatingTabGroup;

            floatingWindow.Show();
            //After the window has been fully initialized, start dragging, since it's just been popped out
            if (Mouse.LeftButton == MouseButtonState.Pressed)
                floatingWindow.DragMove();
        }
Пример #11
0
        public void EndDrag(Point point)
        {
            IDropSurface dropSufrace = null;
            foreach (IDropSurface surface in Surfaces)
            {
                if (surface.SurfaceRectangle.Contains(point))
                {
                    if (surface.OnDrop(point))
                    {
                        dropSufrace = surface;
                        break;
                    }
                }
            }

            foreach (IDropSurface surface in SurfacesWithDragOver)
            {
                if (surface != dropSufrace)
                {
                    surface.OnDragLeave(point);
                }
            }

            SurfacesWithDragOver.Clear();

            if (dropSufrace != null)
                _wnd.Close();

            _wnd = null;
            _pane = null;
        }
Пример #12
0
        public void StartDrag(FloatingWindow wnd, Point point, Point offset)
        {
            _pane = wnd.HostedPane;
            Offset = offset;

            _wnd = wnd;

            if (Offset.X >= _wnd.Width)
                Offset.X = _wnd.Width / 2;

            _wnd.Left = point.X - Offset.X;
            _wnd.Top = point.Y - Offset.Y;
            _wnd.Show();

            foreach (IDropSurface surface in Surfaces)
            {
                if (surface.SurfaceRectangle.Contains(point))
                {
                    SurfacesWithDragOver.Add(surface);
                    surface.OnDragEnter(point);
                }
            }
        }
Пример #13
0
 protected virtual void DragContent(DockableContent contentToDrag, Point startDragPoint, Point offset)
 {
     Remove(contentToDrag);
     DockablePane pane = new DockablePane(DockManager);
     //pane = new DockablePane();
     //pane.DockManager = DockManager;
     pane.Add(contentToDrag);
     pane.Show();
     DockManager.Add(pane);
     //DockManager.Add(contentToDrag);
     FloatingWindow wnd = new FloatingWindow(pane);
     pane.ChangeState(PaneState.DockableWindow);
     DockManager.Drag(wnd, startDragPoint, offset);
 }
Пример #14
0
        /// <summary>
        /// Begins dragging operations
        /// </summary>
        /// <param name="floatingWindow">Floating window containing pane which is dragged by user</param>
        /// <param name="point">Current mouse position</param>
        /// <param name="offset">Offset to be use to set floating window screen position</param>
        /// <returns>Retruns True is drag is completed, false otherwise</returns>
        public bool Drag(FloatingWindow floatingWindow, Point point, Point offset)
        {
            if (!IsMouseCaptured)
            {
                if (CaptureMouse())
                {
                    floatingWindow.Owner = ParentWindow;
                    DragPaneServices.StartDrag(floatingWindow, point, offset);

                    return true;
                }
            }

            return false;
        }