MainForm.cs
changeset 8 5129c03ab7ba
parent 7 69815d19796c
child 9 7c363a7a975e
     1.1 --- a/MainForm.cs	Tue Jul 08 16:41:29 2014 +0200
     1.2 +++ b/MainForm.cs	Tue Jul 08 18:59:07 2014 +0200
     1.3 @@ -23,6 +23,9 @@
     1.4  
     1.5              InitializeComponent();
     1.6              UpdateStatus();
     1.7 +            //Load settings
     1.8 +            marqueeLabelTop.Font = Properties.Settings.Default.DisplayFont;
     1.9 +            marqueeLabelBottom.Font = Properties.Settings.Default.DisplayFont;
    1.10          }
    1.11  
    1.12          private void buttonFont_Click(object sender, EventArgs e)
    1.13 @@ -49,6 +52,8 @@
    1.14                  //MessageBox.Show("Ok");
    1.15                  marqueeLabelTop.Font = fontDialog.Font;
    1.16                  marqueeLabelBottom.Font = fontDialog.Font;
    1.17 +                Properties.Settings.Default.DisplayFont = fontDialog.Font;
    1.18 +                Properties.Settings.Default.Save();
    1.19                  //label1.Font = fontDlg.Font;
    1.20                  //textBox1.BackColor = fontDlg.Color;
    1.21                  //label1.ForeColor = fontDlg.Color;
    1.22 @@ -70,8 +75,6 @@
    1.23              marqueeLabelTop.UpdateAnimation(LastTickTime, NewTickTime);
    1.24              marqueeLabelBottom.UpdateAnimation(LastTickTime, NewTickTime);
    1.25  
    1.26 -            LastTickTime = NewTickTime;
    1.27 -
    1.28              //Update our display
    1.29              if (iDisplay.IsOpen())
    1.30              {
    1.31 @@ -94,6 +97,12 @@
    1.32                  iDisplay.SwapBuffers();
    1.33  
    1.34              }
    1.35 +
    1.36 +            //Compute instant FPS
    1.37 +            toolStripStatusLabelFps.Text = (1.0/NewTickTime.Subtract(LastTickTime).TotalSeconds).ToString("F0") + " FPS";
    1.38 +
    1.39 +            LastTickTime = NewTickTime;
    1.40 +
    1.41          }
    1.42  
    1.43          private void buttonOpen_Click(object sender, EventArgs e)
    1.44 @@ -155,6 +164,5 @@
    1.45                  toolStripStatusLabelConnect.Text = "Not connected";
    1.46              }
    1.47          }
    1.48 -
    1.49      }
    1.50  }