public EditShapeDialog(Shape shape) { InitializeComponent(); this.colorDialog.Color = shape.Color; this.lineThicknessNumber.Value = shape.LineWidth; this._shape = shape; }
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(); }
public override void OnDeactivate(CanvasPanel canvasPanel) { this.SelectedShape = null; }
private void DeleteSelectedShape(CanvasPanel canvasPanel) { canvasPanel.Shapes.Remove(SelectedShape); SelectedShape = null; }
public ShapeEventArgs(Shape createdShape) { Shape = createdShape; }