PaneAtPoint() public static method

public static PaneAtPoint ( Point pt, DockPanel dockPanel ) : DockPane
pt Point
dockPanel DockPanel
return DockPane
            private void TestDrop()
            {
                if (Outline == null || Indicator == null || Indicator.IsDisposed)
                {
                    return;
                }

                Outline.FlagTestDrop = false;

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

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

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

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

                if (!Outline.FlagTestDrop)
                {
                    if (DragSource.IsDockStateValid(DockState.Float))
                    {
                        Rectangle rect = FloatOutlineBounds;
                        rect.Offset(Control.MousePosition.X - StartMousePosition.X, Control.MousePosition.Y - StartMousePosition.Y);
                        Outline.Show(rect);
                    }
                }

                if (!Outline.FlagTestDrop)
                {
                    Cursor.Current = Cursors.No;
                    Outline.Show();
                }
                else
                {
                    Cursor.Current = DragControl.Cursor;
                }
            }
 private void TestDrop()
 {
     this.Outline.FlagTestDrop    = false;
     this.Indicator.FullPanelEdge = ((ModifierKeys & Keys.Shift) != 0);
     if ((ModifierKeys & Keys.Control) == 0)
     {
         this.Indicator.TestDrop();
         if (!this.Outline.FlagTestDrop)
         {
             DockPane pane = DockHelper.PaneAtPoint(MousePosition, this.DockPanel);
             if (pane != null && this.DragSource.IsDockStateValid(pane.DockState))
             {
                 pane.TestDrop(this.DragSource, this.Outline);
             }
         }
         if (!this.Outline.FlagTestDrop && this.DragSource.IsDockStateValid(DockState.Float))
         {
             FloatWindow floatWindow = DockHelper.FloatWindowAtPoint(MousePosition, this.DockPanel);
             if (floatWindow != null)
             {
                 floatWindow.TestDrop(this.DragSource, this.Outline);
             }
         }
     }
     else
     {
         this.Indicator.DockPane = DockHelper.PaneAtPoint(MousePosition, this.DockPanel);
     }
     if (!this.Outline.FlagTestDrop)
     {
         if (this.DragSource.IsDockStateValid(DockState.Float))
         {
             Rectangle rect = this.FloatOutlineBounds;
             rect.Offset(MousePosition.X - this.StartMousePosition.X,
                         MousePosition.Y - this.StartMousePosition.Y);
             this.Outline.Show(rect);
         }
     }
     if (!this.Outline.FlagTestDrop)
     {
         Cursor.Current = Cursors.No;
         this.Outline.Show();
     }
     else
     {
         Cursor.Current = this.DragControl.Cursor;
     }
 }
Esempio n. 3
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 IPaneIndicator)
                        {
                            DragHandler.Outline.Show(DockPane, HitTestResult.Status);
                        }
                        else
                        {
                            DragHandler.Outline.Show(DockPanel, HitTestResult.Status, FullPanelEdge);
                        }
                    }
                }
                public void TestDrop()
                {
                    Point pt = MousePosition;

                    this.DockPane = DockHelper.PaneAtPoint(pt, this.DockPanel);
                    if (TestDrop(this.PanelLeft, pt) != DockStyle.None)
                    {
                        this.HitTestResult = this.PanelLeft;
                    }
                    else if (TestDrop(this.PanelRight, pt) != DockStyle.None)
                    {
                        this.HitTestResult = this.PanelRight;
                    }
                    else if (TestDrop(this.PanelTop, pt) != DockStyle.None)
                    {
                        this.HitTestResult = this.PanelTop;
                    }
                    else if (TestDrop(this.PanelBottom, pt) != DockStyle.None)
                    {
                        this.HitTestResult = this.PanelBottom;
                    }
                    else if (TestDrop(this.PanelFill, pt) != DockStyle.None)
                    {
                        this.HitTestResult = this.PanelFill;
                    }
                    else if (TestDrop(this.PaneDiamond, pt) != DockStyle.None)
                    {
                        this.HitTestResult = this.PaneDiamond;
                    }
                    else
                    {
                        this.HitTestResult = null;
                    }
                    if (this.HitTestResult != null)
                    {
                        if (this.HitTestResult is PaneIndicator)
                        {
                            this.DragHandler.Outline.Show(this.DockPane, this.HitTestResult.Status);
                        }
                        else
                        {
                            this.DragHandler.Outline.Show(this.DockPanel, this.HitTestResult.Status, this.FullPanelEdge);
                        }
                    }
                }