MainForm.cs
changeset 13 745d9ee1a2c0
parent 12 f37c5ff8af18
child 14 d1fa9de444b0
     1.1 --- a/MainForm.cs	Thu Jul 10 22:03:29 2014 +0200
     1.2 +++ b/MainForm.cs	Sat Jul 12 13:13:17 2014 +0200
     1.3 @@ -23,12 +23,26 @@
     1.4  
     1.5              InitializeComponent();
     1.6              UpdateStatus();
     1.7 +
     1.8              //Load settings
     1.9              marqueeLabelTop.Font = Properties.Settings.Default.DisplayFont;
    1.10              marqueeLabelBottom.Font = Properties.Settings.Default.DisplayFont;
    1.11              checkBoxShowBorders.Checked = Properties.Settings.Default.DisplayShowBorders;
    1.12 +            checkBoxConnectOnStartup.Checked = Properties.Settings.Default.DisplayConnectOnStartup;
    1.13 +            //
    1.14 +            tableLayoutPanel.CellBorderStyle = (checkBoxShowBorders.Checked ? TableLayoutPanelCellBorderStyle.Single : TableLayoutPanelCellBorderStyle.None);
    1.15          }
    1.16  
    1.17 +        private void MainForm_Load(object sender, EventArgs e)
    1.18 +        {
    1.19 +            if (Properties.Settings.Default.DisplayConnectOnStartup)
    1.20 +            {
    1.21 +                iDisplay.Open();
    1.22 +                UpdateStatus();
    1.23 +            }
    1.24 +        }
    1.25 +
    1.26 +
    1.27          private void buttonFont_Click(object sender, EventArgs e)
    1.28          {
    1.29              //fontDialog.ShowColor = true;
    1.30 @@ -126,7 +140,8 @@
    1.31                          unchecked
    1.32                          {
    1.33                          uint color=(uint)bmp.GetPixel(i, j).ToArgb();
    1.34 -                        iDisplay.SetPixel(i, j, Convert.ToInt32((checkBoxShowBorders.Checked?color!=0xFFFFFFFF:color == 0xFF000000)));
    1.35 +                        //(checkBoxShowBorders.Checked?color!=0xFFFFFFFF:color == 0xFF000000)
    1.36 +                        iDisplay.SetPixel(i, j, Convert.ToInt32(color != 0xFFFFFFFF));
    1.37                          }
    1.38                      }
    1.39                  }
    1.40 @@ -213,10 +228,20 @@
    1.41              }
    1.42          }
    1.43  
    1.44 +
    1.45 +
    1.46          private void checkBoxShowBorders_CheckedChanged(object sender, EventArgs e)
    1.47          {
    1.48 +            tableLayoutPanel.CellBorderStyle = (checkBoxShowBorders.Checked ? TableLayoutPanelCellBorderStyle.Single : TableLayoutPanelCellBorderStyle.None);
    1.49              Properties.Settings.Default.DisplayShowBorders = checkBoxShowBorders.Checked;
    1.50              Properties.Settings.Default.Save();
    1.51          }
    1.52 +
    1.53 +        private void checkBoxConnectOnStartup_CheckedChanged(object sender, EventArgs e)
    1.54 +        {
    1.55 +            Properties.Settings.Default.DisplayConnectOnStartup = checkBoxConnectOnStartup.Checked;
    1.56 +            Properties.Settings.Default.Save();
    1.57 +        }
    1.58 +
    1.59      }
    1.60  }