public PracticeTimer() { InitializeComponent(); AdjustFontSizes(); practiceClock = new SimpleClock(PRACTICE_TIME, 0); // clock refresh timing System.Windows.Forms.Timer clockTick = new System.Windows.Forms.Timer(); clockTick.Interval = 100; clockTick.Tick += new EventHandler(forceRedraw); clockTick.Enabled = true; }
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); } } }
private void configClockDialog(SimpleClock clock, string title) { ClockConfigDialog ccd = new ClockConfigDialog(clock.ClockName, clock.ClockColor, clock.TextColor, title, clock.StartKey, clock.StartKeyChar); if (ccd.ShowDialog() == DialogResult.OK) { clock.ClockName = ccd.TeamName; clock.ClockColor = ccd.ClockColor; clock.TextColor = ccd.TextColor; clock.StartKey = ccd.StartKey; clock.StartKeyChar = ccd.StartKeyChar; updateKeyShortcuts(); AdjustFontSizes(); } }
public CurlClockForm() { InitializeComponent(); this.WindowState = FormWindowState.Maximized; //menuStrip1.Visible = false; //AdjustFontSizes(); // try to read game from settings try { GameType game = (GameType)Enum.Parse(typeof(GameType), Properties.Settings.Default.GameType); SelectedGame = game; } catch (Exception) { SelectedGame = GameType.TenEndGame; } clock1 = new SimpleClock(gameStartClockTime(), 0, Properties.Settings.Default.UpperClockName, Properties.Settings.Default.UpperClockColor, Properties.Settings.Default.UpperClockTextColor, Properties.Settings.Default.UpperClockStartKey, Properties.Settings.Default.UpperClockStartKeyChar); clock2 = new SimpleClock(gameStartClockTime(), 0, Properties.Settings.Default.LowerClockName, Properties.Settings.Default.LowerClockColor, Properties.Settings.Default.LowerClockTextColor, Properties.Settings.Default.LowerClockStartKey, Properties.Settings.Default.LowerClockStartKeyChar); clock3 = new SimpleClock(1, 0, "Timeout", Color.Gray, Color.Black, Keys.T, "T"); updateKeyShortcuts(); clockLabel1.Text = clock1.getTimeString(); clockLabel2.Text = clock2.getTimeString(); clockLabel3.Text = clock3.getTimeString(); AdjustFontSizes(); // clock refresh timing System.Windows.Forms.Timer clockTick = new System.Windows.Forms.Timer(); clockTick.Interval = 100; clockTick.Tick += new EventHandler(forceRedraw); clockTick.Enabled = true; }