# HG changeset patch # User sl # Date 1408004393 -7200 # Node ID 9c49c04fc62086a9739e45cd9db15f9acab2275e # Parent a6fb2b2f73b087962146995408e30d7fe4dd8816 Adding suspend/resume button. Setting our server process to higher priority to avoid render lags. diff -r a6fb2b2f73b0 -r 9c49c04fc620 Client/Program.cs --- a/Client/Program.cs Thu Aug 14 09:57:44 2014 +0200 +++ b/Client/Program.cs Thu Aug 14 10:19:53 2014 +0200 @@ -16,6 +16,9 @@ [STAThread] static public void Main() { + //Set high priority to our process to avoid lags when rendering to our screen + System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal; + Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); iMainForm = new MainForm(); diff -r a6fb2b2f73b0 -r 9c49c04fc620 Server/MainForm.Designer.cs --- a/Server/MainForm.Designer.cs Thu Aug 14 09:57:44 2014 +0200 +++ b/Server/MainForm.Designer.cs Thu Aug 14 10:19:53 2014 +0200 @@ -35,8 +35,6 @@ this.checkBoxConnectOnStartup = new System.Windows.Forms.CheckBox(); 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.checkBoxShowBorders = new System.Windows.Forms.CheckBox(); this.trackBarBrightness = new System.Windows.Forms.TrackBar(); this.buttonFill = new System.Windows.Forms.Button(); @@ -54,6 +52,9 @@ this.toolStripStatusLabelPower = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabelFps = new System.Windows.Forms.ToolStripStatusLabel(); this.buttonStartClient = new System.Windows.Forms.Button(); + this.buttonSuspend = new System.Windows.Forms.Button(); + this.marqueeLabelTop = new SharpDisplayManager.MarqueeLabel(); + this.marqueeLabelBottom = new SharpDisplayManager.MarqueeLabel(); this.tabControl.SuspendLayout(); this.tabPageDisplay.SuspendLayout(); this.panelDisplay.SuspendLayout(); @@ -77,6 +78,7 @@ // // tabPageDisplay // + this.tabPageDisplay.Controls.Add(this.buttonSuspend); this.tabPageDisplay.Controls.Add(this.buttonStartClient); this.tabPageDisplay.Controls.Add(this.checkBoxReverseScreen); this.tabPageDisplay.Controls.Add(this.checkBoxConnectOnStartup); @@ -204,39 +206,6 @@ 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 = null; - 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; - // // checkBoxShowBorders // this.checkBoxShowBorders.AutoSize = true; @@ -387,6 +356,49 @@ this.buttonStartClient.UseVisualStyleBackColor = true; this.buttonStartClient.Click += new System.EventHandler(this.buttonStartClient_Click); // + // buttonSuspend + // + this.buttonSuspend.Location = new System.Drawing.Point(7, 253); + this.buttonSuspend.Name = "buttonSuspend"; + this.buttonSuspend.Size = new System.Drawing.Size(75, 23); + this.buttonSuspend.TabIndex = 16; + this.buttonSuspend.Text = "Suspend"; + this.buttonSuspend.UseVisualStyleBackColor = true; + this.buttonSuspend.Click += new System.EventHandler(this.buttonSuspend_Click); + // + // 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, -376); + 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, -250); + this.marqueeLabelBottom.Margin = new System.Windows.Forms.Padding(0); + this.marqueeLabelBottom.Name = "marqueeLabelBottom"; + this.marqueeLabelBottom.OwnTimer = false; + this.marqueeLabelBottom.PixelsPerSecond = 64; + this.marqueeLabelBottom.Separator = null; + 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); @@ -440,6 +452,7 @@ private System.Windows.Forms.CheckBox checkBoxConnectOnStartup; private System.Windows.Forms.CheckBox checkBoxReverseScreen; private System.Windows.Forms.Button buttonStartClient; + private System.Windows.Forms.Button buttonSuspend; } } diff -r a6fb2b2f73b0 -r 9c49c04fc620 Server/MainForm.cs --- a/Server/MainForm.cs Thu Aug 14 09:57:44 2014 +0200 +++ b/Server/MainForm.cs Thu Aug 14 10:19:53 2014 +0200 @@ -406,6 +406,19 @@ clientThread.Start(); } + private void buttonSuspend_Click(object sender, EventArgs e) + { + timer.Enabled = !timer.Enabled; + if (!timer.Enabled) + { + buttonSuspend.Text = "Suspend"; + } + else + { + buttonSuspend.Text = "Pause"; + } + } + }