# HG changeset patch # User sl # Date 1408476377 -7200 # Node ID 405a2590eda48509143976f351b85a34fabb443c # Parent a3aa661da8101e306afb60e66407e6e3be19342a Font height now also checked on startup. diff -r a3aa661da810 -r 405a2590eda4 Server/MainForm.Designer.cs --- a/Server/MainForm.Designer.cs Tue Aug 19 17:29:52 2014 +0200 +++ b/Server/MainForm.Designer.cs Tue Aug 19 21:26:17 2014 +0200 @@ -31,6 +31,8 @@ this.components = new System.ComponentModel.Container(); this.panelDisplay = new System.Windows.Forms.Panel(); this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); + this.marqueeLabelTop = new SharpDisplayManager.MarqueeLabel(); + this.marqueeLabelBottom = new SharpDisplayManager.MarqueeLabel(); this.fontDialog = new System.Windows.Forms.FontDialog(); this.timer = new System.Windows.Forms.Timer(this.components); this.statusStrip = new System.Windows.Forms.StatusStrip(); @@ -43,6 +45,7 @@ this.buttonStartClient = new System.Windows.Forms.Button(); this.treeViewClients = new System.Windows.Forms.TreeView(); this.tabPageDisplay = new System.Windows.Forms.TabPage(); + this.labelWarning = new System.Windows.Forms.Label(); this.checkBoxFixedPitchFontOnly = new System.Windows.Forms.CheckBox(); this.buttonSuspend = new System.Windows.Forms.Button(); this.checkBoxReverseScreen = new System.Windows.Forms.CheckBox(); @@ -56,9 +59,6 @@ this.buttonCapture = new System.Windows.Forms.Button(); this.buttonFont = new System.Windows.Forms.Button(); this.tabControl = new System.Windows.Forms.TabControl(); - this.labelWarning = new System.Windows.Forms.Label(); - this.marqueeLabelTop = new SharpDisplayManager.MarqueeLabel(); - this.marqueeLabelBottom = new SharpDisplayManager.MarqueeLabel(); this.panelDisplay.SuspendLayout(); this.tableLayoutPanel.SuspendLayout(); this.statusStrip.SuspendLayout(); @@ -154,6 +154,39 @@ this.tableLayoutPanel.Size = new System.Drawing.Size(256, 64); this.tableLayoutPanel.TabIndex = 5; // + // marqueeLabelTop + // + this.marqueeLabelTop.AutoEllipsis = true; + this.marqueeLabelTop.BackColor = System.Drawing.Color.Transparent; + this.marqueeLabelTop.Dock = System.Windows.Forms.DockStyle.Fill; + this.marqueeLabelTop.Location = new System.Drawing.Point(1, 1); + this.marqueeLabelTop.Margin = new System.Windows.Forms.Padding(0); + this.marqueeLabelTop.Name = "marqueeLabelTop"; + this.marqueeLabelTop.OwnTimer = false; + this.marqueeLabelTop.PixelsPerSecond = 64; + this.marqueeLabelTop.Separator = "|"; + this.marqueeLabelTop.Size = new System.Drawing.Size(254, 30); + this.marqueeLabelTop.TabIndex = 2; + this.marqueeLabelTop.Text = "ABCDEFGHIJKLMNOPQRST-0123456789"; + this.marqueeLabelTop.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.marqueeLabelTop.UseCompatibleTextRendering = true; + // + // marqueeLabelBottom + // + this.marqueeLabelBottom.AutoEllipsis = true; + this.marqueeLabelBottom.Dock = System.Windows.Forms.DockStyle.Fill; + this.marqueeLabelBottom.Location = new System.Drawing.Point(1, 32); + this.marqueeLabelBottom.Margin = new System.Windows.Forms.Padding(0); + this.marqueeLabelBottom.Name = "marqueeLabelBottom"; + this.marqueeLabelBottom.OwnTimer = false; + this.marqueeLabelBottom.PixelsPerSecond = 64; + this.marqueeLabelBottom.Separator = "|"; + this.marqueeLabelBottom.Size = new System.Drawing.Size(254, 31); + this.marqueeLabelBottom.TabIndex = 3; + this.marqueeLabelBottom.Text = "abcdefghijklmnopqrst-0123456789"; + this.marqueeLabelBottom.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.marqueeLabelBottom.UseCompatibleTextRendering = true; + // // timer // this.timer.Enabled = true; @@ -267,6 +300,19 @@ this.tabPageDisplay.Text = "Display"; this.tabPageDisplay.UseVisualStyleBackColor = true; // + // labelWarning + // + this.labelWarning.AutoSize = true; + this.labelWarning.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelWarning.ForeColor = System.Drawing.Color.Red; + this.labelWarning.Location = new System.Drawing.Point(87, 9); + this.labelWarning.Name = "labelWarning"; + this.labelWarning.Size = new System.Drawing.Size(80, 16); + this.labelWarning.TabIndex = 18; + this.labelWarning.Text = "WARNING"; + this.labelWarning.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.labelWarning.Visible = false; + // // checkBoxFixedPitchFontOnly // this.checkBoxFixedPitchFontOnly.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -413,52 +459,6 @@ this.tabControl.Size = new System.Drawing.Size(600, 343); this.tabControl.TabIndex = 0; // - // labelWarning - // - this.labelWarning.AutoSize = true; - this.labelWarning.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelWarning.ForeColor = System.Drawing.Color.Red; - this.labelWarning.Location = new System.Drawing.Point(87, 9); - this.labelWarning.Name = "labelWarning"; - this.labelWarning.Size = new System.Drawing.Size(80, 16); - this.labelWarning.TabIndex = 18; - this.labelWarning.Text = "WARNING"; - this.labelWarning.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.labelWarning.Visible = false; - // - // marqueeLabelTop - // - this.marqueeLabelTop.AutoEllipsis = true; - this.marqueeLabelTop.BackColor = System.Drawing.Color.Transparent; - this.marqueeLabelTop.Dock = System.Windows.Forms.DockStyle.Fill; - this.marqueeLabelTop.Location = new System.Drawing.Point(1, -124); - this.marqueeLabelTop.Margin = new System.Windows.Forms.Padding(0); - this.marqueeLabelTop.Name = "marqueeLabelTop"; - this.marqueeLabelTop.OwnTimer = false; - this.marqueeLabelTop.PixelsPerSecond = 64; - this.marqueeLabelTop.Separator = "|"; - this.marqueeLabelTop.Size = new System.Drawing.Size(254, 20); - this.marqueeLabelTop.TabIndex = 2; - this.marqueeLabelTop.Text = "ABCDEFGHIJKLMNOPQRST-0123456789"; - this.marqueeLabelTop.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.marqueeLabelTop.UseCompatibleTextRendering = true; - // - // marqueeLabelBottom - // - this.marqueeLabelBottom.AutoEllipsis = true; - this.marqueeLabelBottom.Dock = System.Windows.Forms.DockStyle.Fill; - this.marqueeLabelBottom.Location = new System.Drawing.Point(1, -40); - this.marqueeLabelBottom.Margin = new System.Windows.Forms.Padding(0); - this.marqueeLabelBottom.Name = "marqueeLabelBottom"; - this.marqueeLabelBottom.OwnTimer = false; - this.marqueeLabelBottom.PixelsPerSecond = 64; - this.marqueeLabelBottom.Separator = "|"; - this.marqueeLabelBottom.Size = new System.Drawing.Size(254, 20); - this.marqueeLabelBottom.TabIndex = 3; - this.marqueeLabelBottom.Text = "abcdefghijklmnopqrst-0123456789"; - this.marqueeLabelBottom.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.marqueeLabelBottom.UseCompatibleTextRendering = true; - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff -r a3aa661da810 -r 405a2590eda4 Server/MainForm.cs --- a/Server/MainForm.cs Tue Aug 19 17:29:52 2014 +0200 +++ b/Server/MainForm.cs Tue Aug 19 21:26:17 2014 +0200 @@ -59,6 +59,11 @@ { StartServer(); + // + CheckFontHeight(); + // + + if (Properties.Settings.Default.DisplayConnectOnStartup) { iDisplay.Open(); @@ -98,17 +103,25 @@ Properties.Settings.Default.DisplayFont = fontDialog.Font; Properties.Settings.Default.Save(); // - if (fontDialog.Font.Height > marqueeLabelBottom.Height) - { - labelWarning.Text = "WARNING: Selected font is too height by " + (fontDialog.Font.Height - marqueeLabelBottom.Height) + " pixels!"; - labelWarning.Visible = true; - } - else - { - labelWarning.Visible = false; - } + CheckFontHeight(); + } + } + /// + /// + /// + void CheckFontHeight() + { + if (marqueeLabelBottom.Font.Height > marqueeLabelBottom.Height) + { + labelWarning.Text = "WARNING: Selected font is too height by " + (marqueeLabelBottom.Font.Height - marqueeLabelBottom.Height) + " pixels!"; + labelWarning.Visible = true; } + else + { + labelWarning.Visible = false; + } + } private void buttonCapture_Click(object sender, EventArgs e)