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);
        }
Exemple #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);
        }
Exemple #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);
                }
            }
        }
Exemple #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);
        }
        /// <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;
            }
        }
Exemple #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);
            }
        }
Exemple #7
0
 bool IDragSource.CanDrop(DockPane targetPane)
 {
     return(DockManager.CanDrop(DockPane, targetPane));
 }
Exemple #8
0
 bool IDragSource.CanDrop(DockTreePosition dockTreePosition)
 {
     return(DockManager.CanDrop(DockPane, dockTreePosition));
 }
Exemple #9
0
 Rect IDragSource.GetFloatingWindowPreview(RelativePoint mouseStartPosition)
 {
     return(DockManager.GetDefaultFloatingPreview(DockControl, mouseStartPosition.Point));
 }
Exemple #10
0
 private static void OnToggleFloatingExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     DockManager.ToggleFloating(((AutoHideWindow)sender).DockItem);
 }
Exemple #11
0
 private static void OnToggleFloatingExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     DockManager.ToggleFloating(((DockWindow)sender).DockPane);
 }
Exemple #12
0
 void IDragSource.Drop(DockPane targetPane, DockPanePreviewPlacement placement)
 {
     DockManager.Drop(DockPane, targetPane, placement);
 }
Exemple #13
0
 void IDragSource.Drop(Dock dock, bool sendToBack)
 {
     DockManager.Drop(DockPane, dock, sendToBack);
 }
 void IDragSource.Drop()
 {
     DockManager.Drop(FloatingWindow);
 }
 void IDragSource.Drop(Dock dock, bool sendToBack)
 {
     DockManager.Drop(FloatingWindow, dock, sendToBack);
 }
 bool IDragSource.CanDrop(DockItem targetItem)
 {
     return(DockManager.CanDrop(FloatingWindow, targetItem));
 }
 bool IDragSource.CanDrop(DockPane targetPane)
 {
     return(DockManager.CanDrop(FloatingWindow, targetPane));
 }
 bool IDragSource.CanDrop(DockTreePosition dockTreePosition)
 {
     return(DockManager.CanDrop(FloatingWindow, dockTreePosition));
 }
Exemple #19
0
 bool IDragSource.CanDrop(DockPane targetPane)
 {
     return DockManager.CanDrop(DockItem, targetPane);
 }
Exemple #20
0
 bool IDragSource.CanDrop(DockItem targetItem)
 {
     return(DockManager.CanDrop(DockPane, targetItem));
 }
Exemple #21
0
 void IDragSource.Drop()
 {
     DockManager.Drop(DockPane);
 }
 void IDragSource.Drop(DockItem targetItem)
 {
     DockManager.Drop(FloatingWindow, targetItem);
 }
Exemple #23
0
 void IDragSource.Drop(Rect floatingWindowBounds)
 {
     DockManager.Drop(DockPane, floatingWindowBounds);
 }
Exemple #24
0
 bool IDragSource.CanDrop(DockTreePosition dockTreePosition)
 {
     return DockManager.CanDrop(DockItem, dockTreePosition);
 }
Exemple #25
0
 void IDragSource.Drop(DockItem targetItem)
 {
     DockManager.Drop(DockPane, targetItem);
 }
Exemple #26
0
 void IDragSource.Drop()
 {
     DockManager.Drop(DockItem);
 }
 void OnToggleFloatingExecuted()
 {
     DockManager.ToggleFloating(FloatingWindow);
 }
Exemple #28
0
 bool IDragSource.CanDrop(DockItem targetItem)
 {
     return DockManager.CanDrop(DockItem, targetItem);
 }