Fixing crash when changing font while in bitmap layout.
authorsl
Fri, 23 Jan 2015 15:20:32 +0100
changeset 99cf60911d08a7
parent 98 7f72edef7ca3
child 100 7e02ac8b13ba
Fixing crash when changing font while in bitmap layout.
Server/MainForm.cs
Server/SharpDisplayManager.csproj
     1.1 --- a/Server/MainForm.cs	Sun Jan 18 19:31:13 2015 +0100
     1.2 +++ b/Server/MainForm.cs	Fri Jan 23 15:20:32 2015 +0100
     1.3 @@ -91,7 +91,7 @@
     1.4          }
     1.5  
     1.6  		/// <summary>
     1.7 -		/// 
     1.8 +		///
     1.9  		/// </summary>
    1.10  		/// <param name="sender"></param>
    1.11  		/// <param name="e"></param>
    1.12 @@ -123,13 +123,13 @@
    1.13  			}
    1.14  
    1.15  #if !DEBUG
    1.16 -			//When not debugging we want the screen to be empty until a client takes over 
    1.17 +			//When not debugging we want the screen to be empty until a client takes over
    1.18  			ClearLayout();
    1.19  #endif
    1.20          }
    1.21  
    1.22  		/// <summary>
    1.23 -		/// 
    1.24 +		///
    1.25  		/// </summary>
    1.26  		private void SetupTrayIcon()
    1.27  		{
    1.28 @@ -221,8 +221,7 @@
    1.29              //fontDialog.ShowColor = true;
    1.30              //fontDialog.ShowApply = true;
    1.31              fontDialog.ShowEffects = true;
    1.32 -            MarqueeLabel label = (MarqueeLabel)tableLayoutPanel.Controls[0];
    1.33 -            fontDialog.Font = label.Font;
    1.34 +            fontDialog.Font = cds.Font;
    1.35  
    1.36              fontDialog.FixedPitchOnly = checkBoxFixedPitchFontOnly.Checked;
    1.37  
    1.38 @@ -239,14 +238,16 @@
    1.39              //if (fontDialog.ShowDialog(this) != DialogResult.Cancel)
    1.40              if (DlgBox.ShowDialog(fontDialog) != DialogResult.Cancel)
    1.41              {
    1.42 +                //Set the fonts to all our labels in our layout
    1.43 +                foreach (Control ctrl in tableLayoutPanel.Controls)
    1.44 +                {
    1.45 +                    if (ctrl is MarqueeLabel)
    1.46 +                    {
    1.47 +                        ((MarqueeLabel)ctrl).Font = fontDialog.Font;
    1.48 +                    }
    1.49 +                }
    1.50  
    1.51 -                //MsgBox.Show("MessageBox MsgBox", "MsgBox caption");
    1.52 -
    1.53 -                //MessageBox.Show("Ok");
    1.54 -                foreach (MarqueeLabel ctrl in tableLayoutPanel.Controls)
    1.55 -                {
    1.56 -                    ctrl.Font = fontDialog.Font;
    1.57 -                }
    1.58 +                //Save font settings
    1.59                  cds.Font = fontDialog.Font;
    1.60                  Properties.Settings.Default.Save();
    1.61                  //
    1.62 @@ -1558,7 +1559,7 @@
    1.63  
    1.64  
    1.65  		/// <summary>
    1.66 -		/// Used to 
    1.67 +		/// Used to
    1.68  		/// </summary>
    1.69  		private void SysTrayHideShow()
    1.70  		{
    1.71 @@ -1584,7 +1585,7 @@
    1.72  					SysTrayHideShow();
    1.73  				}
    1.74  			}
    1.75 -			
    1.76 +
    1.77  		}
    1.78  
    1.79      }
     2.1 --- a/Server/SharpDisplayManager.csproj	Sun Jan 18 19:31:13 2015 +0100
     2.2 +++ b/Server/SharpDisplayManager.csproj	Fri Jan 23 15:20:32 2015 +0100
     2.3 @@ -166,7 +166,9 @@
     2.4        <DependentUpon>Resources.resx</DependentUpon>
     2.5        <DesignTime>True</DesignTime>
     2.6      </Compile>
     2.7 -    <None Include="app.manifest" />
     2.8 +    <None Include="app.manifest">
     2.9 +      <SubType>Designer</SubType>
    2.10 +    </None>
    2.11      <None Include="Properties\Settings.settings">
    2.12        <Generator>SettingsSingleFileGenerator</Generator>
    2.13        <LastGenOutput>Settings.Designer.cs</LastGenOutput>