public SignalConnector(ref SignalComponent source, ref SignalComponent target) { this.source = source; this.target = target; source.addConnectionOut(this); target.addConnectionOut(this); }
void SignalModelContainer_MouseUp(object sender, MouseEventArgs e) { if (activeSignal != null) { Invalidate(activeSignal.getAffectedRegion()); Update(); activeSignal = null; } }
protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); foreach (SignalComponent signal in signalComponents) { if (signal.Bounds.Contains(e.X, e.Y)) { clearSelected(); activeSignal = signal; activeSignal.Selected = true; activeLocationX = e.X - signal.Location.X; activeLocationY = e.Y - signal.Location.Y; Invalidate(signal.getAffectedRegion()); Update(); } } }
public void addSignal() { SignalComponent priorSignal = null; SignalComponent signal = new SignalComponent(this); if (signalComponents.Count > 0) { priorSignal = signalComponents.Last(); } signalComponents.Add(signal); signal.Location = new Point(10, 10); if (priorSignal != null) { signalConnectors.Add(new SignalConnector(ref priorSignal, ref signal)); } Invalidate(); Update(); }
void SignalModelContainer_MouseUp(object sender, MouseEventArgs e) { if( activeSignal != null ) { Invalidate(activeSignal.getAffectedRegion()); Update(); activeSignal = null; } }
protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); foreach( SignalComponent signal in signalComponents ) { if( signal.Bounds.Contains(e.X, e.Y) ) { clearSelected(); activeSignal = signal; activeSignal.Selected = true; activeLocationX = e.X - signal.Location.X; activeLocationY = e.Y - signal.Location.Y; Invalidate(signal.getAffectedRegion()); Update(); } } }
public void addSignal() { SignalComponent priorSignal = null; SignalComponent signal = new SignalComponent( this ); if( signalComponents.Count > 0 ) priorSignal = signalComponents.Last(); signalComponents.Add(signal); signal.Location = new Point(10, 10); if( priorSignal != null ) signalConnectors.Add( new SignalConnector( ref priorSignal, ref signal ) ); Invalidate(); Update(); }