Exemplo n.º 1
0
 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);
         }
     }
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 private void PracticeTimer_Paint(object sender, PaintEventArgs e)
 {
     practiceClockLabel.Text = practiceClock.getTimeString(false);
 }