예제 #1
0
        private void PaneSplitter_OnDragging()
        {
            Rectangle rect = GetPaneSplitterDragRectangle();

            DragOutline = DrawHelper.CreateDragOutline(rect, OutlineBorderWidth);
        }
예제 #2
0
        internal void TestDrop(DragHandler dragHandler, Point pt)
        {
            if (DockArea.Width <= 0 || DockArea.Height <= 0)
            {
                return;
            }

            Point ptClient = PointToClient(pt);

            int       dragSize = MeasurePane.DragSize;
            Rectangle rectDoc  = DocumentRectangle;

            if (ptClient.Y - rectDoc.Top >= 0 && ptClient.Y - rectDoc.Top < dragSize &&
                DockWindows[DockState.DockTop].DisplayingList.Count == 0 &&
                dragHandler.IsDockStateValid(DockState.DockTop))
            {
                dragHandler.DropTarget.SetDropTarget(this, DockStyle.Top);
            }
            else if (rectDoc.Bottom - ptClient.Y >= 0 && rectDoc.Bottom - ptClient.Y < dragSize &&
                     DockWindows[DockState.DockBottom].DisplayingList.Count == 0 &&
                     dragHandler.IsDockStateValid(DockState.DockBottom))
            {
                dragHandler.DropTarget.SetDropTarget(this, DockStyle.Bottom);
            }
            else if (rectDoc.Right - ptClient.X >= 0 && rectDoc.Right - ptClient.X < dragSize &&
                     DockWindows[DockState.DockRight].DisplayingList.Count == 0 &&
                     dragHandler.IsDockStateValid(DockState.DockRight))
            {
                dragHandler.DropTarget.SetDropTarget(this, DockStyle.Right);
            }
            else if (ptClient.X - rectDoc.Left >= 0 && ptClient.X - rectDoc.Left < dragSize &&
                     DockWindows[DockState.DockLeft].DisplayingList.Count == 0 &&
                     dragHandler.IsDockStateValid(DockState.DockLeft))
            {
                dragHandler.DropTarget.SetDropTarget(this, DockStyle.Left);
            }
            else if (((ptClient.Y - rectDoc.Top >= dragSize && ptClient.Y - rectDoc.Top < 2 * dragSize) ||
                      (rectDoc.Bottom - ptClient.Y >= dragSize && rectDoc.Bottom - ptClient.Y < 2 * dragSize) ||
                      (rectDoc.Right - ptClient.X >= dragSize && rectDoc.Right - ptClient.X < 2 * dragSize) ||
                      (ptClient.X - rectDoc.Left >= dragSize && ptClient.X - rectDoc.Left < 2 * dragSize)) &&
                     DockWindows[DockState.Document].DisplayingList.Count == 0 &&
                     dragHandler.IsDockStateValid(DockState.Document))
            {
                dragHandler.DropTarget.SetDropTarget(this, DockStyle.Fill);
            }
            else
            {
                return;
            }

            if (dragHandler.DropTarget.SameAsOldValue)
            {
                return;
            }

            Rectangle rect = DockArea;

            if (dragHandler.DropTarget.Dock == DockStyle.Top)
            {
                rect.Height = (int)(DockArea.Height * DockTopPortion);
            }
            else if (dragHandler.DropTarget.Dock == DockStyle.Bottom)
            {
                rect.Height = (int)(DockArea.Height * DockBottomPortion);
                rect.Y      = DockArea.Bottom - rect.Height;
            }
            else if (dragHandler.DropTarget.Dock == DockStyle.Left)
            {
                rect.Width = (int)(DockArea.Width * DockLeftPortion);
            }
            else if (dragHandler.DropTarget.Dock == DockStyle.Right)
            {
                rect.Width = (int)(DockArea.Width * DockRightPortion);
                rect.X     = DockArea.Right - rect.Width;
            }
            else if (dragHandler.DropTarget.Dock == DockStyle.Fill)
            {
                rect = DocumentRectangle;
            }

            rect.Location           = PointToScreen(rect.Location);
            dragHandler.DragOutline = DrawHelper.CreateDragOutline(rect, dragSize);
        }
예제 #3
0
        private void AutoHideWindowSplitter_OnDragging()
        {
            Rectangle rect = GetWindowSplitterDragRectangle();

            DragOutline = DrawHelper.CreateDragOutline(rect, OutlineBorderWidth);
        }