From 9b722eacdb58003391c74ad8e194979b73541bfc Mon Sep 17 00:00:00 2001 From: Faryan Rezagholi Date: Thu, 20 Dec 2018 23:42:11 +0100 Subject: [PATCH 1/5] Added form for spash screen --- .../UI/Forms/FrmSplashScreen.Designer.cs | 57 +++++++++ mRemoteV1/UI/Forms/FrmSplashScreen.cs | 29 +++++ mRemoteV1/UI/Forms/FrmSplashScreen.resx | 120 ++++++++++++++++++ mRemoteV1/mRemoteV1.csproj | 9 ++ 4 files changed, 215 insertions(+) create mode 100644 mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs create mode 100644 mRemoteV1/UI/Forms/FrmSplashScreen.cs create mode 100644 mRemoteV1/UI/Forms/FrmSplashScreen.resx diff --git a/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs b/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs new file mode 100644 index 000000000..7eaec199c --- /dev/null +++ b/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs @@ -0,0 +1,57 @@ +namespace mRemoteNG.UI.Forms +{ + partial class FrmSplashScreen + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // FrmSplashScreen + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.ActiveCaptionText; + this.ClientSize = new System.Drawing.Size(300, 100); + this.ControlBox = false; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Margin = new System.Windows.Forms.Padding(2); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(180, 60); + this.Name = "FrmSplashScreen"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "frmSplashScreen"; + this.TopMost = true; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/mRemoteV1/UI/Forms/FrmSplashScreen.cs b/mRemoteV1/UI/Forms/FrmSplashScreen.cs new file mode 100644 index 000000000..bf28eaca3 --- /dev/null +++ b/mRemoteV1/UI/Forms/FrmSplashScreen.cs @@ -0,0 +1,29 @@ +using System.Windows.Forms; + +namespace mRemoteNG.UI.Forms +{ + public partial class FrmSplashScreen : Form + { + static FrmSplashScreen instance = null; + + private FrmSplashScreen() => InitializeComponent(); + + public static FrmSplashScreen getInstance() + { + if (instance == null) + instance = new FrmSplashScreen(); + return instance; + } + + protected override CreateParams CreateParams + { + get + { + CreateParams cp = base.CreateParams; + // turn on WS_EX_TOOLWINDOW style bit + cp.ExStyle |= 0x80; + return cp; + } + } + } +} diff --git a/mRemoteV1/UI/Forms/FrmSplashScreen.resx b/mRemoteV1/UI/Forms/FrmSplashScreen.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/mRemoteV1/UI/Forms/FrmSplashScreen.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 261bd255b..b1908adb6 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -485,6 +485,12 @@ frmOptions.cs + + Form + + + FrmSplashScreen.cs + Form @@ -795,6 +801,9 @@ frmOptions.cs + + FrmSplashScreen.cs + InputBox.cs From 2a0032a199776a07dc9f3ab0f34bb5492a6f1baf Mon Sep 17 00:00:00 2001 From: Faryan Rezagholi Date: Fri, 21 Dec 2018 00:10:59 +0100 Subject: [PATCH 2/5] Splash screen shown on startup and hiding after completion of the load method of the main form --- mRemoteV1/App/ProgramRoot.cs | 2 ++ mRemoteV1/UI/Forms/frmMain.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/mRemoteV1/App/ProgramRoot.cs b/mRemoteV1/App/ProgramRoot.cs index c057ae344..b2fcd4a73 100644 --- a/mRemoteV1/App/ProgramRoot.cs +++ b/mRemoteV1/App/ProgramRoot.cs @@ -27,6 +27,8 @@ namespace mRemoteNG.App CatchAllUnhandledExceptions(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); + FrmSplashScreen frmSplashScreen = FrmSplashScreen.getInstance(); + frmSplashScreen.Show(); Application.Run(FrmMain.Default); } diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index bb2138216..94398736d 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -189,6 +189,9 @@ namespace mRemoteNG.UI.Forms if (!panelAdder.DoesPanelExist(panelName)) panelAdder.AddPanel(panelName); } + + FrmSplashScreen frmSplashScreen = FrmSplashScreen.getInstance(); + frmSplashScreen.Close(); } private void ApplyLanguage() From 4cc1847ea6000c2e4618d6ca1f92afde46d10fae Mon Sep 17 00:00:00 2001 From: Faryan Rezagholi Date: Fri, 21 Dec 2018 00:41:02 +0100 Subject: [PATCH 3/5] added mRemoteNG Logo to splash screen --- mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs b/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs index 7eaec199c..621c3562b 100644 --- a/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs +++ b/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs @@ -34,9 +34,11 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.ActiveCaptionText; - this.ClientSize = new System.Drawing.Size(300, 100); + this.BackgroundImage = global::mRemoteNG.Resources.Logo; + this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.ClientSize = new System.Drawing.Size(492, 128); this.ControlBox = false; + this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Margin = new System.Windows.Forms.Padding(2); this.MaximizeBox = false; From 5221907ef86e3484ffae108ab80e389818649da1 Mon Sep 17 00:00:00 2001 From: Faryan Rezagholi Date: Fri, 21 Dec 2018 00:43:32 +0100 Subject: [PATCH 4/5] added my name to my github link :P --- CREDITS.TXT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CREDITS.TXT b/CREDITS.TXT index 082979afb..1f7f9d8b1 100644 --- a/CREDITS.TXT +++ b/CREDITS.TXT @@ -16,7 +16,7 @@ github.com/peterchenadded Brandon Wulf (github.com/mrwulf) Pedro Rodrigues (github.com/pedro2555) github.com/dekelMP -github.com/farosch +Faryan Rezagholi (github.com/farosch) Bruce (github.com/brucetp) Camilo Alvarez (github.com/jotatsu) github.com/DamianBis From 08191278d7681caed2069bc2434f5fad16a43b85 Mon Sep 17 00:00:00 2001 From: Faryan Rezagholi Date: Fri, 21 Dec 2018 18:19:13 +0100 Subject: [PATCH 5/5] Chnaged splash screen form to display correctly on a high DPI device --- mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs b/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs index 621c3562b..2e36868e2 100644 --- a/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs +++ b/mRemoteV1/UI/Forms/FrmSplashScreen.Designer.cs @@ -32,10 +32,10 @@ // // FrmSplashScreen // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackgroundImage = global::mRemoteNG.Resources.Logo; - this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.ClientSize = new System.Drawing.Size(492, 128); this.ControlBox = false; this.DoubleBuffered = true;