Example #1
0
 public EditShapeDialog(Shape shape)
 {
     InitializeComponent();
     this.colorDialog.Color = shape.Color;
     this.lineThicknessNumber.Value = shape.LineWidth;
     this._shape = shape;
 }
Example #2
0
        public override void OnMouseDown(CanvasPanel canvasPanel, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                SelectedShape = GetClickedShape(canvasPanel, e);
                if (this.SelectedShape != null)
                {
                    canvasPanel.Cursor = Cursors.SizeAll;
                    _dragInfo = new DragInfo(e, SelectedShape.GetHandlerAt(e.Location));
                }

            }

            canvasPanel.Refresh();
        }
Example #3
0
 public override void OnDeactivate(CanvasPanel canvasPanel)
 {
     this.SelectedShape = null;
 }
Example #4
0
 private void DeleteSelectedShape(CanvasPanel canvasPanel)
 {
     canvasPanel.Shapes.Remove(SelectedShape);
     SelectedShape = null;
 }
Example #5
0
 public ShapeEventArgs(Shape createdShape)
 {
     Shape = createdShape;
 }