public Canvas(Panel panelCanvas, MainForm mainForm) { this.panelCanvas = panelCanvas; this.itemDrawings = new List<ItemDrawing>(); this.connectionDrawings = new List<ConnectionDrawing>(); this.mainForm = mainForm; this.viewport = mainForm.circuitManager.circuit.Viewport; this.panelCanvas.MouseUp += new MouseEventHandler(mouseUp); this.panelCanvas.MouseWheel += new MouseEventHandler(mouseWheel); this.panelCanvas.Resize += new EventHandler(resize); this.panelCanvas.MouseMove += new MouseEventHandler(mouseMove); this.panelCanvas.Paint += new PaintEventHandler(paint); this.panelCanvas.DragOver += dragOver; changeSize(panelCanvas.Width, panelCanvas.Height); foreach (Item item in mainForm.circuitManager.circuit.Items) { ItemDrawing itemDrawing = new ItemDrawing(item, viewport, mainForm); itemDrawings.Add(itemDrawing); } this.lastMousePoint = Point.Empty; this.itemPreviewRectangle = new Rectangle(0, 0, viewport.getPixelLength(100), viewport.getPixelLength(100)); }
public ItemDrawing(Item item, Viewport viewport) { this.item = item; this.viewport = viewport; pictureBox = new PictureBox(); refresh(); }
public PortDrawing(Port port, Point location, Viewport viewport, MainForm mainForm) { this.port = port; this.location = location; this.viewport = viewport; this.hovered = false; this.mainForm = mainForm; this.port.PoweredChanged += new Port.PoweredChangedHandler(PowerChanged); initializePictureBox(); }
public ItemDrawing(Item item, Viewport viewport, MainForm mainForm) { this.item = item; this.IsDrawn = false; this.mainForm = mainForm; this.viewport = viewport; setEventHandlers(); initializePictureBox(); createPortDrawings(); refresh(); }
public ConnectionDrawing(Connection connection, Viewport viewport, MainForm mainForm) { this.connection = connection; this.viewport = viewport; this.mainForm = mainForm; }
public Canvas(Panel canvas, Circuit circuit) { this.canvas = canvas; this.itemDrawings = new List<ItemDrawing>(); viewport = new Viewport(circuit, 100, 100); }