Example #1
0
        protected virtual void grid_MouseDown(GridVirtual sender, MouseEventArgs e)
        {
            if (sender.Selection.BorderRange.IsEmpty() == false)
            {
                Position mousePos = sender.PositionAtPoint(new System.Drawing.Point(e.X, e.Y));

                if (mousePos.IsEmpty() == false)
                {
                    int distance;
                    DevAge.Drawing.RectanglePartType partType = sender.Selection.Border.PointToPartType(sender.Selection.GetDrawingRectangle(),
                                                                                                        new System.Drawing.Point(e.X, e.Y), out distance);
                    if (partType == DevAge.Drawing.RectanglePartType.BottomBorder ||
                        partType == DevAge.Drawing.RectanglePartType.TopBorder ||
                        partType == DevAge.Drawing.RectanglePartType.RightBorder ||
                        partType == DevAge.Drawing.RectanglePartType.LeftBorder)
                    {
                        RangeData data = new RangeData();
                        data.LoadData(sender, sender.Selection.BorderRange, mousePos, mCutMode);
                        if (mCutMode == CutMode.None)
                        {
                            sender.DoDragDrop(data, DragDropEffects.Copy);
                        }
                        else
                        {
                            sender.DoDragDrop(data, DragDropEffects.Move);
                        }
                    }
                }
            }
        }