# HG changeset patch # User sl # Date 1422022832 -3600 # Node ID cf60911d08a7984e90b6407798ba6d7767b6a776 # Parent 7f72edef7ca31ca4dca027645d0ecb2fc212aaa0 Fixing crash when changing font while in bitmap layout. diff -r 7f72edef7ca3 -r cf60911d08a7 Server/MainForm.cs --- a/Server/MainForm.cs Sun Jan 18 19:31:13 2015 +0100 +++ b/Server/MainForm.cs Fri Jan 23 15:20:32 2015 +0100 @@ -91,7 +91,7 @@ } /// - /// + /// /// /// /// @@ -123,13 +123,13 @@ } #if !DEBUG - //When not debugging we want the screen to be empty until a client takes over + //When not debugging we want the screen to be empty until a client takes over ClearLayout(); #endif } /// - /// + /// /// private void SetupTrayIcon() { @@ -221,8 +221,7 @@ //fontDialog.ShowColor = true; //fontDialog.ShowApply = true; fontDialog.ShowEffects = true; - MarqueeLabel label = (MarqueeLabel)tableLayoutPanel.Controls[0]; - fontDialog.Font = label.Font; + fontDialog.Font = cds.Font; fontDialog.FixedPitchOnly = checkBoxFixedPitchFontOnly.Checked; @@ -239,14 +238,16 @@ //if (fontDialog.ShowDialog(this) != DialogResult.Cancel) if (DlgBox.ShowDialog(fontDialog) != DialogResult.Cancel) { + //Set the fonts to all our labels in our layout + foreach (Control ctrl in tableLayoutPanel.Controls) + { + if (ctrl is MarqueeLabel) + { + ((MarqueeLabel)ctrl).Font = fontDialog.Font; + } + } - //MsgBox.Show("MessageBox MsgBox", "MsgBox caption"); - - //MessageBox.Show("Ok"); - foreach (MarqueeLabel ctrl in tableLayoutPanel.Controls) - { - ctrl.Font = fontDialog.Font; - } + //Save font settings cds.Font = fontDialog.Font; Properties.Settings.Default.Save(); // @@ -1558,7 +1559,7 @@ /// - /// Used to + /// Used to /// private void SysTrayHideShow() { @@ -1584,7 +1585,7 @@ SysTrayHideShow(); } } - + } } diff -r 7f72edef7ca3 -r cf60911d08a7 Server/SharpDisplayManager.csproj --- a/Server/SharpDisplayManager.csproj Sun Jan 18 19:31:13 2015 +0100 +++ b/Server/SharpDisplayManager.csproj Fri Jan 23 15:20:32 2015 +0100 @@ -166,7 +166,9 @@ Resources.resx True - + + Designer + SettingsSingleFileGenerator Settings.Designer.cs