Exemplo n.º 1
0
        private IntPtr FilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            switch (msg)
            {
            case WM_CLOSE:
                if (FloatingWindow != null && FloatingWindow.DockControl != null)
                {
                    PerformClose();
                    handled = true;
                }
                break;

            case WM_NCLBUTTONDOWN:
                if (wParam.ToInt32() == HTCAPTION && WindowState != WindowState.Maximized)
                {
                    short x = (short)((lParam.ToInt32() & 0xFFFF));
                    short y = (short)((lParam.ToInt32() >> 16));

                    Point pt = new Point(x, y);
                    DockManager.BeginDrag(this, this, pt);
                }
                break;

            case WM_NCLBUTTONDBLCLK:
                if (wParam.ToInt32() == HTCAPTION)
                {
                    handled = DockCommands.Execute(this, DoubleClickCommand);
                }
                break;

            case WM_NCRBUTTONDOWN:
                if (wParam.ToInt32() == HTCAPTION && FloatingWindow.CountOfVisiblePanes == 1)
                {
                    short x = (short)((lParam.ToInt32() & 0xFFFF));
                    short y = (short)((lParam.ToInt32() >> 16));

                    ContextMenu menu = FloatingWindow.FirstVisiblePane.SelectedItem.TabContextMenu;
                    if (menu != null)
                    {
                        menu.Placement          = PlacementMode.AbsolutePoint;
                        menu.PlacementRectangle = new Rect(new Point(x, y), new Size(0, 0));
                        menu.PlacementTarget    = this;
                        menu.IsOpen             = true;
                    }
                }
                handled = true;
                break;
            }

            return(IntPtr.Zero);
        }
Exemplo n.º 2
0
        /// <exclude />
        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
        {
            base.OnMouseLeftButtonDown(e);
            if (e.Handled || !DockManager.CanDrag(e))
                return;

            if (e.ClickCount == 1)
            {
                DockManager.BeginDrag(this, this, e);
                e.Handled = true;
            }
            else if (e.ClickCount == 2)
                e.Handled = DockCommands.Execute(this, DoubleClickCommand);
        }
Exemplo n.º 3
0
        void Refresh()
        {
            if (DockControl == null)
            {
                return;
            }

            LeftSplitterWidth    = ConvertSplitterSize(DockControl.LeftDockTree.IsVisible);
            RightSplitterWidth   = ConvertSplitterSize(DockControl.RightDockTree.IsVisible);
            TopSplitterHeight    = ConvertSplitterSize(DockControl.TopDockTree.IsVisible);
            BottomSplitterHeight = ConvertSplitterSize(DockControl.BottomDockTree.IsVisible);

            IsLeftGuideVisible     = DockManager.GetShowsLeftGuide(DockControl);
            IsRightGuideVisible    = DockManager.GetShowsRightGuide(DockControl);
            IsTopGuideVisible      = DockManager.GetShowsTopGuide(DockControl);
            IsBottomGuideVisible   = DockManager.GetShowsBottomGuide(DockControl);
            IsDocumentGuideVisible = DockManager.GetShowsFillGuide(DockControl);

            LeftTreeWidth = RightTreeWidth = TopTreeHeight = BottomTreeHeight = new GridLength();
            DockTreeClient dockTreeClient = FindVisualChild <DockTreeClient>(DockControl);

            foreach (DockTreeControl dockTreeControl in FindVisualChildren <DockTreeControl>(dockTreeClient))
            {
                DockTree dockTree = dockTreeControl.DockTree;
                if (dockTree == null)
                {
                    continue;
                }
                if (dockTree.Position == DockTreePosition.Left)
                {
                    LeftTreeWidth = new GridLength(dockTreeControl.ActualWidth);
                }
                else if (dockTree.Position == DockTreePosition.Right)
                {
                    RightTreeWidth = new GridLength(dockTreeControl.ActualWidth);
                }
                else if (dockTree.Position == DockTreePosition.Top)
                {
                    TopTreeHeight = new GridLength(dockTreeControl.ActualHeight);
                }
                else if (dockTree.Position == DockTreePosition.Bottom)
                {
                    BottomTreeHeight = new GridLength(dockTreeControl.ActualHeight);
                }
            }
        }
Exemplo n.º 4
0
        private void Attach(FrameworkElement associatedElement)
        {
            Debug.Assert(associatedElement != null);

            if (AssociatedElement != null)
            {
                throw new InvalidOperationException(SR.Exception_OverlayActivator_HostMultipleTimes);
            }

            if (!associatedElement.IsLoaded)
            {
                return;
            }

            AssociatedElement                 = associatedElement;
            Container                         = new ContentPresenter();
            Container.Content                 = Content ?? AssociatedElement;
            Container.ContentTemplate         = ContentTemplate;
            Container.ContentTemplateSelector = ContentTemplateSelector;
            DockManager.AddOverlay(this);
        }
Exemplo n.º 5
0
        /// <exclude />
        protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
        {
            base.OnMouseRightButtonDown(e);
            if (e.Handled || !DockManager.CanDrag(e))
            {
                return;
            }

            if (FloatingWindow.CountOfVisiblePanes == 1)
            {
                Point       pt   = e.GetPosition(this);
                ContextMenu menu = FloatingWindow.FirstVisiblePane.SelectedItem.TabContextMenu;
                if (menu != null)
                {
                    menu.Placement          = PlacementMode.RelativePoint;
                    menu.PlacementRectangle = new Rect(pt, new Size(0, 0));
                    menu.PlacementTarget    = this;
                    menu.IsOpen             = true;
                }
                e.Handled = true;
            }
        }
Exemplo n.º 6
0
        /// <exclude />
        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
        {
            base.OnMouseLeftButtonDown(e);
            if (e.Handled)
            {
                return;
            }

            if (e.ClickCount == 1)
            {
                DockItem dockItem = DockItem;
                if (dockItem != null)
                {
                    dockItem.Activate();
                    UpdateLayout(); // Fix in 2.0.4846: this can avoid unnecessary mouse move event caused by layout change
                }
                DockManager.BeginDrag(this, this, e);
                e.Handled = true;
            }
            else if (e.ClickCount == 2)
            {
                e.Handled = DockCommands.Execute(this, DoubleClickCommand);
            }
        }
Exemplo n.º 7
0
 bool IDragSource.CanDrop(DockPane targetPane)
 {
     return(DockManager.CanDrop(DockPane, targetPane));
 }
Exemplo n.º 8
0
 bool IDragSource.CanDrop(DockTreePosition dockTreePosition)
 {
     return(DockManager.CanDrop(DockPane, dockTreePosition));
 }
Exemplo n.º 9
0
 Rect IDragSource.GetFloatingWindowPreview(RelativePoint mouseStartPosition)
 {
     return(DockManager.GetDefaultFloatingPreview(DockControl, mouseStartPosition.Point));
 }
Exemplo n.º 10
0
 private static void OnToggleFloatingExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     DockManager.ToggleFloating(((AutoHideWindow)sender).DockItem);
 }
Exemplo n.º 11
0
 private static void OnToggleFloatingExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     DockManager.ToggleFloating(((DockWindow)sender).DockPane);
 }
Exemplo n.º 12
0
 void IDragSource.Drop(DockPane targetPane, DockPanePreviewPlacement placement)
 {
     DockManager.Drop(DockPane, targetPane, placement);
 }
Exemplo n.º 13
0
 void IDragSource.Drop(Dock dock, bool sendToBack)
 {
     DockManager.Drop(DockPane, dock, sendToBack);
 }
Exemplo n.º 14
0
 void IDragSource.Drop()
 {
     DockManager.Drop(FloatingWindow);
 }
Exemplo n.º 15
0
 void IDragSource.Drop(Dock dock, bool sendToBack)
 {
     DockManager.Drop(FloatingWindow, dock, sendToBack);
 }
Exemplo n.º 16
0
 bool IDragSource.CanDrop(DockItem targetItem)
 {
     return(DockManager.CanDrop(FloatingWindow, targetItem));
 }
Exemplo n.º 17
0
 bool IDragSource.CanDrop(DockPane targetPane)
 {
     return(DockManager.CanDrop(FloatingWindow, targetPane));
 }
Exemplo n.º 18
0
 bool IDragSource.CanDrop(DockTreePosition dockTreePosition)
 {
     return(DockManager.CanDrop(FloatingWindow, dockTreePosition));
 }
Exemplo n.º 19
0
 bool IDragSource.CanDrop(DockPane targetPane)
 {
     return DockManager.CanDrop(DockItem, targetPane);
 }
Exemplo n.º 20
0
 bool IDragSource.CanDrop(DockItem targetItem)
 {
     return(DockManager.CanDrop(DockPane, targetItem));
 }
Exemplo n.º 21
0
 void IDragSource.Drop()
 {
     DockManager.Drop(DockPane);
 }
Exemplo n.º 22
0
 void IDragSource.Drop(DockItem targetItem)
 {
     DockManager.Drop(FloatingWindow, targetItem);
 }
Exemplo n.º 23
0
 void IDragSource.Drop(Rect floatingWindowBounds)
 {
     DockManager.Drop(DockPane, floatingWindowBounds);
 }
Exemplo n.º 24
0
 bool IDragSource.CanDrop(DockTreePosition dockTreePosition)
 {
     return DockManager.CanDrop(DockItem, dockTreePosition);
 }
Exemplo n.º 25
0
 void IDragSource.Drop(DockItem targetItem)
 {
     DockManager.Drop(DockPane, targetItem);
 }
Exemplo n.º 26
0
 void IDragSource.Drop()
 {
     DockManager.Drop(DockItem);
 }
Exemplo n.º 27
0
 void OnToggleFloatingExecuted()
 {
     DockManager.ToggleFloating(FloatingWindow);
 }
Exemplo n.º 28
0
 bool IDragSource.CanDrop(DockItem targetItem)
 {
     return DockManager.CanDrop(DockItem, targetItem);
 }