From cfc5f21bce27752987ab3c459fd809786b99b890 Mon Sep 17 00:00:00 2001 From: Vichingo455 <59311016+Vichingo455@users.noreply.github.com> Date: Sat, 12 Mar 2022 14:50:34 +0100 Subject: [PATCH] Actually 1.1.2 --- Notepad/Form1.Designer.cs | 34 ++++++++++----- Notepad/Form1.cs | 69 +++++++++++++++++++++++------- Notepad/Program.cs | 2 +- Notepad/Properties/AssemblyInfo.cs | 4 +- 4 files changed, 79 insertions(+), 30 deletions(-) diff --git a/Notepad/Form1.Designer.cs b/Notepad/Form1.Designer.cs index 4a42638..8463cb1 100644 --- a/Notepad/Form1.Designer.cs +++ b/Notepad/Form1.Designer.cs @@ -39,9 +39,10 @@ this.saveFileWithNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.characterStyleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.backgroundColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.searchTextInTheWebToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.alwaysOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.giveAFeedbackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -56,6 +57,7 @@ this.text_area.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.text_area.BorderStyle = System.Windows.Forms.BorderStyle.None; this.text_area.Location = new System.Drawing.Point(-3, 31); this.text_area.Multiline = true; this.text_area.Name = "text_area"; @@ -143,22 +145,15 @@ // viewToolStripMenuItem // this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.alwaysOnTopToolStripMenuItem, this.characterStyleToolStripMenuItem, - this.searchTextInTheWebToolStripMenuItem}); + this.backgroundColorToolStripMenuItem, + this.searchTextInTheWebToolStripMenuItem, + this.alwaysOnTopToolStripMenuItem}); this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; this.viewToolStripMenuItem.Size = new System.Drawing.Size(55, 26); this.viewToolStripMenuItem.Text = "View"; this.viewToolStripMenuItem.Click += new System.EventHandler(this.viewToolStripMenuItem_Click_1); // - // alwaysOnTopToolStripMenuItem - // - this.alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; - this.alwaysOnTopToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5; - this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(301, 26); - this.alwaysOnTopToolStripMenuItem.Text = "Always on top"; - this.alwaysOnTopToolStripMenuItem.Click += new System.EventHandler(this.alwaysOnTopToolStripMenuItem_Click); - // // characterStyleToolStripMenuItem // this.characterStyleToolStripMenuItem.Name = "characterStyleToolStripMenuItem"; @@ -167,6 +162,14 @@ this.characterStyleToolStripMenuItem.Text = "Font style"; this.characterStyleToolStripMenuItem.Click += new System.EventHandler(this.characterStyleToolStripMenuItem_Click_1); // + // backgroundColorToolStripMenuItem + // + this.backgroundColorToolStripMenuItem.Name = "backgroundColorToolStripMenuItem"; + this.backgroundColorToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F7))); + this.backgroundColorToolStripMenuItem.Size = new System.Drawing.Size(301, 26); + this.backgroundColorToolStripMenuItem.Text = "Window color"; + this.backgroundColorToolStripMenuItem.Click += new System.EventHandler(this.backgroundColorToolStripMenuItem_Click); + // // searchTextInTheWebToolStripMenuItem // this.searchTextInTheWebToolStripMenuItem.Name = "searchTextInTheWebToolStripMenuItem"; @@ -175,6 +178,14 @@ this.searchTextInTheWebToolStripMenuItem.Text = "Search text in the web"; this.searchTextInTheWebToolStripMenuItem.Click += new System.EventHandler(this.searchTextInTheWebToolStripMenuItem_Click); // + // alwaysOnTopToolStripMenuItem + // + this.alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; + this.alwaysOnTopToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5; + this.alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(301, 26); + this.alwaysOnTopToolStripMenuItem.Text = "Always on top"; + this.alwaysOnTopToolStripMenuItem.Click += new System.EventHandler(this.alwaysOnTopToolStripMenuItem_Click); + // // helpToolStripMenuItem // this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -259,6 +270,7 @@ private System.Windows.Forms.ToolStripMenuItem aboutWindowsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem characterStyleToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem searchTextInTheWebToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem backgroundColorToolStripMenuItem; } } diff --git a/Notepad/Form1.cs b/Notepad/Form1.cs index 225ddf1..f3352a8 100644 --- a/Notepad/Form1.cs +++ b/Notepad/Form1.cs @@ -191,24 +191,30 @@ namespace Notepad } } + try + { + var equals = LatestVersion.CompareTo(CurrentVersion); - var equals = LatestVersion.CompareTo(CurrentVersion); - - if (equals == 0) - { - // Up-to-date - MessageBox.Show("The program is up-to-date",Text,MessageBoxButtons.OK); - } - else if (equals < 0) - { - MessageBox.Show("You are using an unofficial release of Notepad", Text, MessageBoxButtons.OK); // Unofficial - } - else // New release available! - { - if (MessageBox.Show("This new version is available:" + " " + LatestVersion + ". You are using the version" + " " + CurrentVersion + ". Do you want to open the download website?", Text, MessageBoxButtons.YesNo) == DialogResult.Yes) // New release available! + if (equals == 0) { - Process.Start("https://github.com/Vichingo455/Notepad/releases/tag/" + LatestVersion); + // Up-to-date + MessageBox.Show("The program is up-to-date", Text, MessageBoxButtons.OK); } + else if (equals < 0) + { + MessageBox.Show("You are using an unofficial release of Notepad", Text, MessageBoxButtons.OK); // Unofficial + } + else // New release available! + { + if (MessageBox.Show("This new version is available:" + " " + LatestVersion + ". You are using the version" + " " + CurrentVersion + ". Do you want to open the download website?", Text, MessageBoxButtons.YesNo) == DialogResult.Yes) // New release available! + { + Process.Start("https://github.com/Vichingo455/Notepad/releases/tag/" + LatestVersion); + } + } + } + catch + { + } } @@ -317,6 +323,8 @@ namespace Notepad FontDialog stl = new FontDialog(); stl.ShowColor = true; stl.AllowVectorFonts = true; + stl.Font = text_area.Font; + stl.Color = text_area.ForeColor; if (stl.ShowDialog() == DialogResult.OK) { text_area.Font = stl.Font; @@ -369,11 +377,40 @@ namespace Notepad } } } + + private void backgroundColorToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + ColorDialog clr = new ColorDialog(); + clr.Color = text_area.BackColor; + if (clr.ShowDialog() == DialogResult.OK) + { + text_area.BackColor = clr.Color; + BackColor = clr.Color; + menuStrip1.BackColor = clr.Color; + } + } + catch (Exception ex) + { + try + { + var dialog = MessageBox.Show("The following exception occured: " + ex.Message + "\nDo you want to send a crash report", this.Text + " - Critical error", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (dialog == DialogResult.Yes) + { + Program.SendCrashReport(ex); + } + } + catch + { + + } + } + } } public class Global { public static string savefilename; public static string confidential; - public static string font_text; } } diff --git a/Notepad/Program.cs b/Notepad/Program.cs index 8f82be2..88d73f6 100644 --- a/Notepad/Program.cs +++ b/Notepad/Program.cs @@ -29,7 +29,7 @@ namespace Notepad body = HttpUtility.UrlEncode(body); - string uri = $"https://github.com/builtbybel/ThisIsWin11/issues/new?labels=crash+report&title={header}&body={body}"; + string uri = $"https://github.com/Vichingo455/Notepad/issues/new?labels=crash+report&title={header}&body={body}"; Process.Start(uri); } /// diff --git a/Notepad/Properties/AssemblyInfo.cs b/Notepad/Properties/AssemblyInfo.cs index 2278f26..f0a922c 100644 --- a/Notepad/Properties/AssemblyInfo.cs +++ b/Notepad/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // usando l'asterisco '*' come illustrato di seguito: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.1.0")] -[assembly: AssemblyFileVersion("1.1.1.0")] +[assembly: AssemblyVersion("1.1.2.0")] +[assembly: AssemblyFileVersion("1.1.2.0")]