private void PracticeTimer_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.R) { practiceClock.reset(); } else if (e.KeyCode == Keys.Space) { if (practiceClock.isRunning()) { practiceClock.stop(); } else { practiceClock.start(); } } else if (e.KeyCode == Keys.Escape) { if (!practiceClock.isRunning()) { this.Close(); } } else if (e.KeyCode == Keys.Up) { practiceClock.setNextMinute(); } else if (e.KeyCode == Keys.Down) { practiceClock.setLastMinute(); } }
private void CurlClockForm_Paint(object sender, PaintEventArgs e) { clockLabel1.Text = clock1.getTimeString(); clockLabel2.Text = clock2.getTimeString(); clockLabel3.Text = clock3.getTimeString(); clockTeamLabel1.Text = clock1.ClockName; clockTeamLabel2.Text = clock2.ClockName; clockLabel1.ForeColor = clock1.TextColor; clockTeamLabel1.ForeColor = clock1.isRunning() ? clock1.ClockColor : clock1.TextColor; clockLabel2.ForeColor = clock2.TextColor; clockTeamLabel2.ForeColor = clock2.isRunning() ? clock2.ClockColor : clock2.TextColor; clockPanel1.BackColor = clock1.ClockColor; teamPanel1.BackColor = clock1.isRunning() ? clock1.TextColor : clock1.ClockColor; clockPanel2.BackColor = clock2.ClockColor; teamPanel2.BackColor = clock2.isRunning() ? clock2.TextColor : clock2.ClockColor; }
private void setClockDialog(SimpleClock clock, string title) { if (!clock.isRunning()) { string[] currtime = clock.getTimeString().Split(':'); ClockSetDialog csd = new ClockSetDialog(Int32.Parse(currtime[0]), Int32.Parse(currtime[1]), title); if (csd.ShowDialog() == DialogResult.OK) { clock.setTime(csd.Minutes, csd.Seconds); } } }