Server/MainForm.cs
changeset 100 7e02ac8b13ba
parent 99 cf60911d08a7
child 103 14f6c8d21ec1
     1.1 --- a/Server/MainForm.cs	Fri Jan 23 15:20:32 2015 +0100
     1.2 +++ b/Server/MainForm.cs	Fri Jan 23 18:33:51 2015 +0100
     1.3 @@ -624,9 +624,14 @@
     1.4  			checkBoxStartMinimized.Checked = Properties.Settings.Default.StartMinimized;
     1.5              checkBoxReverseScreen.Checked = cds.ReverseScreen;
     1.6              checkBoxInverseColors.Checked = cds.InverseColors;
     1.7 +            checkBoxScaleToFit.Checked = cds.ScaleToFit;
     1.8 +            maskedTextBoxMinFontSize.Enabled = cds.ScaleToFit;
     1.9 +            labelMinFontSize.Enabled = cds.ScaleToFit;
    1.10 +            maskedTextBoxMinFontSize.Text = cds.MinFontSize.ToString();
    1.11              comboBoxDisplayType.SelectedIndex = cds.DisplayType;
    1.12              timer.Interval = cds.TimerInterval;
    1.13              maskedTextBoxTimerInterval.Text = cds.TimerInterval.ToString();
    1.14 +            textBoxScrollLoopSeparator.Text = cds.Separator;
    1.15              //
    1.16              SetupPixelDelegates();
    1.17  
    1.18 @@ -741,6 +746,16 @@
    1.19              SetupPixelDelegates();
    1.20          }
    1.21  
    1.22 +        private void checkBoxScaleToFit_CheckedChanged(object sender, EventArgs e)
    1.23 +        {
    1.24 +            //Save our scale to fit setting
    1.25 +            cds.ScaleToFit = checkBoxScaleToFit.Checked;
    1.26 +            Properties.Settings.Default.Save();
    1.27 +            //
    1.28 +            labelMinFontSize.Enabled = cds.ScaleToFit;
    1.29 +            maskedTextBoxMinFontSize.Enabled = cds.ScaleToFit;
    1.30 +        }
    1.31 +
    1.32          private void MainForm_Resize(object sender, EventArgs e)
    1.33          {
    1.34              if (WindowState == FormWindowState.Minimized)
    1.35 @@ -1258,7 +1273,9 @@
    1.36                      control.Name = "marqueeLabelCol" + aColumn + "Row" + aRow;
    1.37                      control.OwnTimer = false;
    1.38                      control.PixelsPerSecond = 64;
    1.39 -                    control.Separator = "|";
    1.40 +                    control.Separator = cds.Separator;
    1.41 +                    control.MinFontSize = cds.MinFontSize;
    1.42 +                    control.ScaleToFit = cds.ScaleToFit;
    1.43                      //control.Size = new System.Drawing.Size(254, 30);
    1.44                      //control.TabIndex = 2;
    1.45                      control.Font = cds.Font;
    1.46 @@ -1372,7 +1389,9 @@
    1.47                  label.Name = "marqueeLabel" + aField.Index;
    1.48                  label.OwnTimer = false;
    1.49                  label.PixelsPerSecond = 64;
    1.50 -                label.Separator = "|";
    1.51 +                label.Separator = cds.Separator;
    1.52 +                label.MinFontSize = cds.MinFontSize;
    1.53 +                label.ScaleToFit = cds.ScaleToFit;
    1.54                  //control.Size = new System.Drawing.Size(254, 30);
    1.55                  //control.TabIndex = 2;
    1.56                  label.Font = cds.Font;
    1.57 @@ -1442,7 +1461,6 @@
    1.58              }
    1.59          }
    1.60  
    1.61 -
    1.62          private void maskedTextBoxTimerInterval_TextChanged(object sender, EventArgs e)
    1.63          {
    1.64              if (maskedTextBoxTimerInterval.Text != "")
    1.65 @@ -1458,6 +1476,28 @@
    1.66              }
    1.67          }
    1.68  
    1.69 +        private void maskedTextBoxMinFontSize_TextChanged(object sender, EventArgs e)
    1.70 +        {
    1.71 +            if (maskedTextBoxMinFontSize.Text != "")
    1.72 +            {
    1.73 +                int minFontSize = Convert.ToInt32(maskedTextBoxMinFontSize.Text);
    1.74 +
    1.75 +                if (minFontSize > 0)
    1.76 +                {
    1.77 +                    //TODO: re-create layout? update our fields?
    1.78 +                    cds.MinFontSize = minFontSize;
    1.79 +                    Properties.Settings.Default.Save();
    1.80 +                }
    1.81 +            }
    1.82 +        }
    1.83 +
    1.84 +        private void textBoxScrollLoopSeparator_TextChanged(object sender, EventArgs e)
    1.85 +        {
    1.86 +            //TODO: re-create layout? update our fields?
    1.87 +            cds.Separator = textBoxScrollLoopSeparator.Text;
    1.88 +            Properties.Settings.Default.Save();
    1.89 +        }
    1.90 +
    1.91          private void buttonPowerOn_Click(object sender, EventArgs e)
    1.92          {
    1.93              iDisplay.PowerOn();
    1.94 @@ -1588,6 +1628,9 @@
    1.95  
    1.96  		}
    1.97  
    1.98 +
    1.99 +
   1.100 +
   1.101      }
   1.102  
   1.103      /// <summary>