public void TestDrop(DockHelper.CursorPoint info)
                {
                    Point pt = info.Cursor;

                    DockPane = info.Pane;

                    if (TestDrop(PanelLeft, pt) != DockStyle.None)
                    {
                        HitTestResult = PanelLeft;
                    }
                    else if (TestDrop(PanelRight, pt) != DockStyle.None)
                    {
                        HitTestResult = PanelRight;
                    }
                    else if (TestDrop(PanelTop, pt) != DockStyle.None)
                    {
                        HitTestResult = PanelTop;
                    }
                    else if (TestDrop(PanelBottom, pt) != DockStyle.None)
                    {
                        HitTestResult = PanelBottom;
                    }
                    else if (TestDrop(PanelFill, pt) != DockStyle.None)
                    {
                        HitTestResult = PanelFill;
                    }
                    else if (TestDrop(PaneDiamond, pt) != DockStyle.None)
                    {
                        HitTestResult = PaneDiamond;
                    }
                    else
                    {
                        HitTestResult = null;
                    }

                    if (HitTestResult != null)
                    {
                        if (HitTestResult is IPaneIndicator)
                        {
                            DragHandler.Outline.Show(DockPane, HitTestResult.Status);
                        }
                        else
                        {
                            DragHandler.Outline.Show(DockPanel, HitTestResult.Status, FullPanelEdge);
                        }
                    }
                }
Exemplo n.º 2
0
        internal void TestDrop(DockHelper.CursorPoint info, DockOutlineBase dockOutline)
        {
            if (VisibleNestedPanes.Count == 1)
            {
                DockPane pane = VisibleNestedPanes[0];
                if (!info.DragSource.CanDockTo(pane))
                {
                    return;
                }

                Point ptMouse = info.Cursor;
                uint  lParam  = Win32Helper.MakeLong(ptMouse.X, ptMouse.Y);
                if (!Win32Helper.IsRunningOnMono)
                {
                    if (NativeMethods.SendMessage(Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, lParam) == (uint)Win32.HitTest.HTCAPTION)
                    {
                        dockOutline.Show(VisibleNestedPanes[0], -1);
                    }
                }
            }
        }
            private void TestDrop()
            {
                Outline.FlagTestDrop = false;

                Indicator.FullPanelEdge = ((Control.ModifierKeys & Keys.Shift) != 0);

                DockHelper.CursorPoint cursorPointInfo = DockHelper.CursorPointInformation(DockPanel, DragSource);

                if ((Control.ModifierKeys & Keys.Control) == 0)
                {
                    if (Indicator.Visible == false)
                    {
                        // show indicator when the cursor comes into the dock panel area
                        if (cursorPointInfo.DockPanel != null)
                        {
                            Indicator.Show(false);
                        }
                    }

                    Indicator.TestDrop(cursorPointInfo);

                    if (!Outline.FlagTestDrop)
                    {
                        if (cursorPointInfo.Pane != null && DragSource.IsDockStateValid(cursorPointInfo.Pane.DockState))
                        {
                            cursorPointInfo.Pane.TestDrop(cursorPointInfo, Outline);
                        }
                    }

                    if (!Outline.FlagTestDrop && DragSource.IsDockStateValid(DockState.Float))
                    {
                        if (cursorPointInfo.FloatWindow != null)
                        {
                            cursorPointInfo.FloatWindow.TestDrop(cursorPointInfo, Outline);
                        }
                    }
                }
                else
                {
                    Indicator.DockPane = cursorPointInfo.Pane;
                }

                if (!Outline.FlagTestDrop)
                {
                    Rectangle rect = FloatOutlineBounds;
                    rect.Offset(Control.MousePosition.X - StartMousePosition.X, Control.MousePosition.Y - StartMousePosition.Y);

                    // do not show the outline when a user is moving a floating window
                    if (!(DragSource is FloatWindow) && DragSource.IsDockStateValid(DockState.Float))
                    {
                        Outline.Show(rect, true);
                    }
                    else
                    {
                        Cursor.Current = Cursors.No;
                        Outline.Show(rect, false);
                    }
                }

                if (!Outline.FlagTestDrop)
                {
                }
                else
                {
                    Cursor.Current = DragControl.Cursor;
                }
            }