public virtual void OnCurrentProbe() { ProbeState p = (ProbeState)VisualGrid.availableStates[typeof(ProbeState)]; p.ptype = ProbeType.current; VisualGrid.ChangeState(typeof(ProbeState)); }
public virtual void OnVoltageProbe() { ProbeState p = (ProbeState)VisualGrid.availableStates[typeof(ProbeState)]; p.ptype = ProbeType.voltage; VisualGrid.ChangeState(typeof(ProbeState)); }
public override void OnKeyBoardEvent(KeyEventArgs e) { base.OnKeyBoardEvent(e); if (e.Key == Key.Escape) { VisualGrid.ChangeState(typeof(SelectionState)); } }
public override void OnKeyBoardEvent(KeyEventArgs e) { base.OnKeyBoardEvent(e); if (e.Key == Key.Escape) { VisualGrid.ChangeState(typeof(SelectionState)); } if (e.Key == Key.R) { if (tempR != null) { rotation += 90; rotation = rotation > 270 ? 0 : rotation; tempR.RenderTransform = new RotateTransform(rotation, 50, 50); } } }
public override void OnKeyBoardEvent(KeyEventArgs e) { base.OnKeyBoardEvent(e); if (e.Key == Key.W) { VisualGrid.ChangeState(typeof(WireState)); } else if (e.Key == Key.P) { VisualGrid.ChangeState(typeof(ComponentState)); } else if (e.Key == Key.Delete || e.Key == Key.Back) { ComponentManager.DeleteComponent(posX, posY, SelectedComponent); SelectedComponent = null; } }
public override void OnKeyBoardEvent(KeyEventArgs e) { base.OnKeyBoardEvent(e); if (e.Key == Key.Escape) { //means we were drawing and now want to quit if (started) { started = false; currentCanvas.Children.RemoveAt(tempLineIndex); tempLine = null; } //if not, then we want to switch to selection mode else { VisualGrid.ChangeState(typeof(SelectionState)); } } }