Exemple #1
0
        private void TestDrop()
        {
            DockOutline.FlagTestDrop = false;

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

            if ((Control.ModifierKeys & Keys.Control) == 0)
            {
                DockIndicator.TestDrop();

                if (!DockOutline.FlagTestDrop)
                {
                    DockPane pane = DockHelper.PaneAtPoint(Control.MousePosition, DockPanel);
                    if (pane != null && IsDockStateValid(pane.DockState))
                    {
                        pane.TestDrop(this);
                    }
                }

                if (!DockOutline.FlagTestDrop && IsDockStateValid(DockState.Float))
                {
                    FloatWindow floatWindow = DockHelper.FloatWindowAtPoint(Control.MousePosition, DockPanel);
                    if (floatWindow != null)
                    {
                        floatWindow.TestDrop(this);
                    }
                }
            }
            else
            {
                DockIndicator.DockPane = DockHelper.PaneAtPoint(Control.MousePosition, DockPanel);
            }

            if (!DockOutline.FlagTestDrop)
            {
                if (IsDockStateValid(DockState.Float))
                {
                    DockOutline.Show(GetFloatWindowBounds());
                }
            }

            if (!DockOutline.FlagTestDrop)
            {
                User32.SetCursor(Cursors.No.Handle);
                DockOutline.Show();
            }
            else
            {
                User32.SetCursor(DragControl.Cursor.Handle);
            }
        }
Exemple #2
0
        public void TestDrop()
        {
            Point pt = Control.MousePosition;

            DockPane = DockHelper.PaneAtPoint(pt, DockPanel);

            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 PaneIndicator)
                {
                    DragHandler.DockOutline.Show(DockPane, HitTestResult.Status);
                }
                else
                {
                    DragHandler.DockOutline.Show(DockPanel, HitTestResult.Status, FullPanelEdge);
                }
            }
        }