From 05a0bb86cf40dfef4a8efe9ee8cc59458dbd35dc Mon Sep 17 00:00:00 2001 From: arkypita Date: Thu, 22 Dec 2016 22:45:16 +0100 Subject: [PATCH] Splash Form corrections --- LaserGRBL/MainForm.Designer.cs | 59 +++++++++++++++++----------------- LaserGRBL/MainForm.cs | 5 ++- LaserGRBL/MainForm.resx | 3 ++ LaserGRBL/SplashScreenForm.cs | 10 ++++-- 4 files changed, 44 insertions(+), 33 deletions(-) diff --git a/LaserGRBL/MainForm.Designer.cs b/LaserGRBL/MainForm.Designer.cs index 5c9992aea..409a1a11e 100644 --- a/LaserGRBL/MainForm.Designer.cs +++ b/LaserGRBL/MainForm.Designer.cs @@ -83,16 +83,16 @@ private void InitializeComponent() // StatusBar // this.StatusBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.TTLines, - this.TTLEstimated, - this.TTTEstimated, - this.spring, - this.TTOvG0, - this.TTOvG1, - this.TTOvS, - this.spacer, - this.TTStatus, - this.spacer2}); + this.TTLines, + this.TTLEstimated, + this.TTTEstimated, + this.spring, + this.TTOvG0, + this.TTOvG1, + this.TTOvS, + this.spacer, + this.TTStatus, + this.spacer2}); this.StatusBar.Location = new System.Drawing.Point(0, 459); this.StatusBar.Name = "StatusBar"; this.StatusBar.Size = new System.Drawing.Size(856, 24); @@ -182,15 +182,14 @@ private void InitializeComponent() // // UpdateTimer // - this.UpdateTimer.Enabled = true; this.UpdateTimer.Tick += new System.EventHandler(this.UpdateTimer_Tick); // // MMn // this.MMn.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.grblToolStripMenuItem, - this.fileToolStripMenuItem, - this.windowsToolStripMenuItem}); + this.grblToolStripMenuItem, + this.fileToolStripMenuItem, + this.windowsToolStripMenuItem}); this.MMn.Location = new System.Drawing.Point(0, 0); this.MMn.Name = "MMn"; this.MMn.Size = new System.Drawing.Size(856, 24); @@ -200,17 +199,17 @@ private void InitializeComponent() // grblToolStripMenuItem // this.grblToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.MnConnect, - this.MnDisconnect, - this.toolStripMenuItem2, - this.MnGrblReset, - this.MnGoHome, - this.MnUnlock, - this.toolStripSeparator1, - this.MnExportConfig, - this.MnImportConfig, - this.toolStripMenuItem3, - this.MnExit}); + this.MnConnect, + this.MnDisconnect, + this.toolStripMenuItem2, + this.MnGrblReset, + this.MnGoHome, + this.MnUnlock, + this.toolStripSeparator1, + this.MnExportConfig, + this.MnImportConfig, + this.toolStripMenuItem3, + this.MnExit}); this.grblToolStripMenuItem.Name = "grblToolStripMenuItem"; this.grblToolStripMenuItem.Size = new System.Drawing.Size(41, 20); this.grblToolStripMenuItem.Text = "&Grbl"; @@ -289,8 +288,8 @@ private void InitializeComponent() // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.MnFileOpen, - this.MnFileSend}); + this.MnFileOpen, + this.MnFileSend}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "&File"; @@ -298,21 +297,21 @@ private void InitializeComponent() // MnFileOpen // this.MnFileOpen.Name = "MnFileOpen"; - this.MnFileOpen.Size = new System.Drawing.Size(152, 22); + this.MnFileOpen.Size = new System.Drawing.Size(103, 22); this.MnFileOpen.Text = "&Open"; this.MnFileOpen.Click += new System.EventHandler(this.MnFileOpen_Click); // // MnFileSend // this.MnFileSend.Name = "MnFileSend"; - this.MnFileSend.Size = new System.Drawing.Size(152, 22); + this.MnFileSend.Size = new System.Drawing.Size(103, 22); this.MnFileSend.Text = "&Send"; this.MnFileSend.Click += new System.EventHandler(this.MnFileSend_Click); // // windowsToolStripMenuItem // this.windowsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.joggingToolStripMenuItem}); + this.joggingToolStripMenuItem}); this.windowsToolStripMenuItem.Name = "windowsToolStripMenuItem"; this.windowsToolStripMenuItem.Size = new System.Drawing.Size(68, 20); this.windowsToolStripMenuItem.Text = "&Windows"; diff --git a/LaserGRBL/MainForm.cs b/LaserGRBL/MainForm.cs index dd7e255a5..40f6d847e 100644 --- a/LaserGRBL/MainForm.cs +++ b/LaserGRBL/MainForm.cs @@ -21,7 +21,8 @@ public MainForm() InitializeComponent(); SplashScreenForm f = new SplashScreenForm(); - f.Show(); + f.ShowDialog(); + f.Dispose(); //build main communication object Core = new GrblCore(this); @@ -48,6 +49,8 @@ private void MainForm_Load(object sender, EventArgs e) ConnectionForm.Show(DockArea, LaserGRBL.UserControls.DockingManager.DockState.DockLeft); JogForm.Show(ConnectionForm.Pane, LaserGRBL.UserControls.DockingManager.DockAlignment.Bottom, 0.2); } + + UpdateTimer.Enabled = true; } private LaserGRBL.UserControls.DockingManager.IDockContent GetContentFromPersistString(string persistString) diff --git a/LaserGRBL/MainForm.resx b/LaserGRBL/MainForm.resx index c13158c2f..fb5af4472 100644 --- a/LaserGRBL/MainForm.resx +++ b/LaserGRBL/MainForm.resx @@ -124,6 +124,9 @@ 295, 17 + 118, 17 + + 17, 17 diff --git a/LaserGRBL/SplashScreenForm.cs b/LaserGRBL/SplashScreenForm.cs index dc8dad33b..1f204e2a7 100644 --- a/LaserGRBL/SplashScreenForm.cs +++ b/LaserGRBL/SplashScreenForm.cs @@ -14,6 +14,7 @@ public partial class SplashScreenForm : Form public SplashScreenForm() { InitializeComponent(); + this.DoubleBuffered = true; } private void SplashScreenForm_Load(object sender, EventArgs e) @@ -23,14 +24,19 @@ private void SplashScreenForm_Load(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e) { - timer1.Enabled = false; - Close(); + CloseAndGoMain(); } private void pictureBox1_Click(object sender, EventArgs e) + { + CloseAndGoMain(); + } + + private void CloseAndGoMain() { timer1.Enabled = false; Close(); + } } }