From 5302e9cdc40bd5be233c1d8804c622922094b00e Mon Sep 17 00:00:00 2001 From: HovKlan-DH Date: Wed, 16 Dec 2020 16:26:24 +0100 Subject: [PATCH] 2020-December-16 --- HovText/History.Designer.cs | 104 --- HovText/History.cs | 182 ----- HovText/HistoryList.Designer.cs | 369 ++++++++++ HovText/HistoryList.cs | 611 ++++++++++++++++ HovText/{History.resx => HistoryList.resx} | 0 HovText/HovText.csproj | 10 +- HovText/Program.cs | 40 +- HovText/Properties/AssemblyInfo.cs | 6 +- HovText/Settings.Designer.cs | 603 +++++++++++---- HovText/Settings.cs | 812 +++++++++++++++------ HovText/Settings.resx | 3 - HovText/Update.Designer.cs | 36 +- 12 files changed, 2085 insertions(+), 691 deletions(-) delete mode 100644 HovText/History.Designer.cs delete mode 100644 HovText/History.cs create mode 100644 HovText/HistoryList.Designer.cs create mode 100644 HovText/HistoryList.cs rename HovText/{History.resx => HistoryList.resx} (100%) diff --git a/HovText/History.Designer.cs b/HovText/History.Designer.cs deleted file mode 100644 index 8d5f0c3..0000000 --- a/HovText/History.Designer.cs +++ /dev/null @@ -1,104 +0,0 @@ -namespace HovText -{ - partial class History - { - /// - /// 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.textBoxHistory = new System.Windows.Forms.Label(); - this.pictureHistory = new System.Windows.Forms.PictureBox(); - this.topline = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.pictureHistory)).BeginInit(); - this.SuspendLayout(); - // - // textBoxHistory - // - this.textBoxHistory.BackColor = System.Drawing.SystemColors.Info; - this.textBoxHistory.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.textBoxHistory.Location = new System.Drawing.Point(-5, 34); - this.textBoxHistory.Name = "textBoxHistory"; - this.textBoxHistory.Padding = new System.Windows.Forms.Padding(7); - this.textBoxHistory.Size = new System.Drawing.Size(523, 335); - this.textBoxHistory.TabIndex = 25; - this.textBoxHistory.Text = "#"; - // - // pictureHistory - // - this.pictureHistory.BackColor = System.Drawing.SystemColors.Info; - this.pictureHistory.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.pictureHistory.Location = new System.Drawing.Point(-5, 34); - this.pictureHistory.Margin = new System.Windows.Forms.Padding(8, 12, 8, 12); - this.pictureHistory.Name = "pictureHistory"; - this.pictureHistory.Padding = new System.Windows.Forms.Padding(5); - this.pictureHistory.Size = new System.Drawing.Size(547, 320); - this.pictureHistory.TabIndex = 22; - this.pictureHistory.TabStop = false; - // - // topline - // - this.topline.BackColor = System.Drawing.Color.PaleGoldenrod; - this.topline.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.topline.Location = new System.Drawing.Point(-3, -3); - this.topline.Name = "topline"; - this.topline.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0); - this.topline.Size = new System.Drawing.Size(521, 37); - this.topline.TabIndex = 26; - this.topline.Text = "#"; - this.topline.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // History - // - this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 31F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.PaleGoldenrod; - this.ClientSize = new System.Drawing.Size(508, 321); - this.ControlBox = false; - this.Controls.Add(this.topline); - this.Controls.Add(this.textBoxHistory); - this.Controls.Add(this.pictureHistory); - this.Font = new System.Drawing.Font("Segoe UI", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ForeColor = System.Drawing.Color.Black; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; - this.Location = new System.Drawing.Point(1365, 785); - this.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8); - this.Name = "History"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.TopMost = true; - this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.History_KeyUp); - ((System.ComponentModel.ISupportInitialize)(this.pictureHistory)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - private System.Windows.Forms.Label textBoxHistory; - private System.Windows.Forms.PictureBox pictureHistory; - private System.Windows.Forms.Label topline; - - } -} \ No newline at end of file diff --git a/HovText/History.cs b/HovText/History.cs deleted file mode 100644 index 4058ba9..0000000 --- a/HovText/History.cs +++ /dev/null @@ -1,182 +0,0 @@ -using System; -using System.Threading; -using System.Drawing; -using System.Windows.Forms; - -namespace HovText -{ - public partial class History : Form - { - // ########################################################################################### - // Main - // ########################################################################################### - - public History() - { - InitializeComponent(); - } - - - // ########################################################################################### - // Set the position and style (color and font) for the history area - // ########################################################################################### - - public void SetHistoryPosition() - { - // Set this form width and height - Width = Settings.historyWidth; - Height = Settings.historyHeight; - - // Get history location - int x; - int y; - switch (Settings.historyLocation) - { - case "Center": - x = (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2; - y = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2; - this.Left = x; - this.Top = y; - break; - case "Top Left": - x = Screen.PrimaryScreen.WorkingArea.Left; - y = Screen.PrimaryScreen.WorkingArea.Top; - this.Left = x + 5; - this.Top = y + 5; - break; - case "Top Right": - x = Screen.PrimaryScreen.WorkingArea.Right - this.Width; - y = Screen.PrimaryScreen.WorkingArea.Top; - this.Left = x - 5; - this.Top = y + 5; - break; - case "Bottom Left": - x = Screen.PrimaryScreen.WorkingArea.Left; - y = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height; - this.Left = x + 5; - this.Top = y - 5; - break; - default: // Bottom Right - x = Screen.PrimaryScreen.WorkingArea.Right - this.Width; - y = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height; - this.Left = x - 5; - this.Top = y - 5; - break; - } - - topline.Width = Settings.historyWidth; - textBoxHistory.Width = Settings.historyWidth; - textBoxHistory.Height = Settings.historyHeight; - pictureHistory.Width = Settings.historyWidth; - pictureHistory.Height = Settings.historyHeight; - } - - private void SetHistoryStyle() - { - // Set the font - topline.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); - textBoxHistory.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); - - // Set the background color - topline.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); - textBoxHistory.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); - pictureHistory.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); - } - - - // ########################################################################################### - // Show either the text or image history - // ########################################################################################### - - public void ShowText(string strTop, string strBody) - { - SetHistoryPosition(); - SetHistoryStyle(); - - topline.Text = strTop; - textBoxHistory.Text = strBody; - textBoxHistory.Visible = true; - pictureHistory.Image = null; - pictureHistory.Visible = false; - TopMost = true; // make sure this form is the top most form - Show(); - } - - public void ShowImage(string strTop, Image imgBody) - { - SetHistoryPosition(); - SetHistoryStyle(); - - topline.Text = strTop + " (image)"; - pictureHistory.Image = imgBody; - pictureHistory.Visible = true; - textBoxHistory.Text = ""; - textBoxHistory.Visible = false; - TopMost = true; // make sure this form is the top most form - Show(); - } - - - // ########################################################################################### - // Catch keyboard input to react on ENTER or ESCAPE - // ########################################################################################### - - private void History_KeyUp(object sender, KeyEventArgs e) - { - if (Settings.isHistoryHotkeyPressed) - { - - // Get modifier keys - bool isShift = e.Shift; - bool isAlt = e.Alt; - bool isControl = e.Control; - - // Select active entry, if no modifier keys are pressed down - if (!isShift && !isAlt && !isControl) - { - Settings.settings.SelectHistoryEntry(); - if (Settings.isEnabledPasteOnSelection) - { - SendKeys.Send("^v"); - } - Console.WriteLine("Select entry"); - } - } - } - - - // ########################################################################################### - // Blink the top line in the history when it reaches oldest or newest element - // https://stackoverflow.com/a/4147406/2028935 - // ########################################################################################### - - public void Flash(int interval) - { - Color color2 = textBoxHistory.BackColor; - new Thread(() => FlashInternal(interval, color2)).Start(); - } - - private delegate void UpdateElementDelegate(Color originalColor); - - public void UpdateElement(Color color) - { - if (topline.InvokeRequired) - { - this.Invoke(new UpdateElementDelegate(UpdateElement), new object[] { color }); - } - topline.BackColor = color; - } - - private void FlashInternal(int interval, Color flashColor) - { - Color original = topline.BackColor; - UpdateElement(flashColor); - Thread.Sleep(interval / 2); - UpdateElement(original); - Thread.Sleep(interval / 2); - } - - - // ########################################################################################### - } -} diff --git a/HovText/HistoryList.Designer.cs b/HovText/HistoryList.Designer.cs new file mode 100644 index 0000000..3659226 --- /dev/null +++ b/HovText/HistoryList.Designer.cs @@ -0,0 +1,369 @@ + +namespace HovText +{ + partial class HistoryList + { + /// + /// 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.textBox1 = new System.Windows.Forms.Label(); + this.textBox2 = new System.Windows.Forms.Label(); + this.textBox3 = new System.Windows.Forms.Label(); + this.textBox4 = new System.Windows.Forms.Label(); + this.textBox5 = new System.Windows.Forms.Label(); + this.textBox6 = new System.Windows.Forms.Label(); + this.textBoxHeadline = new System.Windows.Forms.Label(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.pictureBox3 = new System.Windows.Forms.PictureBox(); + this.pictureBox4 = new System.Windows.Forms.PictureBox(); + this.pictureBox5 = new System.Windows.Forms.PictureBox(); + this.pictureBox6 = new System.Windows.Forms.PictureBox(); + this.pictureBox7 = new System.Windows.Forms.PictureBox(); + this.pictureBox8 = new System.Windows.Forms.PictureBox(); + this.pictureBox9 = new System.Windows.Forms.PictureBox(); + this.pictureBox10 = new System.Windows.Forms.PictureBox(); + this.textBox7 = new System.Windows.Forms.Label(); + this.textBox8 = new System.Windows.Forms.Label(); + this.textBox9 = new System.Windows.Forms.Label(); + this.textBox10 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).BeginInit(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox1.Location = new System.Drawing.Point(12, 59); + this.textBox1.Name = "textBox1"; + this.textBox1.Padding = new System.Windows.Forms.Padding(5); + this.textBox1.Size = new System.Drawing.Size(232, 34); + this.textBox1.TabIndex = 7; + this.textBox1.Text = "#"; + this.textBox1.Visible = false; + // + // textBox2 + // + this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox2.Location = new System.Drawing.Point(12, 103); + this.textBox2.Name = "textBox2"; + this.textBox2.Padding = new System.Windows.Forms.Padding(5); + this.textBox2.Size = new System.Drawing.Size(232, 34); + this.textBox2.TabIndex = 8; + this.textBox2.Text = "#"; + this.textBox2.Visible = false; + // + // textBox3 + // + this.textBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox3.Location = new System.Drawing.Point(12, 150); + this.textBox3.Name = "textBox3"; + this.textBox3.Padding = new System.Windows.Forms.Padding(5); + this.textBox3.Size = new System.Drawing.Size(232, 34); + this.textBox3.TabIndex = 9; + this.textBox3.Text = "#"; + this.textBox3.Visible = false; + // + // textBox4 + // + this.textBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox4.Location = new System.Drawing.Point(12, 198); + this.textBox4.Name = "textBox4"; + this.textBox4.Padding = new System.Windows.Forms.Padding(5); + this.textBox4.Size = new System.Drawing.Size(232, 34); + this.textBox4.TabIndex = 10; + this.textBox4.Text = "#"; + this.textBox4.Visible = false; + // + // textBox5 + // + this.textBox5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox5.Location = new System.Drawing.Point(12, 244); + this.textBox5.Name = "textBox5"; + this.textBox5.Padding = new System.Windows.Forms.Padding(5); + this.textBox5.Size = new System.Drawing.Size(232, 34); + this.textBox5.TabIndex = 11; + this.textBox5.Text = "#"; + this.textBox5.Visible = false; + // + // textBox6 + // + this.textBox6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox6.Location = new System.Drawing.Point(12, 292); + this.textBox6.Name = "textBox6"; + this.textBox6.Padding = new System.Windows.Forms.Padding(5); + this.textBox6.Size = new System.Drawing.Size(232, 34); + this.textBox6.TabIndex = 12; + this.textBox6.Text = "#"; + this.textBox6.Visible = false; + // + // textBoxHeadline + // + this.textBoxHeadline.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBoxHeadline.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxHeadline.Location = new System.Drawing.Point(12, 8); + this.textBoxHeadline.Name = "textBoxHeadline"; + this.textBoxHeadline.Padding = new System.Windows.Forms.Padding(5); + this.textBoxHeadline.Size = new System.Drawing.Size(463, 38); + this.textBoxHeadline.TabIndex = 13; + this.textBoxHeadline.Text = "#"; + this.textBoxHeadline.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // pictureBox1 + // + this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox1.Location = new System.Drawing.Point(259, 59); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Padding = new System.Windows.Forms.Padding(5); + this.pictureBox1.Size = new System.Drawing.Size(216, 34); + this.pictureBox1.TabIndex = 15; + this.pictureBox1.TabStop = false; + this.pictureBox1.Visible = false; + // + // pictureBox2 + // + this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox2.Location = new System.Drawing.Point(259, 103); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Padding = new System.Windows.Forms.Padding(5); + this.pictureBox2.Size = new System.Drawing.Size(216, 34); + this.pictureBox2.TabIndex = 16; + this.pictureBox2.TabStop = false; + this.pictureBox2.Visible = false; + // + // pictureBox3 + // + this.pictureBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox3.Location = new System.Drawing.Point(259, 150); + this.pictureBox3.Name = "pictureBox3"; + this.pictureBox3.Padding = new System.Windows.Forms.Padding(5); + this.pictureBox3.Size = new System.Drawing.Size(216, 34); + this.pictureBox3.TabIndex = 17; + this.pictureBox3.TabStop = false; + this.pictureBox3.Visible = false; + // + // pictureBox4 + // + this.pictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox4.Location = new System.Drawing.Point(259, 198); + this.pictureBox4.Name = "pictureBox4"; + this.pictureBox4.Padding = new System.Windows.Forms.Padding(5); + this.pictureBox4.Size = new System.Drawing.Size(216, 34); + this.pictureBox4.TabIndex = 18; + this.pictureBox4.TabStop = false; + this.pictureBox4.Visible = false; + // + // pictureBox5 + // + this.pictureBox5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox5.Location = new System.Drawing.Point(259, 244); + this.pictureBox5.Name = "pictureBox5"; + this.pictureBox5.Padding = new System.Windows.Forms.Padding(5); + this.pictureBox5.Size = new System.Drawing.Size(216, 34); + this.pictureBox5.TabIndex = 19; + this.pictureBox5.TabStop = false; + this.pictureBox5.Visible = false; + // + // pictureBox6 + // + this.pictureBox6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox6.Location = new System.Drawing.Point(259, 292); + this.pictureBox6.Name = "pictureBox6"; + this.pictureBox6.Padding = new System.Windows.Forms.Padding(5); + this.pictureBox6.Size = new System.Drawing.Size(216, 34); + this.pictureBox6.TabIndex = 20; + this.pictureBox6.TabStop = false; + this.pictureBox6.Visible = false; + // + // pictureBox7 + // + this.pictureBox7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox7.Location = new System.Drawing.Point(259, 339); + this.pictureBox7.Name = "pictureBox7"; + this.pictureBox7.Padding = new System.Windows.Forms.Padding(5); + this.pictureBox7.Size = new System.Drawing.Size(216, 34); + this.pictureBox7.TabIndex = 21; + this.pictureBox7.TabStop = false; + this.pictureBox7.Visible = false; + // + // pictureBox8 + // + this.pictureBox8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox8.Location = new System.Drawing.Point(259, 386); + this.pictureBox8.Name = "pictureBox8"; + this.pictureBox8.Padding = new System.Windows.Forms.Padding(5); + this.pictureBox8.Size = new System.Drawing.Size(216, 34); + this.pictureBox8.TabIndex = 22; + this.pictureBox8.TabStop = false; + this.pictureBox8.Visible = false; + // + // pictureBox9 + // + this.pictureBox9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox9.Location = new System.Drawing.Point(259, 435); + this.pictureBox9.Name = "pictureBox9"; + this.pictureBox9.Padding = new System.Windows.Forms.Padding(5); + this.pictureBox9.Size = new System.Drawing.Size(216, 34); + this.pictureBox9.TabIndex = 23; + this.pictureBox9.TabStop = false; + this.pictureBox9.Visible = false; + // + // pictureBox10 + // + this.pictureBox10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox10.Location = new System.Drawing.Point(259, 482); + this.pictureBox10.Name = "pictureBox10"; + this.pictureBox10.Padding = new System.Windows.Forms.Padding(5); + this.pictureBox10.Size = new System.Drawing.Size(216, 34); + this.pictureBox10.TabIndex = 24; + this.pictureBox10.TabStop = false; + this.pictureBox10.Visible = false; + // + // textBox7 + // + this.textBox7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox7.Location = new System.Drawing.Point(12, 339); + this.textBox7.Name = "textBox7"; + this.textBox7.Padding = new System.Windows.Forms.Padding(5); + this.textBox7.Size = new System.Drawing.Size(232, 34); + this.textBox7.TabIndex = 25; + this.textBox7.Text = "#"; + this.textBox7.Visible = false; + // + // textBox8 + // + this.textBox8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox8.Location = new System.Drawing.Point(12, 386); + this.textBox8.Name = "textBox8"; + this.textBox8.Padding = new System.Windows.Forms.Padding(5); + this.textBox8.Size = new System.Drawing.Size(232, 34); + this.textBox8.TabIndex = 26; + this.textBox8.Text = "#"; + this.textBox8.Visible = false; + // + // textBox9 + // + this.textBox9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox9.Location = new System.Drawing.Point(12, 435); + this.textBox9.Name = "textBox9"; + this.textBox9.Padding = new System.Windows.Forms.Padding(5); + this.textBox9.Size = new System.Drawing.Size(232, 34); + this.textBox9.TabIndex = 27; + this.textBox9.Text = "#"; + this.textBox9.Visible = false; + // + // textBox10 + // + this.textBox10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox10.Location = new System.Drawing.Point(12, 482); + this.textBox10.Name = "textBox10"; + this.textBox10.Padding = new System.Windows.Forms.Padding(5); + this.textBox10.Size = new System.Drawing.Size(232, 34); + this.textBox10.TabIndex = 28; + this.textBox10.Text = "#"; + this.textBox10.Visible = false; + // + // HistoryList + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(485, 534); + this.ControlBox = false; + this.Controls.Add(this.textBox10); + this.Controls.Add(this.textBox9); + this.Controls.Add(this.textBox8); + this.Controls.Add(this.textBox7); + this.Controls.Add(this.pictureBox10); + this.Controls.Add(this.pictureBox9); + this.Controls.Add(this.pictureBox8); + this.Controls.Add(this.pictureBox7); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.textBoxHeadline); + this.Controls.Add(this.textBox6); + this.Controls.Add(this.textBox5); + this.Controls.Add(this.textBox4); + this.Controls.Add(this.textBox3); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.pictureBox2); + this.Controls.Add(this.pictureBox3); + this.Controls.Add(this.pictureBox4); + this.Controls.Add(this.pictureBox5); + this.Controls.Add(this.pictureBox6); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "HistoryList"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.HistoryList_KeyUp); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + private System.Windows.Forms.Label textBoxHeadline; + private System.Windows.Forms.Label textBox1; + private System.Windows.Forms.Label textBox2; + private System.Windows.Forms.Label textBox3; + private System.Windows.Forms.Label textBox4; + private System.Windows.Forms.Label textBox5; + private System.Windows.Forms.Label textBox6; + private System.Windows.Forms.Label textBox7; + private System.Windows.Forms.Label textBox8; + private System.Windows.Forms.Label textBox9; + private System.Windows.Forms.Label textBox10; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.PictureBox pictureBox2; + private System.Windows.Forms.PictureBox pictureBox3; + private System.Windows.Forms.PictureBox pictureBox4; + private System.Windows.Forms.PictureBox pictureBox5; + private System.Windows.Forms.PictureBox pictureBox6; + private System.Windows.Forms.PictureBox pictureBox7; + private System.Windows.Forms.PictureBox pictureBox8; + private System.Windows.Forms.PictureBox pictureBox9; + private System.Windows.Forms.PictureBox pictureBox10; + } +} \ No newline at end of file diff --git a/HovText/HistoryList.cs b/HovText/HistoryList.cs new file mode 100644 index 0000000..3e273ef --- /dev/null +++ b/HovText/HistoryList.cs @@ -0,0 +1,611 @@ +using System; +using System.Drawing; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace HovText +{ + public partial class HistoryList : Form + { + + int firstBox = 0; + int entryIndexLast = 0; + + + // ########################################################################################### + // Main + // ########################################################################################### + + public HistoryList() + { + InitializeComponent(); + } + + + // ########################################################################################### + // Show the history list (triggered on each history hotkey) + // ########################################################################################### + + public void UpdateHistoryList(string direction) + { + SetHistoryPosition(); + + int boxElements = Settings.historyListElements; + int entries = Settings.entriesText.Count(); + int entryIndex = Settings.entryCounter; // 1 is the lowest value as a human readable number + firstBox = firstBox == 0 ? entries : firstBox; + int scopeHighest = firstBox; // "boxElements" is the lowest value as a human readable number (newest copy on top) + int scopeLowest = scopeHighest - boxElements + 1; // 1 is the lowest value as a human readable number (oldest copy at bottom) + + if(direction == "down") + { + firstBox = entryIndex >= scopeLowest ? firstBox : firstBox - 1; + } + if (direction == "up") + { + firstBox = entryIndex <= scopeHighest ? firstBox : firstBox + 1; + } + + if (entryIndex == entryIndexLast && (entryIndex == entries || entryIndex == 1)) + { + Flash(); + } + entryIndexLast = entryIndex; + + // Set this form width and element heights + int boxHeight; + int width; + switch (Settings.historySize) + { + case "Small": + boxHeight = Settings.historyBoxHeightSmall[Settings.historyListElements - 1]; + width = Settings.historyListWidthSmall; + break; + case "Large": + boxHeight = Settings.historyBoxHeightLarge[Settings.historyListElements - 1]; + width = Settings.historyListWidthLarge; + break; + default: // Medium + boxHeight = Settings.historyBoxHeightMedium[Settings.historyListElements - 1]; + width = Settings.historyListWidthMedium; + break; + } + + // Hide if not all boxes in the list is populated with data + if (boxElements > entries) + { + for (int i = boxElements; i <= entries; i++) + { + HideBox(i); + } + } + + // Not sure why this is needed but will make the border visible + int widthSubstract = 10; + + // Get application name of highlighted entry + string entryApplication = Settings.entriesApplication.ElementAt(entryIndex - 1).Value; + textBoxHeadline.Text = entryIndex + " of " + entries + " from \"" + entryApplication + "\""; + textBoxHeadline.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + textBoxHeadline.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBoxHeadline.Width = width - widthSubstract; + textBoxHeadline.Location = new Point(0, 0); + + // Walkthrough all "boxElements" boxes + for (int i = 1; i <= boxElements; i++) + { + // Do not put more boxes than the max amount of entries + if (i > entries) + { + break; + } + + string entryText = Settings.entriesText.ElementAt(firstBox - i).Value; + Image entryImage = Settings.entriesImage.ElementAt(firstBox - i).Value; + + bool isEntryText = entryText == "" ? false : true; + bool isEntryImage = entryImage == null ? false : true; + + switch (i) + { + + case 1: + textBox1.Width = width - widthSubstract; + pictureBox1.Width = width - widthSubstract; + textBox1.Height = boxHeight; + pictureBox1.Height = boxHeight; + textBox1.Location = new Point(0, textBoxHeadline.Height - 1); + pictureBox1.Location = new Point(0, textBoxHeadline.Height - 1); + textBox1.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBox1.Text = entryText; + pictureBox1.Image = entryImage; + textBox1.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox1.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + if (entryIndex == (firstBox - i + 1)) + { + // Do not show the "active element" color, if only showing one element + if(Settings.historyListElements == 1) + { + textBox1.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox1.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + } else + { + textBox1.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + pictureBox1.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + } + } + if (isEntryText) + { + textBox1.Visible = true; + pictureBox1.Visible = false; + } + else + { + textBox1.Visible = false; + pictureBox1.Visible = true; + } + break; + + case 2: + textBox2.Width = width - widthSubstract; + pictureBox2.Width = width - widthSubstract; + textBox2.Height = boxHeight; + pictureBox2.Height = boxHeight; + textBox2.Location = new Point(0, textBoxHeadline.Height + (1 * boxHeight) - 2); + pictureBox2.Location = new Point(0, textBoxHeadline.Height + (1 * boxHeight) - 2); + textBox2.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBox2.Text = entryText; + pictureBox2.Image = entryImage; + textBox2.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox2.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + if (entryIndex == (firstBox - i + 1)) + { + textBox2.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + pictureBox2.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + } + if (isEntryText) + { + textBox2.Visible = true; + pictureBox2.Visible = false; + } + else + { + textBox2.Visible = false; + pictureBox2.Visible = true; + } + break; + + case 3: + textBox3.Width = width - widthSubstract; + pictureBox3.Width = width - widthSubstract; + textBox3.Height = boxHeight; + pictureBox3.Height = boxHeight; + textBox3.Location = new Point(0, textBoxHeadline.Height + (2 * boxHeight) - 3); + pictureBox3.Location = new Point(0, textBoxHeadline.Height + (2 * boxHeight) - 3); + textBox3.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBox3.Text = entryText; + pictureBox3.Image = entryImage; + textBox3.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox3.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + if (entryIndex == (firstBox - i + 1)) + { + textBox3.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + pictureBox3.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + } + if (isEntryText) + { + textBox3.Visible = true; + pictureBox3.Visible = false; + } + else + { + textBox3.Visible = false; + pictureBox3.Visible = true; + } + break; + + case 4: + textBox4.Width = width - widthSubstract; + pictureBox4.Width = width - widthSubstract; + textBox4.Height = boxHeight; + pictureBox4.Height = boxHeight; + textBox4.Location = new Point(0, textBoxHeadline.Height + (3 * boxHeight) - 4); + pictureBox4.Location = new Point(0, textBoxHeadline.Height + (3 * boxHeight) - 4); + textBox4.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBox4.Text = entryText; + pictureBox4.Image = entryImage; + textBox4.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox4.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + if (entryIndex == (firstBox - i + 1)) + { + textBox4.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + pictureBox4.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + } + if (isEntryText) + { + textBox4.Visible = true; + pictureBox4.Visible = false; + } + else + { + textBox4.Visible = false; + pictureBox4.Visible = true; + } + break; + + case 5: + textBox5.Width = width - widthSubstract; + pictureBox5.Width = width - widthSubstract; + textBox5.Height = boxHeight; + pictureBox5.Height = boxHeight; + textBox5.Location = new Point(0, textBoxHeadline.Height + (4 * boxHeight) - 5); + pictureBox5.Location = new Point(0, textBoxHeadline.Height + (4 * boxHeight) - 5); + textBox5.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBox5.Text = entryText; + pictureBox5.Image = entryImage; + textBox5.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox5.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + if (entryIndex == (firstBox - i + 1)) + { + textBox5.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + pictureBox5.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + } + if (isEntryText) + { + textBox5.Visible = true; + pictureBox5.Visible = false; + } + else + { + textBox5.Visible = false; + pictureBox5.Visible = true; + } + break; + + case 6: + textBox6.Width = width - widthSubstract; + pictureBox6.Width = width - widthSubstract; + textBox6.Height = boxHeight; + pictureBox6.Height = boxHeight; + textBox6.Location = new Point(0, textBoxHeadline.Height + (5 * boxHeight) - 6); + pictureBox6.Location = new Point(0, textBoxHeadline.Height + (5 * boxHeight) - 6); + textBox6.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBox6.Text = entryText; + pictureBox6.Image = entryImage; + textBox6.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox6.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + if (entryIndex == (firstBox - i + 1)) + { + textBox6.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + pictureBox6.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + } + if (isEntryText) + { + textBox6.Visible = true; + pictureBox6.Visible = false; + } + else + { + textBox6.Visible = false; + pictureBox6.Visible = true; + } + break; + + case 7: + textBox7.Width = width - widthSubstract; + pictureBox7.Width = width - widthSubstract; + textBox7.Height = boxHeight; + pictureBox7.Height = boxHeight; + textBox7.Location = new Point(0, textBoxHeadline.Height + (6 * boxHeight) - 7); + pictureBox7.Location = new Point(0, textBoxHeadline.Height + (6 * boxHeight) - 7); + textBox7.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBox7.Text = entryText; + pictureBox7.Image = entryImage; + textBox7.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox7.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + if (entryIndex == (firstBox - i + 1)) + { + textBox7.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + pictureBox7.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + } + if (isEntryText) + { + textBox7.Visible = true; + pictureBox7.Visible = false; + } + else + { + textBox7.Visible = false; + pictureBox7.Visible = true; + } + break; + + case 8: + textBox8.Width = width - widthSubstract; + pictureBox8.Width = width - widthSubstract; + textBox8.Height = boxHeight; + pictureBox8.Height = boxHeight; + textBox8.Location = new Point(0, textBoxHeadline.Height + (7 * boxHeight) - 8); + pictureBox8.Location = new Point(0, textBoxHeadline.Height + (7 * boxHeight) - 8); + textBox8.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBox8.Text = entryText; + pictureBox8.Image = entryImage; + textBox8.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox8.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + if (entryIndex == (firstBox - i + 1)) + { + textBox8.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + pictureBox8.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + } + if (isEntryText) + { + textBox8.Visible = true; + pictureBox8.Visible = false; + } + else + { + textBox8.Visible = false; + pictureBox8.Visible = true; + } + break; + + case 9: + textBox9.Width = width - widthSubstract; + pictureBox9.Width = width - widthSubstract; + textBox9.Height = boxHeight; + pictureBox9.Height = boxHeight; + textBox9.Location = new Point(0, textBoxHeadline.Height + (8 * boxHeight) - 9); + pictureBox9.Location = new Point(0, textBoxHeadline.Height + (8 * boxHeight) - 9); + textBox9.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBox9.Text = entryText; + pictureBox9.Image = entryImage; + textBox9.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox9.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + if (entryIndex == (firstBox - i + 1)) + { + textBox9.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + pictureBox9.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + } + if (isEntryText) + { + textBox9.Visible = true; + pictureBox9.Visible = false; + } + else + { + textBox9.Visible = false; + pictureBox9.Visible = true; + } + break; + + case 10: + textBox10.Width = width - widthSubstract; + pictureBox10.Width = width - widthSubstract; + textBox10.Height = boxHeight; + pictureBox10.Height = boxHeight; + textBox10.Location = new Point(0, textBoxHeadline.Height + (9 * boxHeight) - 10); + pictureBox10.Location = new Point(0, textBoxHeadline.Height + (9 * boxHeight) - 10); + textBox10.Font = new Font(Settings.historyFontFamily, Settings.historyFontSize); + textBox10.Text = entryText; + pictureBox10.Image = entryImage; + textBox10.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + pictureBox10.BackColor = ColorTranslator.FromHtml(Settings.historyColorBottom); + if (entryIndex == (firstBox - i + 1)) + { + textBox10.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + pictureBox10.BackColor = ColorTranslator.FromHtml(Settings.historyColorTop); + } + if (isEntryText) + { + textBox10.Visible = true; + pictureBox10.Visible = false; + } + else + { + textBox10.Visible = false; + pictureBox10.Visible = true; + } + break; + + } + + } + TopMost = true; // make sure this form is the top most form to catch the key-up + Show(); + } + + + // ########################################################################################### + // Set the position for the history area + // ########################################################################################### + + private void SetHistoryPosition() + { + // Get the history form width and the element height + int boxHeight; + int width; + switch (Settings.historySize) + { + case "Small": + boxHeight = Settings.historyBoxHeightSmall[Settings.historyListElements - 1]; + width = Settings.historyListWidthSmall; + break; + case "Large": + boxHeight = Settings.historyBoxHeightLarge[Settings.historyListElements - 1]; + width = Settings.historyListWidthLarge; + break; + default: // Medium + boxHeight = Settings.historyBoxHeightMedium[Settings.historyListElements - 1]; + width = Settings.historyListWidthMedium; + break; + } + + // Determine if we should show max boxes or max entries + int elements = Settings.historyListElements > Settings.entriesText.Count() ? Settings.entriesText.Count() : Settings.historyListElements; + + // Set the history form width and height + Width = width; + Height = (elements * boxHeight) + textBoxHeadline.Height + 3; + + // Set history location + int x; + int y; + int airgab = 5; + switch (Settings.historyLocation) + { + case "Left Top": + x = Screen.PrimaryScreen.WorkingArea.Left; + y = Screen.PrimaryScreen.WorkingArea.Top; + this.Left = x + airgab; + this.Top = y + airgab; + break; + case "Left Bottom": + x = Screen.PrimaryScreen.WorkingArea.Left; + y = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height; + this.Left = x + airgab; + this.Top = y - airgab; + break; + case "Center": + x = (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2; + y = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2; + this.Left = x; + this.Top = y; + break; + case "Right Top": + x = Screen.PrimaryScreen.WorkingArea.Right - this.Width; + y = Screen.PrimaryScreen.WorkingArea.Top; + this.Left = x - airgab; + this.Top = y + airgab; + break; + default: // Right Bottom + x = Screen.PrimaryScreen.WorkingArea.Right - this.Width; + y = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height; + this.Left = x - airgab; + this.Top = y - airgab; + break; + } + } + + + // ########################################################################################### + // Catch keyboard input to react on modifier KEY UP + // ########################################################################################### + + private void HistoryList_KeyUp(object sender, KeyEventArgs e) + { + // Check if modifier keys are pressed + bool isShift = e.Shift; + bool isAlt = e.Alt; + bool isControl = e.Control; + + // Proceed if no modifier keys are pressed down + if (!isShift && !isAlt && !isControl) + { + // Reset if the entry is selected + firstBox = 0; + entryIndexLast = 0; + + Settings.settings.SelectHistoryEntry(); + if (Settings.isEnabledPasteOnSelection) + { + SendKeys.Send("^v"); + } + + // Show the "Settings" form again, if it was visible before the hotkey keypress + if (Settings.isSettingsFormVisible) + { + Settings.settings.Show(); + } + Console.WriteLine("Selected history entry"); + } + } + + + // ########################################################################################### + // Blink the top line in the history when it reaches oldest or newest element + // https://stackoverflow.com/a/4147406/2028935 + // ########################################################################################### + + private void Flash() + { + new Thread(() => FlashInternal()).Start(); + } + + private delegate void UpdateElementDelegate(Color originalColor); + + private void UpdateElement(Color color) + { + if (textBoxHeadline.InvokeRequired) + { + this.Invoke(new UpdateElementDelegate(UpdateElement), new object[] { color }); + } + textBoxHeadline.BackColor = color; + } + + private void FlashInternal() + { + int interval = 100; + UpdateElement(ColorTranslator.FromHtml(Settings.historyColorBottom)); + Thread.Sleep(interval / 2); + UpdateElement(ColorTranslator.FromHtml(Settings.historyColorTop)); + Thread.Sleep(interval / 2); + } + + + // ########################################################################################### + // Hide a box (text and image) + // ########################################################################################### + + public void HideBox(int box) + { + switch (box) + { + case 1: + textBox1.Visible = false; + pictureBox1.Visible = false; + break; + case 2: + textBox2.Visible = false; + pictureBox2.Visible = false; + break; + case 3: + textBox3.Visible = false; + pictureBox3.Visible = false; + break; + case 4: + textBox4.Visible = false; + pictureBox4.Visible = false; + break; + case 5: + textBox5.Visible = false; + pictureBox5.Visible = false; + break; + case 6: + textBox6.Visible = false; + pictureBox6.Visible = false; + break; + case 7: + textBox7.Visible = false; + pictureBox7.Visible = false; + break; + case 8: + textBox8.Visible = false; + pictureBox8.Visible = false; + break; + case 9: + textBox9.Visible = false; + pictureBox9.Visible = false; + break; + case 10: + textBox10.Visible = false; + pictureBox10.Visible = false; + break; + } + } + + + // ########################################################################################### + } +} diff --git a/HovText/History.resx b/HovText/HistoryList.resx similarity index 100% rename from HovText/History.resx rename to HovText/HistoryList.resx diff --git a/HovText/HovText.csproj b/HovText/HovText.csproj index 9456bba..87232ce 100644 --- a/HovText/HovText.csproj +++ b/HovText/HovText.csproj @@ -80,11 +80,11 @@ - + Form - - History.cs + + HistoryList.cs Form @@ -111,8 +111,8 @@ Update.cs - - History.cs + + HistoryList.cs HotkeyConflict.cs diff --git a/HovText/Program.cs b/HovText/Program.cs index d4dd9fc..9d2387c 100644 --- a/HovText/Program.cs +++ b/HovText/Program.cs @@ -1,6 +1,7 @@ using System; using System.Runtime.InteropServices; using System.Windows.Forms; +using System.Threading; namespace HovText { @@ -15,21 +16,42 @@ static class Program static int Main(string[] args) { - // Get the argument passed (only one supported) - if (args.Length > 0) + // Only run one instance + // https://stackoverflow.com/a/184143/2028935 + bool createdNew = true; + using (Mutex mutex = new Mutex(true, "HovText", out createdNew)) { - arg0 = args[0].ToLower(); - } - - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Settings = new Settings(); - Application.Run(Settings); + if (createdNew) + { + // Get the argument passed (only one supported) + if (args.Length > 0) + { + arg0 = args[0].ToLower(); + } + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Settings = new Settings(); + Application.Run(Settings); + + } else + { + MessageBox.Show("HovText is already running and cannot startup one more instance","HovText is already running", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } return 0; } + // ########################################################################################### + // Included for getting the process that has updated the clipboard + // ########################################################################################### + + [DllImport("user32.dll")] + public static extern IntPtr GetClipboardOwner(); + + // ########################################################################################### // Included for getting and setting application focus // ########################################################################################### diff --git a/HovText/Properties/AssemblyInfo.cs b/HovText/Properties/AssemblyInfo.cs index 144628b..dced331 100644 --- a/HovText/Properties/AssemblyInfo.cs +++ b/HovText/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("HovText")] -[assembly: AssemblyDescription("A free open source clipboard manager that can remove formatting")] +[assembly: AssemblyDescription("An advanced Windows .NET open source clipboard manager")] [assembly: AssemblyConfiguration("Release")] // Development / Release [assembly: AssemblyCompany("HovKlan")] [assembly: AssemblyProduct("HovText")] @@ -15,8 +15,8 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("03fbad69-cd44-4a0c-b4bf-90406561f14f")] -[assembly: AssemblyVersion("2020.11.24.0")] -[assembly: AssemblyFileVersion("2020.11.24.0")] +[assembly: AssemblyVersion("2020.12.16.0")] +[assembly: AssemblyFileVersion("2020.12.16.0")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from diff --git a/HovText/Settings.Designer.cs b/HovText/Settings.Designer.cs index 6a112a8..7b5fbbd 100644 --- a/HovText/Settings.Designer.cs +++ b/HovText/Settings.Designer.cs @@ -39,21 +39,18 @@ private void InitializeComponent() this.uiHistoryEnabled = new System.Windows.Forms.CheckBox(); this.uiStartWithWindows = new System.Windows.Forms.CheckBox(); this.fontDialog = new System.Windows.Forms.FontDialog(); - this.uiChangeFont = new System.Windows.Forms.Button(); - this.uiShowFont = new System.Windows.Forms.TextBox(); this.uiAreaSmall = new System.Windows.Forms.RadioButton(); this.uiAreaMedium = new System.Windows.Forms.RadioButton(); this.uiAreaLarge = new System.Windows.Forms.RadioButton(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.uiCheckUpdates = new System.Windows.Forms.CheckBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.uiRestoreOriginal = new System.Windows.Forms.CheckBox(); + this.uiCopyImages = new System.Windows.Forms.CheckBox(); this.uiPasteOnSelection = new System.Windows.Forms.CheckBox(); this.uiCloseMinimize = new System.Windows.Forms.CheckBox(); this.uiTrimWhitespaces = new System.Windows.Forms.CheckBox(); this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.groupBox6 = new System.Windows.Forms.GroupBox(); - this.uiHistoryColorSelector = new System.Windows.Forms.ComboBox(); this.appVer = new System.Windows.Forms.Label(); this.tabControl = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); @@ -73,8 +70,34 @@ private void InitializeComponent() this.label7 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.uiElement10 = new System.Windows.Forms.RadioButton(); + this.uiElement9 = new System.Windows.Forms.RadioButton(); + this.uiElement8 = new System.Windows.Forms.RadioButton(); + this.uiElement7 = new System.Windows.Forms.RadioButton(); + this.uiElement6 = new System.Windows.Forms.RadioButton(); + this.uiElement5 = new System.Windows.Forms.RadioButton(); + this.uiElement4 = new System.Windows.Forms.RadioButton(); + this.uiElement3 = new System.Windows.Forms.RadioButton(); + this.uiElement1 = new System.Windows.Forms.RadioButton(); + this.uiElement2 = new System.Windows.Forms.RadioButton(); + this.groupBox10 = new System.Windows.Forms.GroupBox(); + this.uiHistoryLocationRightBottom = new System.Windows.Forms.RadioButton(); + this.uiHistoryLocationRightTop = new System.Windows.Forms.RadioButton(); + this.uiHistoryLocationCenter = new System.Windows.Forms.RadioButton(); + this.uiHistoryLocationLeftTop = new System.Windows.Forms.RadioButton(); + this.uiHistoryLocationLeftBottom = new System.Windows.Forms.RadioButton(); + this.tabPage3 = new System.Windows.Forms.TabPage(); this.groupBox8 = new System.Windows.Forms.GroupBox(); - this.uiHistoryLocation = new System.Windows.Forms.ComboBox(); + this.uiHistoryColorYellow = new System.Windows.Forms.RadioButton(); + this.uiHistoryColorWhite = new System.Windows.Forms.RadioButton(); + this.uiHistoryColorGreen = new System.Windows.Forms.RadioButton(); + this.uiHistoryColorBlue = new System.Windows.Forms.RadioButton(); + this.uiHistoryColorBrown = new System.Windows.Forms.RadioButton(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.uiShowFontTop = new System.Windows.Forms.TextBox(); + this.uiChangeFont = new System.Windows.Forms.Button(); + this.uiShowFontBottom = new System.Windows.Forms.TextBox(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.aboutBox = new System.Windows.Forms.RichTextBox(); this.label2 = new System.Windows.Forms.Label(); @@ -86,15 +109,17 @@ private void InitializeComponent() this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.groupBox6.SuspendLayout(); this.tabControl.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage5.SuspendLayout(); this.groupBox7.SuspendLayout(); this.groupBox5.SuspendLayout(); this.tabPage2.SuspendLayout(); + this.groupBox6.SuspendLayout(); + this.groupBox10.SuspendLayout(); + this.tabPage3.SuspendLayout(); this.groupBox8.SuspendLayout(); + this.groupBox4.SuspendLayout(); this.tabPage4.SuspendLayout(); this.SuspendLayout(); // @@ -109,7 +134,7 @@ private void InitializeComponent() this.uiAppEnabled.TabIndex = 21; this.uiAppEnabled.Text = "Enable application"; this.uiAppEnabled.UseVisualStyleBackColor = true; - this.uiAppEnabled.CheckedChanged += new System.EventHandler(this.uiAppEnabled_CheckedChanged_1); + this.uiAppEnabled.CheckedChanged += new System.EventHandler(this.uiAppEnabled_CheckedChanged); // // notifyIcon // @@ -128,26 +153,27 @@ private void InitializeComponent() this.tabSettings, this.exit}); this.notifyIconMenuStrip.Name = "notofyIconMenuStrip"; - this.notifyIconMenuStrip.Size = new System.Drawing.Size(178, 76); + this.notifyIconMenuStrip.Size = new System.Drawing.Size(211, 104); // // tabAbout // this.tabAbout.Name = "tabAbout"; - this.tabAbout.Size = new System.Drawing.Size(177, 24); + this.tabAbout.Size = new System.Drawing.Size(210, 24); this.tabAbout.Text = "About HovText"; this.tabAbout.Click += new System.EventHandler(this.trayIconAbout_Click); // // tabSettings // + this.tabSettings.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tabSettings.Name = "tabSettings"; - this.tabSettings.Size = new System.Drawing.Size(177, 24); + this.tabSettings.Size = new System.Drawing.Size(210, 24); this.tabSettings.Text = "Settings"; this.tabSettings.Click += new System.EventHandler(this.trayIconSettings_Click); // // exit // this.exit.Name = "exit"; - this.exit.Size = new System.Drawing.Size(177, 24); + this.exit.Size = new System.Drawing.Size(210, 24); this.exit.Text = "Exit"; this.exit.Click += new System.EventHandler(this.trayIconExit_Click); // @@ -156,10 +182,10 @@ private void InitializeComponent() this.uiHistoryEnabled.AutoSize = true; this.uiHistoryEnabled.Checked = true; this.uiHistoryEnabled.CheckState = System.Windows.Forms.CheckState.Checked; - this.uiHistoryEnabled.Location = new System.Drawing.Point(29, 95); + this.uiHistoryEnabled.Location = new System.Drawing.Point(29, 127); this.uiHistoryEnabled.Name = "uiHistoryEnabled"; this.uiHistoryEnabled.Size = new System.Drawing.Size(153, 29); - this.uiHistoryEnabled.TabIndex = 23; + this.uiHistoryEnabled.TabIndex = 24; this.uiHistoryEnabled.Text = "Enable history"; this.uiHistoryEnabled.UseVisualStyleBackColor = true; this.uiHistoryEnabled.CheckedChanged += new System.EventHandler(this.uiHistoryEnabled_CheckedChanged); @@ -177,25 +203,6 @@ private void InitializeComponent() this.uiStartWithWindows.UseVisualStyleBackColor = true; this.uiStartWithWindows.CheckedChanged += new System.EventHandler(this.uiStartWithWindows_CheckedChanged); // - // uiChangeFont - // - this.uiChangeFont.Location = new System.Drawing.Point(16, 36); - this.uiChangeFont.Name = "uiChangeFont"; - this.uiChangeFont.Size = new System.Drawing.Size(129, 34); - this.uiChangeFont.TabIndex = 81; - this.uiChangeFont.Text = "Change font"; - this.uiChangeFont.UseVisualStyleBackColor = true; - this.uiChangeFont.Click += new System.EventHandler(this.uiChangeFont_Click); - // - // uiShowFont - // - this.uiShowFont.Location = new System.Drawing.Point(16, 76); - this.uiShowFont.Multiline = true; - this.uiShowFont.Name = "uiShowFont"; - this.uiShowFont.Size = new System.Drawing.Size(243, 72); - this.uiShowFont.TabIndex = 82; - this.uiShowFont.TabStop = false; - // // uiAreaSmall // this.uiAreaSmall.AutoSize = true; @@ -203,7 +210,7 @@ private void InitializeComponent() this.uiAreaSmall.Location = new System.Drawing.Point(29, 36); this.uiAreaSmall.Name = "uiAreaSmall"; this.uiAreaSmall.Size = new System.Drawing.Size(79, 29); - this.uiAreaSmall.TabIndex = 61; + this.uiAreaSmall.TabIndex = 81; this.uiAreaSmall.TabStop = true; this.uiAreaSmall.Text = "Small"; this.uiAreaSmall.UseVisualStyleBackColor = true; @@ -215,7 +222,7 @@ private void InitializeComponent() this.uiAreaMedium.Location = new System.Drawing.Point(29, 68); this.uiAreaMedium.Name = "uiAreaMedium"; this.uiAreaMedium.Size = new System.Drawing.Size(103, 29); - this.uiAreaMedium.TabIndex = 62; + this.uiAreaMedium.TabIndex = 82; this.uiAreaMedium.Text = "Medium"; this.uiAreaMedium.UseVisualStyleBackColor = true; this.uiAreaMedium.CheckedChanged += new System.EventHandler(this.uiAreaMedium_CheckedChanged); @@ -226,7 +233,7 @@ private void InitializeComponent() this.uiAreaLarge.Location = new System.Drawing.Point(29, 100); this.uiAreaLarge.Name = "uiAreaLarge"; this.uiAreaLarge.Size = new System.Drawing.Size(80, 29); - this.uiAreaLarge.TabIndex = 63; + this.uiAreaLarge.TabIndex = 83; this.uiAreaLarge.Text = "Large"; this.uiAreaLarge.UseVisualStyleBackColor = true; this.uiAreaLarge.CheckedChanged += new System.EventHandler(this.uiAreaLarge_CheckedChanged); @@ -235,9 +242,9 @@ private void InitializeComponent() // this.groupBox1.Controls.Add(this.uiCheckUpdates); this.groupBox1.Controls.Add(this.uiStartWithWindows); - this.groupBox1.Location = new System.Drawing.Point(18, 23); + this.groupBox1.Location = new System.Drawing.Point(22, 23); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(530, 107); + this.groupBox1.Size = new System.Drawing.Size(521, 107); this.groupBox1.TabIndex = 10; this.groupBox1.TabStop = false; this.groupBox1.Text = "Startup"; @@ -257,27 +264,56 @@ private void InitializeComponent() // // groupBox2 // + this.groupBox2.Controls.Add(this.uiRestoreOriginal); + this.groupBox2.Controls.Add(this.uiCopyImages); this.groupBox2.Controls.Add(this.uiPasteOnSelection); this.groupBox2.Controls.Add(this.uiCloseMinimize); this.groupBox2.Controls.Add(this.uiTrimWhitespaces); this.groupBox2.Controls.Add(this.uiAppEnabled); this.groupBox2.Controls.Add(this.uiHistoryEnabled); - this.groupBox2.Location = new System.Drawing.Point(18, 150); + this.groupBox2.Location = new System.Drawing.Point(22, 150); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(530, 200); + this.groupBox2.Size = new System.Drawing.Size(521, 262); this.groupBox2.TabIndex = 20; this.groupBox2.TabStop = false; this.groupBox2.Text = "Behaviour"; // + // uiRestoreOriginal + // + this.uiRestoreOriginal.AutoSize = true; + this.uiRestoreOriginal.Checked = true; + this.uiRestoreOriginal.CheckState = System.Windows.Forms.CheckState.Checked; + this.uiRestoreOriginal.Location = new System.Drawing.Point(29, 95); + this.uiRestoreOriginal.Name = "uiRestoreOriginal"; + this.uiRestoreOriginal.Size = new System.Drawing.Size(492, 29); + this.uiRestoreOriginal.TabIndex = 23; + this.uiRestoreOriginal.Text = "Restore original formatting when disabling application"; + this.uiRestoreOriginal.UseVisualStyleBackColor = true; + this.uiRestoreOriginal.CheckedChanged += new System.EventHandler(this.uiRestoreOriginal_CheckedChanged); + // + // uiCopyImages + // + this.uiCopyImages.AutoSize = true; + this.uiCopyImages.Checked = true; + this.uiCopyImages.CheckState = System.Windows.Forms.CheckState.Checked; + this.uiCopyImages.ForeColor = System.Drawing.SystemColors.ControlText; + this.uiCopyImages.Location = new System.Drawing.Point(29, 159); + this.uiCopyImages.Name = "uiCopyImages"; + this.uiCopyImages.Size = new System.Drawing.Size(226, 29); + this.uiCopyImages.TabIndex = 25; + this.uiCopyImages.Text = "Copy images to history"; + this.uiCopyImages.UseVisualStyleBackColor = true; + this.uiCopyImages.CheckedChanged += new System.EventHandler(this.uiCopyImages_CheckedChanged); + // // uiPasteOnSelection // this.uiPasteOnSelection.AutoSize = true; this.uiPasteOnSelection.Checked = true; this.uiPasteOnSelection.CheckState = System.Windows.Forms.CheckState.Checked; - this.uiPasteOnSelection.Location = new System.Drawing.Point(29, 127); + this.uiPasteOnSelection.Location = new System.Drawing.Point(29, 191); this.uiPasteOnSelection.Name = "uiPasteOnSelection"; this.uiPasteOnSelection.Size = new System.Drawing.Size(247, 29); - this.uiPasteOnSelection.TabIndex = 24; + this.uiPasteOnSelection.TabIndex = 26; this.uiPasteOnSelection.Text = "Paste on history selection"; this.trayIcon.SetToolTip(this.uiPasteOnSelection, "If checked then the application will minimize to tray when the Close button is cl" + "icked.\r\nIf not checked then the application will exit and terminate."); @@ -304,10 +340,10 @@ private void InitializeComponent() this.uiTrimWhitespaces.AutoSize = true; this.uiTrimWhitespaces.Checked = true; this.uiTrimWhitespaces.CheckState = System.Windows.Forms.CheckState.Checked; - this.uiTrimWhitespaces.Location = new System.Drawing.Point(29, 159); + this.uiTrimWhitespaces.Location = new System.Drawing.Point(29, 223); this.uiTrimWhitespaces.Name = "uiTrimWhitespaces"; this.uiTrimWhitespaces.Size = new System.Drawing.Size(177, 29); - this.uiTrimWhitespaces.TabIndex = 25; + this.uiTrimWhitespaces.TabIndex = 27; this.uiTrimWhitespaces.Text = "Trim whitespaces"; this.uiTrimWhitespaces.UseVisualStyleBackColor = true; this.uiTrimWhitespaces.CheckedChanged += new System.EventHandler(this.uiTrimWhitespaces_CheckedChanged); @@ -317,50 +353,13 @@ private void InitializeComponent() this.groupBox3.Controls.Add(this.uiAreaLarge); this.groupBox3.Controls.Add(this.uiAreaSmall); this.groupBox3.Controls.Add(this.uiAreaMedium); - this.groupBox3.Location = new System.Drawing.Point(18, 23); + this.groupBox3.Location = new System.Drawing.Point(323, 23); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(231, 170); - this.groupBox3.TabIndex = 60; + this.groupBox3.Size = new System.Drawing.Size(220, 148); + this.groupBox3.TabIndex = 80; this.groupBox3.TabStop = false; this.groupBox3.Text = "History area"; // - // groupBox4 - // - this.groupBox4.Controls.Add(this.uiChangeFont); - this.groupBox4.Controls.Add(this.uiShowFont); - this.groupBox4.Location = new System.Drawing.Point(268, 23); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(281, 170); - this.groupBox4.TabIndex = 80; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "History font"; - // - // groupBox6 - // - this.groupBox6.Controls.Add(this.uiHistoryColorSelector); - this.groupBox6.Location = new System.Drawing.Point(18, 212); - this.groupBox6.Name = "groupBox6"; - this.groupBox6.Size = new System.Drawing.Size(231, 82); - this.groupBox6.TabIndex = 70; - this.groupBox6.TabStop = false; - this.groupBox6.Text = "History color theme"; - // - // uiHistoryColorSelector - // - this.uiHistoryColorSelector.FormattingEnabled = true; - this.uiHistoryColorSelector.Items.AddRange(new object[] { - "Blue", - "Brown", - "Green", - "White", - "Yellow"}); - this.uiHistoryColorSelector.Location = new System.Drawing.Point(17, 36); - this.uiHistoryColorSelector.Name = "uiHistoryColorSelector"; - this.uiHistoryColorSelector.Size = new System.Drawing.Size(197, 33); - this.uiHistoryColorSelector.Sorted = true; - this.uiHistoryColorSelector.TabIndex = 71; - this.uiHistoryColorSelector.SelectedIndexChanged += new System.EventHandler(this.uiHistoryColorSelector_SelectedIndexChanged); - // // appVer // this.appVer.AutoSize = true; @@ -378,11 +377,12 @@ private void InitializeComponent() this.tabControl.Controls.Add(this.tabPage1); this.tabControl.Controls.Add(this.tabPage5); this.tabControl.Controls.Add(this.tabPage2); + this.tabControl.Controls.Add(this.tabPage3); this.tabControl.Controls.Add(this.tabPage4); this.tabControl.Location = new System.Drawing.Point(12, 12); this.tabControl.Name = "tabControl"; this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(573, 441); + this.tabControl.Size = new System.Drawing.Size(573, 469); this.tabControl.TabIndex = 0; // // tabPage1 @@ -393,7 +393,7 @@ private void InitializeComponent() this.tabPage1.Location = new System.Drawing.Point(4, 34); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(565, 403); + this.tabPage1.Size = new System.Drawing.Size(565, 431); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "General"; // @@ -405,7 +405,7 @@ private void InitializeComponent() this.tabPage5.Location = new System.Drawing.Point(4, 34); this.tabPage5.Name = "tabPage5"; this.tabPage5.Padding = new System.Windows.Forms.Padding(3); - this.tabPage5.Size = new System.Drawing.Size(565, 403); + this.tabPage5.Size = new System.Drawing.Size(565, 431); this.tabPage5.TabIndex = 4; this.tabPage5.Text = "Hotkeys"; // @@ -413,9 +413,9 @@ private void InitializeComponent() // this.groupBox7.Controls.Add(this.uiHotkeyBehaviourSystem); this.groupBox7.Controls.Add(this.uiHotkeyBehaviourPaste); - this.groupBox7.Location = new System.Drawing.Point(19, 23); + this.groupBox7.Location = new System.Drawing.Point(22, 23); this.groupBox7.Name = "groupBox7"; - this.groupBox7.Size = new System.Drawing.Size(530, 107); + this.groupBox7.Size = new System.Drawing.Size(521, 107); this.groupBox7.TabIndex = 40; this.groupBox7.TabStop = false; this.groupBox7.Text = "Hotkey behaviour"; @@ -441,6 +441,7 @@ private void InitializeComponent() this.uiHotkeyBehaviourPaste.Name = "uiHotkeyBehaviourPaste"; this.uiHotkeyBehaviourPaste.Size = new System.Drawing.Size(216, 29); this.uiHotkeyBehaviourPaste.TabIndex = 42; + this.uiHotkeyBehaviourPaste.TabStop = true; this.uiHotkeyBehaviourPaste.Text = "Action only on hotkey"; this.uiHotkeyBehaviourPaste.UseVisualStyleBackColor = true; this.uiHotkeyBehaviourPaste.CheckedChanged += new System.EventHandler(this.uiHotkeyBehaviourPaste_CheckedChanged); @@ -457,9 +458,9 @@ private void InitializeComponent() this.groupBox5.Controls.Add(this.label6); this.groupBox5.Controls.Add(this.label7); this.groupBox5.Controls.Add(this.label8); - this.groupBox5.Location = new System.Drawing.Point(19, 150); + this.groupBox5.Location = new System.Drawing.Point(22, 150); this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(530, 233); + this.groupBox5.Size = new System.Drawing.Size(521, 263); this.groupBox5.TabIndex = 50; this.groupBox5.TabStop = false; this.groupBox5.Text = "Hotkeys"; @@ -546,7 +547,7 @@ private void InitializeComponent() this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(144, 25); - this.label4.TabIndex = 48; + this.label4.TabIndex = 1003; this.label4.Text = "Paste on hotkey"; // // label6 @@ -557,7 +558,7 @@ private void InitializeComponent() this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(155, 25); - this.label6.TabIndex = 43; + this.label6.TabIndex = 1001; this.label6.Text = "Show older entry"; // // label7 @@ -568,7 +569,7 @@ private void InitializeComponent() this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(163, 25); - this.label7.TabIndex = 44; + this.label7.TabIndex = 1002; this.label7.Text = "Show newer entry"; // // label8 @@ -579,48 +580,349 @@ private void InitializeComponent() this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(224, 25); - this.label8.TabIndex = 45; + this.label8.TabIndex = 1000; this.label8.Text = "Toggle application on/off"; // // tabPage2 // this.tabPage2.BackColor = System.Drawing.Color.WhiteSmoke; - this.tabPage2.Controls.Add(this.groupBox8); - this.tabPage2.Controls.Add(this.groupBox3); - this.tabPage2.Controls.Add(this.groupBox4); this.tabPage2.Controls.Add(this.groupBox6); + this.tabPage2.Controls.Add(this.groupBox10); + this.tabPage2.Controls.Add(this.groupBox3); this.tabPage2.Location = new System.Drawing.Point(4, 34); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(565, 403); + this.tabPage2.Size = new System.Drawing.Size(565, 431); this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "Apperance"; + this.tabPage2.Text = "Layout"; + // + // groupBox6 + // + this.groupBox6.Controls.Add(this.uiElement10); + this.groupBox6.Controls.Add(this.uiElement9); + this.groupBox6.Controls.Add(this.uiElement8); + this.groupBox6.Controls.Add(this.uiElement7); + this.groupBox6.Controls.Add(this.uiElement6); + this.groupBox6.Controls.Add(this.uiElement5); + this.groupBox6.Controls.Add(this.uiElement4); + this.groupBox6.Controls.Add(this.uiElement3); + this.groupBox6.Controls.Add(this.uiElement1); + this.groupBox6.Controls.Add(this.uiElement2); + this.groupBox6.Location = new System.Drawing.Point(22, 23); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(281, 389); + this.groupBox6.TabIndex = 60; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "History elements"; + // + // uiElement10 + // + this.uiElement10.AutoSize = true; + this.uiElement10.Location = new System.Drawing.Point(29, 324); + this.uiElement10.Name = "uiElement10"; + this.uiElement10.Size = new System.Drawing.Size(53, 29); + this.uiElement10.TabIndex = 70; + this.uiElement10.Text = "10"; + this.uiElement10.UseVisualStyleBackColor = true; + this.uiElement10.CheckedChanged += new System.EventHandler(this.uiElement10_CheckedChanged); + // + // uiElement9 + // + this.uiElement9.AutoSize = true; + this.uiElement9.Location = new System.Drawing.Point(29, 292); + this.uiElement9.Name = "uiElement9"; + this.uiElement9.Size = new System.Drawing.Size(43, 29); + this.uiElement9.TabIndex = 69; + this.uiElement9.Text = "9"; + this.uiElement9.UseVisualStyleBackColor = true; + this.uiElement9.CheckedChanged += new System.EventHandler(this.uiElement9_CheckedChanged); + // + // uiElement8 + // + this.uiElement8.AutoSize = true; + this.uiElement8.Location = new System.Drawing.Point(28, 260); + this.uiElement8.Name = "uiElement8"; + this.uiElement8.Size = new System.Drawing.Size(43, 29); + this.uiElement8.TabIndex = 68; + this.uiElement8.Text = "8"; + this.uiElement8.UseVisualStyleBackColor = true; + this.uiElement8.CheckedChanged += new System.EventHandler(this.uiElement8_CheckedChanged); + // + // uiElement7 + // + this.uiElement7.AutoSize = true; + this.uiElement7.Location = new System.Drawing.Point(29, 228); + this.uiElement7.Name = "uiElement7"; + this.uiElement7.Size = new System.Drawing.Size(43, 29); + this.uiElement7.TabIndex = 67; + this.uiElement7.Text = "7"; + this.uiElement7.UseVisualStyleBackColor = true; + this.uiElement7.CheckedChanged += new System.EventHandler(this.uiElement7_CheckedChanged); + // + // uiElement6 + // + this.uiElement6.AutoSize = true; + this.uiElement6.Location = new System.Drawing.Point(29, 196); + this.uiElement6.Name = "uiElement6"; + this.uiElement6.Size = new System.Drawing.Size(43, 29); + this.uiElement6.TabIndex = 66; + this.uiElement6.Text = "6"; + this.uiElement6.UseVisualStyleBackColor = true; + this.uiElement6.CheckedChanged += new System.EventHandler(this.uiElement6_CheckedChanged); + // + // uiElement5 + // + this.uiElement5.AutoSize = true; + this.uiElement5.Location = new System.Drawing.Point(28, 164); + this.uiElement5.Name = "uiElement5"; + this.uiElement5.Size = new System.Drawing.Size(43, 29); + this.uiElement5.TabIndex = 65; + this.uiElement5.Text = "5"; + this.uiElement5.UseVisualStyleBackColor = true; + this.uiElement5.CheckedChanged += new System.EventHandler(this.uiElement5_CheckedChanged); + // + // uiElement4 + // + this.uiElement4.AutoSize = true; + this.uiElement4.Location = new System.Drawing.Point(29, 132); + this.uiElement4.Name = "uiElement4"; + this.uiElement4.Size = new System.Drawing.Size(43, 29); + this.uiElement4.TabIndex = 64; + this.uiElement4.Text = "4"; + this.uiElement4.UseVisualStyleBackColor = true; + this.uiElement4.CheckedChanged += new System.EventHandler(this.uiElement4_CheckedChanged); + // + // uiElement3 + // + this.uiElement3.AutoSize = true; + this.uiElement3.Location = new System.Drawing.Point(29, 100); + this.uiElement3.Name = "uiElement3"; + this.uiElement3.Size = new System.Drawing.Size(43, 29); + this.uiElement3.TabIndex = 63; + this.uiElement3.Text = "3"; + this.uiElement3.UseVisualStyleBackColor = true; + this.uiElement3.CheckedChanged += new System.EventHandler(this.uiElement3_CheckedChanged); + // + // uiElement1 + // + this.uiElement1.AutoSize = true; + this.uiElement1.Checked = true; + this.uiElement1.Location = new System.Drawing.Point(29, 36); + this.uiElement1.Name = "uiElement1"; + this.uiElement1.Size = new System.Drawing.Size(43, 29); + this.uiElement1.TabIndex = 61; + this.uiElement1.TabStop = true; + this.uiElement1.Text = "1"; + this.uiElement1.UseVisualStyleBackColor = true; + this.uiElement1.CheckedChanged += new System.EventHandler(this.uiElement1_CheckedChanged); + // + // uiElement2 + // + this.uiElement2.AutoSize = true; + this.uiElement2.Location = new System.Drawing.Point(29, 68); + this.uiElement2.Name = "uiElement2"; + this.uiElement2.Size = new System.Drawing.Size(43, 29); + this.uiElement2.TabIndex = 62; + this.uiElement2.Text = "2"; + this.uiElement2.UseVisualStyleBackColor = true; + this.uiElement2.CheckedChanged += new System.EventHandler(this.uiElement2_CheckedChanged); + // + // groupBox10 + // + this.groupBox10.Controls.Add(this.uiHistoryLocationRightBottom); + this.groupBox10.Controls.Add(this.uiHistoryLocationRightTop); + this.groupBox10.Controls.Add(this.uiHistoryLocationCenter); + this.groupBox10.Controls.Add(this.uiHistoryLocationLeftTop); + this.groupBox10.Controls.Add(this.uiHistoryLocationLeftBottom); + this.groupBox10.Location = new System.Drawing.Point(335, 191); + this.groupBox10.Name = "groupBox10"; + this.groupBox10.Size = new System.Drawing.Size(208, 221); + this.groupBox10.TabIndex = 90; + this.groupBox10.TabStop = false; + this.groupBox10.Text = "History location"; + // + // uiHistoryLocationRightBottom + // + this.uiHistoryLocationRightBottom.AutoSize = true; + this.uiHistoryLocationRightBottom.Location = new System.Drawing.Point(28, 164); + this.uiHistoryLocationRightBottom.Name = "uiHistoryLocationRightBottom"; + this.uiHistoryLocationRightBottom.Size = new System.Drawing.Size(143, 29); + this.uiHistoryLocationRightBottom.TabIndex = 95; + this.uiHistoryLocationRightBottom.Text = "Right Bottom"; + this.uiHistoryLocationRightBottom.UseVisualStyleBackColor = true; + this.uiHistoryLocationRightBottom.CheckedChanged += new System.EventHandler(this.historyLocationRightBottom_CheckedChanged); + // + // uiHistoryLocationRightTop + // + this.uiHistoryLocationRightTop.AutoSize = true; + this.uiHistoryLocationRightTop.Location = new System.Drawing.Point(29, 132); + this.uiHistoryLocationRightTop.Name = "uiHistoryLocationRightTop"; + this.uiHistoryLocationRightTop.Size = new System.Drawing.Size(112, 29); + this.uiHistoryLocationRightTop.TabIndex = 94; + this.uiHistoryLocationRightTop.Text = "Right Top"; + this.uiHistoryLocationRightTop.UseVisualStyleBackColor = true; + this.uiHistoryLocationRightTop.CheckedChanged += new System.EventHandler(this.historyLocationRightTop_CheckedChanged); + // + // uiHistoryLocationCenter + // + this.uiHistoryLocationCenter.AutoSize = true; + this.uiHistoryLocationCenter.Location = new System.Drawing.Point(29, 100); + this.uiHistoryLocationCenter.Name = "uiHistoryLocationCenter"; + this.uiHistoryLocationCenter.Size = new System.Drawing.Size(89, 29); + this.uiHistoryLocationCenter.TabIndex = 93; + this.uiHistoryLocationCenter.Text = "Center"; + this.uiHistoryLocationCenter.UseVisualStyleBackColor = true; + this.uiHistoryLocationCenter.CheckedChanged += new System.EventHandler(this.historyLocationCenter_CheckedChanged); + // + // uiHistoryLocationLeftTop + // + this.uiHistoryLocationLeftTop.AutoSize = true; + this.uiHistoryLocationLeftTop.Checked = true; + this.uiHistoryLocationLeftTop.Location = new System.Drawing.Point(29, 36); + this.uiHistoryLocationLeftTop.Name = "uiHistoryLocationLeftTop"; + this.uiHistoryLocationLeftTop.Size = new System.Drawing.Size(99, 29); + this.uiHistoryLocationLeftTop.TabIndex = 91; + this.uiHistoryLocationLeftTop.TabStop = true; + this.uiHistoryLocationLeftTop.Text = "Left Top"; + this.uiHistoryLocationLeftTop.UseVisualStyleBackColor = true; + this.uiHistoryLocationLeftTop.CheckedChanged += new System.EventHandler(this.historyLocationLeftTop_CheckedChanged); + // + // uiHistoryLocationLeftBottom + // + this.uiHistoryLocationLeftBottom.AutoSize = true; + this.uiHistoryLocationLeftBottom.Location = new System.Drawing.Point(29, 68); + this.uiHistoryLocationLeftBottom.Name = "uiHistoryLocationLeftBottom"; + this.uiHistoryLocationLeftBottom.Size = new System.Drawing.Size(130, 29); + this.uiHistoryLocationLeftBottom.TabIndex = 92; + this.uiHistoryLocationLeftBottom.Text = "Left Bottom"; + this.uiHistoryLocationLeftBottom.UseVisualStyleBackColor = true; + this.uiHistoryLocationLeftBottom.CheckedChanged += new System.EventHandler(this.historyLocationLeftBottom_CheckedChanged); + // + // tabPage3 + // + this.tabPage3.BackColor = System.Drawing.Color.WhiteSmoke; + this.tabPage3.Controls.Add(this.groupBox8); + this.tabPage3.Controls.Add(this.groupBox4); + this.tabPage3.Location = new System.Drawing.Point(4, 34); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Padding = new System.Windows.Forms.Padding(3); + this.tabPage3.Size = new System.Drawing.Size(565, 431); + this.tabPage3.TabIndex = 5; + this.tabPage3.Text = "Style"; // // groupBox8 // - this.groupBox8.Controls.Add(this.uiHistoryLocation); - this.groupBox8.Location = new System.Drawing.Point(268, 212); + this.groupBox8.Controls.Add(this.uiHistoryColorYellow); + this.groupBox8.Controls.Add(this.uiHistoryColorWhite); + this.groupBox8.Controls.Add(this.uiHistoryColorGreen); + this.groupBox8.Controls.Add(this.uiHistoryColorBlue); + this.groupBox8.Controls.Add(this.uiHistoryColorBrown); + this.groupBox8.Location = new System.Drawing.Point(323, 23); this.groupBox8.Name = "groupBox8"; - this.groupBox8.Size = new System.Drawing.Size(281, 82); - this.groupBox8.TabIndex = 72; + this.groupBox8.Size = new System.Drawing.Size(220, 390); + this.groupBox8.TabIndex = 110; this.groupBox8.TabStop = false; - this.groupBox8.Text = "History location"; - // - // uiHistoryLocation - // - this.uiHistoryLocation.FormattingEnabled = true; - this.uiHistoryLocation.Items.AddRange(new object[] { - "Bottom Left", - "Bottom Right", - "Center", - "Top Left", - "Top Right"}); - this.uiHistoryLocation.Location = new System.Drawing.Point(17, 36); - this.uiHistoryLocation.Name = "uiHistoryLocation"; - this.uiHistoryLocation.Size = new System.Drawing.Size(242, 33); - this.uiHistoryLocation.Sorted = true; - this.uiHistoryLocation.TabIndex = 71; - this.uiHistoryLocation.SelectedIndexChanged += new System.EventHandler(this.uiHistoryLocation_SelectedIndexChanged); + this.groupBox8.Text = "History color"; + // + // uiHistoryColorYellow + // + this.uiHistoryColorYellow.AutoSize = true; + this.uiHistoryColorYellow.Location = new System.Drawing.Point(28, 164); + this.uiHistoryColorYellow.Name = "uiHistoryColorYellow"; + this.uiHistoryColorYellow.Size = new System.Drawing.Size(87, 29); + this.uiHistoryColorYellow.TabIndex = 115; + this.uiHistoryColorYellow.Text = "Yellow"; + this.uiHistoryColorYellow.UseVisualStyleBackColor = true; + this.uiHistoryColorYellow.CheckedChanged += new System.EventHandler(this.uiHistoryColorYellow_CheckedChanged); + // + // uiHistoryColorWhite + // + this.uiHistoryColorWhite.AutoSize = true; + this.uiHistoryColorWhite.Location = new System.Drawing.Point(29, 132); + this.uiHistoryColorWhite.Name = "uiHistoryColorWhite"; + this.uiHistoryColorWhite.Size = new System.Drawing.Size(83, 29); + this.uiHistoryColorWhite.TabIndex = 114; + this.uiHistoryColorWhite.Text = "White"; + this.uiHistoryColorWhite.UseVisualStyleBackColor = true; + this.uiHistoryColorWhite.CheckedChanged += new System.EventHandler(this.uiHistoryColorWhite_CheckedChanged); + // + // uiHistoryColorGreen + // + this.uiHistoryColorGreen.AutoSize = true; + this.uiHistoryColorGreen.Location = new System.Drawing.Point(29, 100); + this.uiHistoryColorGreen.Name = "uiHistoryColorGreen"; + this.uiHistoryColorGreen.Size = new System.Drawing.Size(84, 29); + this.uiHistoryColorGreen.TabIndex = 113; + this.uiHistoryColorGreen.Text = "Green"; + this.uiHistoryColorGreen.UseVisualStyleBackColor = true; + this.uiHistoryColorGreen.CheckedChanged += new System.EventHandler(this.uiHistoryColorGreen_CheckedChanged); + // + // uiHistoryColorBlue + // + this.uiHistoryColorBlue.AutoSize = true; + this.uiHistoryColorBlue.Checked = true; + this.uiHistoryColorBlue.Location = new System.Drawing.Point(29, 36); + this.uiHistoryColorBlue.Name = "uiHistoryColorBlue"; + this.uiHistoryColorBlue.Size = new System.Drawing.Size(70, 29); + this.uiHistoryColorBlue.TabIndex = 111; + this.uiHistoryColorBlue.TabStop = true; + this.uiHistoryColorBlue.Text = "Blue"; + this.uiHistoryColorBlue.UseVisualStyleBackColor = true; + this.uiHistoryColorBlue.CheckedChanged += new System.EventHandler(this.uiHistoryColorBlue_CheckedChanged); + // + // uiHistoryColorBrown + // + this.uiHistoryColorBrown.AutoSize = true; + this.uiHistoryColorBrown.Location = new System.Drawing.Point(29, 68); + this.uiHistoryColorBrown.Name = "uiHistoryColorBrown"; + this.uiHistoryColorBrown.Size = new System.Drawing.Size(87, 29); + this.uiHistoryColorBrown.TabIndex = 112; + this.uiHistoryColorBrown.Text = "Brown"; + this.uiHistoryColorBrown.UseVisualStyleBackColor = true; + this.uiHistoryColorBrown.CheckedChanged += new System.EventHandler(this.uiHistoryColorBrown_CheckedChanged); + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.uiShowFontTop); + this.groupBox4.Controls.Add(this.uiChangeFont); + this.groupBox4.Controls.Add(this.uiShowFontBottom); + this.groupBox4.Location = new System.Drawing.Point(22, 23); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(281, 390); + this.groupBox4.TabIndex = 100; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "History font"; + // + // uiShowFontTop + // + this.uiShowFontTop.Location = new System.Drawing.Point(16, 85); + this.uiShowFontTop.Multiline = true; + this.uiShowFontTop.Name = "uiShowFontTop"; + this.uiShowFontTop.ReadOnly = true; + this.uiShowFontTop.Size = new System.Drawing.Size(243, 30); + this.uiShowFontTop.TabIndex = 83; + this.uiShowFontTop.TabStop = false; + this.uiShowFontTop.Text = "1 of 150 from \"wordpad\""; + // + // uiChangeFont + // + this.uiChangeFont.Location = new System.Drawing.Point(16, 36); + this.uiChangeFont.Name = "uiChangeFont"; + this.uiChangeFont.Size = new System.Drawing.Size(129, 34); + this.uiChangeFont.TabIndex = 101; + this.uiChangeFont.Text = "Change font"; + this.uiChangeFont.UseVisualStyleBackColor = true; + this.uiChangeFont.Click += new System.EventHandler(this.uiChangeFont_Click); + // + // uiShowFontBottom + // + this.uiShowFontBottom.Location = new System.Drawing.Point(16, 121); + this.uiShowFontBottom.Multiline = true; + this.uiShowFontBottom.Name = "uiShowFontBottom"; + this.uiShowFontBottom.ReadOnly = true; + this.uiShowFontBottom.Size = new System.Drawing.Size(243, 112); + this.uiShowFontBottom.TabIndex = 82; + this.uiShowFontBottom.TabStop = false; // // tabPage4 // @@ -630,7 +932,7 @@ private void InitializeComponent() this.tabPage4.Controls.Add(this.appVer); this.tabPage4.Location = new System.Drawing.Point(4, 34); this.tabPage4.Name = "tabPage4"; - this.tabPage4.Size = new System.Drawing.Size(565, 403); + this.tabPage4.Size = new System.Drawing.Size(565, 431); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "About"; // @@ -643,6 +945,7 @@ private void InitializeComponent() this.aboutBox.ReadOnly = true; this.aboutBox.Size = new System.Drawing.Size(510, 264); this.aboutBox.TabIndex = 91; + this.aboutBox.TabStop = false; this.aboutBox.Text = "#"; this.aboutBox.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.aboutBox_LinkClicked); // @@ -658,7 +961,7 @@ private void InitializeComponent() // // uiHelp // - this.uiHelp.Location = new System.Drawing.Point(167, 461); + this.uiHelp.Location = new System.Drawing.Point(167, 496); this.uiHelp.Name = "uiHelp"; this.uiHelp.Size = new System.Drawing.Size(262, 38); this.uiHelp.TabIndex = 30; @@ -680,7 +983,7 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 25F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(596, 507); + this.ClientSize = new System.Drawing.Size(596, 550); this.Controls.Add(this.uiHelp); this.Controls.Add(this.tabControl); this.Font = new System.Drawing.Font("Segoe UI", 11.12727F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -690,7 +993,7 @@ private void InitializeComponent() this.MaximizeBox = false; this.Name = "Settings"; this.Text = "HovText"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWindow_FormClosing_1); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWindow_FormClosing); this.Shown += new System.EventHandler(this.MainWindow_Shown); this.Resize += new System.EventHandler(this.MainWindow_Resize); this.notifyIconMenuStrip.ResumeLayout(false); @@ -700,9 +1003,6 @@ private void InitializeComponent() this.groupBox2.PerformLayout(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); - this.groupBox6.ResumeLayout(false); this.tabControl.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.tabPage5.ResumeLayout(false); @@ -711,7 +1011,15 @@ private void InitializeComponent() this.groupBox5.ResumeLayout(false); this.groupBox5.PerformLayout(); this.tabPage2.ResumeLayout(false); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); + this.groupBox10.ResumeLayout(false); + this.groupBox10.PerformLayout(); + this.tabPage3.ResumeLayout(false); this.groupBox8.ResumeLayout(false); + this.groupBox8.PerformLayout(); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); this.tabPage4.ResumeLayout(false); this.tabPage4.PerformLayout(); this.ResumeLayout(false); @@ -724,18 +1032,13 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox uiHistoryEnabled; private System.Windows.Forms.CheckBox uiStartWithWindows; private System.Windows.Forms.FontDialog fontDialog; - private System.Windows.Forms.Button uiChangeFont; - private System.Windows.Forms.TextBox uiShowFont; private System.Windows.Forms.RadioButton uiAreaSmall; private System.Windows.Forms.RadioButton uiAreaMedium; private System.Windows.Forms.RadioButton uiAreaLarge; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.GroupBox groupBox4; - private System.Windows.Forms.GroupBox groupBox6; private System.Windows.Forms.CheckBox uiTrimWhitespaces; - private System.Windows.Forms.ComboBox uiHistoryColorSelector; private System.Windows.Forms.Label appVer; private System.Windows.Forms.TabControl tabControl; private System.Windows.Forms.TabPage tabPage1; @@ -768,9 +1071,37 @@ private void InitializeComponent() private System.Windows.Forms.TextBox uiHotkeyNewer; private System.Windows.Forms.TextBox uiHotkeyOlder; private System.Windows.Forms.Timer mouseClickTimer; - private System.Windows.Forms.GroupBox groupBox8; - private System.Windows.Forms.ComboBox uiHistoryLocation; private System.Windows.Forms.RichTextBox aboutBox; + private System.Windows.Forms.CheckBox uiRestoreOriginal; + private System.Windows.Forms.GroupBox groupBox10; + private System.Windows.Forms.RadioButton uiHistoryLocationRightBottom; + private System.Windows.Forms.RadioButton uiHistoryLocationRightTop; + private System.Windows.Forms.RadioButton uiHistoryLocationCenter; + private System.Windows.Forms.RadioButton uiHistoryLocationLeftTop; + private System.Windows.Forms.RadioButton uiHistoryLocationLeftBottom; + private System.Windows.Forms.GroupBox groupBox6; + private System.Windows.Forms.RadioButton uiElement10; + private System.Windows.Forms.RadioButton uiElement9; + private System.Windows.Forms.RadioButton uiElement8; + private System.Windows.Forms.RadioButton uiElement7; + private System.Windows.Forms.RadioButton uiElement6; + private System.Windows.Forms.RadioButton uiElement5; + private System.Windows.Forms.RadioButton uiElement4; + private System.Windows.Forms.RadioButton uiElement3; + private System.Windows.Forms.RadioButton uiElement1; + private System.Windows.Forms.RadioButton uiElement2; + private System.Windows.Forms.TabPage tabPage3; + private System.Windows.Forms.GroupBox groupBox8; + private System.Windows.Forms.RadioButton uiHistoryColorYellow; + private System.Windows.Forms.RadioButton uiHistoryColorWhite; + private System.Windows.Forms.RadioButton uiHistoryColorGreen; + private System.Windows.Forms.RadioButton uiHistoryColorBlue; + private System.Windows.Forms.RadioButton uiHistoryColorBrown; + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.Button uiChangeFont; + private System.Windows.Forms.TextBox uiShowFontBottom; + private System.Windows.Forms.TextBox uiShowFontTop; + private System.Windows.Forms.CheckBox uiCopyImages; } } \ No newline at end of file diff --git a/HovText/Settings.cs b/HovText/Settings.cs index 80e59cc..9086c84 100644 --- a/HovText/Settings.cs +++ b/HovText/Settings.cs @@ -34,16 +34,16 @@ public partial class Settings : Form private static bool isFirstCallAfterHotkey = true; // History - public static string historyFontFamily = "Sergoe UI"; - public static float historyFontSize = 11; - private static int historyWidthSmall = 350; - private static int historyHeightSmall = 150; - private static int historyWidthMedium = 500; - private static int historyHeightMedium = 250; - private static int historyWidthLarge = 750; - private static int historyHeightLarge = 375; - public static int historyWidth = historyWidthMedium; // default - public static int historyHeight = historyHeightMedium; // default + public static string historyFontFamily = "Sergoe UI"; // default + public static float historyFontSize = 11; // default + public static int historyListElements = 1; // default + public static string historySize = "Medium"; // default + public static int historyListWidthSmall = 350; + public static int historyListWidthMedium = 500; + public static int historyListWidthLarge = 650; + public static int[] historyBoxHeightSmall = new int[] { 157, 87, 65, 48, 28, 28, 28, 28, 28, 28 }; + public static int[] historyBoxHeightMedium = new int[] { 250, 152, 83, 65, 48, 48, 48, 48, 48, 48 }; + public static int[] historyBoxHeightLarge = new int[] { 320, 170, 120, 100, 84, 84, 84, 84, 84, 84 }; private static string historyColorTopBlue = "#dae1e7"; private static string historyColorBottomBlue = "#f5faff"; private static string historyColorTopBrown = "#dac1a0"; @@ -56,56 +56,62 @@ public partial class Settings : Form private static string historyColorBottomYellow = "#ffffe1"; public static string historyColorTop = "#eee8aa"; // default public static string historyColorBottom = "#ffffe1"; // default - public static string historyLocation = "Bottom Right"; // default + public static string historyLocation = "Right Bottom"; // default // Registry public string registryPath = "SOFTWARE\\HovText"; - private string registryCheckUpdates = "1"; // default - private string registryCloseMinimizes = "1"; // default - private string registryEnableHistory = "1"; // default - private string registryPasteOnSelection = "0"; // default - private string registryTrimWhitespaces = "1"; // default + private string registryCheckUpdates = "1"; // default, 1 = check for updates + private string registryCloseMinimizes = "1"; // default, 1 = minimize to tray + private string registryRestoreOriginal = "1"; // default, 1 = restore original + private string registryCopyImages = "1"; // default, 1 = copy images to history + private string registryEnableHistory = "1"; // default, 1 = enable history + private string registryPasteOnSelection = "0"; // default, 0 = do not paste selected entry when selected + private string registryTrimWhitespaces = "1"; // default, 1 = trim whitespaces private string registryHistoryColor = "Yellow"; // default private string registryHistorySize = "Medium"; // default - private string registryHistoryLocation = historyLocation; // UI elements - public static bool isEnabledHistory = true; - public static bool isEnabledPasteOnSelection = true; - public static bool isEnabledTrimWhitespacing = true; - public static bool isCloseMinimizes = true; - public static bool isClosedFromNotifyIcon = false; - public static bool isHistoryHotkeyPressed = false; + public static bool isEnabledHistory; + public static bool isEnabledPasteOnSelection; + public static bool isEnabledTrimWhitespacing; + public static bool isRestoreOriginal; + public static bool isCopyImages; + public static bool isCloseMinimizes; + public static bool isClosedFromNotifyIcon; + public static bool isHistoryHotkeyPressed; // Clipboard - int entryIndex = -1; - int entryCounter = -1; - bool isClipboardText = false; - bool isClipboardImage = false; + public static int entryIndex = -1; + public static int entryCounter = -1; + bool isClipboardText; + bool isClipboardImage; string clipboardText = ""; string clipboardTextLast = ""; Image clipboardImage = null; string clipboardImageHashLast = ""; - IDataObject clipboardObject = null; - SortedDictionary entriesApplication = new SortedDictionary(); - SortedDictionary entriesText = new SortedDictionary(); - SortedDictionary entriesImage = new SortedDictionary(); + IDataObject clipboardObject; + public static SortedDictionary entriesApplication = new SortedDictionary(); + public static SortedDictionary entriesText = new SortedDictionary(); + public static SortedDictionary entriesImage = new SortedDictionary(); + SortedList> entriesOriginal = new SortedList>(); const int WM_CLIPBOARDUPDATE = 0x031D; + string whoUpdatedClipboardName = ""; // Misc + public static bool isSettingsFormVisible = false; public static string hovtextPage = "https://hovtext.com/"; public static string appDate = ""; internal static Settings settings; - History history = new History(); + HistoryList historyList = new HistoryList(); Update update = new Update(); HotkeyConflict hotkeyConflict = new HotkeyConflict(); - // ########################################################################################### - // Main - // ########################################################################################### + // ########################################################################################### + // Main + // ########################################################################################### - public Settings() + public Settings() { // Refering to the current form - used in the history form settings = this; @@ -162,6 +168,9 @@ public Settings() sb.Append(@" Kind regards from Jesper and Dennis "); sb.Append(@"}"); aboutBox.Rtf = sb.ToString(); + + // Set the initial text on the tray icon + UpdateNotifyIconText(); } @@ -176,13 +185,21 @@ protected override void WndProc(ref Message m) { case WM_CLIPBOARDUPDATE: - // Temporary debug to figure out which application has updated the clipboard - but it does not work as intended - /* + // Get the application name which updated the clipboard uint thisProcessId = 0; - Program.GetWindowThreadProcessId(m.HWnd, out thisProcessId); - string thisProcessName = Process.GetProcessById((int)thisProcessId).ProcessName; - Console.WriteLine("Clipboard change event detected from [" + thisProcessName + "]"); - */ + IntPtr whoUpdatedClipboardHwnd = Program.GetClipboardOwner(); + Program.GetWindowThreadProcessId(whoUpdatedClipboardHwnd, out thisProcessId); + whoUpdatedClipboardName = Process.GetProcessById((int)thisProcessId).ProcessName; + Console.WriteLine("Clipboard UPDATE event from [" + whoUpdatedClipboardName + "]"); + + // I am not sure why some(?) applications are returned as "Idle" when coming from clipboard - in this case the get the active application and use that name instead + // This could potentially be a problem, if a process is correctly called "Idle" but not sure if this is realistic? + if (whoUpdatedClipboardName.ToLower() == "idle") + { + string activeProcessName = GetActiveApplication(); + whoUpdatedClipboardName = activeProcessName; + Console.WriteLine("Finding process name the secondary way, [" + activeProcessName + "]"); + } // Check if application is enabled if (uiAppEnabled.Checked) @@ -211,20 +228,25 @@ private void ProcessClipboard() clipboardText = isClipboardText ? Clipboard.GetText() : ""; clipboardImage = isClipboardImage ? Clipboard.GetImage() : null; clipboardObject = Clipboard.GetDataObject(); - int clipboardFormatsCount = clipboardObject.GetFormats(false).Count(); // count number of formats in clipboard - bool isClipboardUnicodeOnly = false; - if (clipboardFormatsCount > 0) - { - string clipboardFormat0 = clipboardObject.GetFormats(false)[0]; - isClipboardUnicodeOnly = clipboardFormatsCount == 1 && clipboardFormat0 == "UnicodeText" ? true : false; // if this is true then I will bet(?) that this is text-only and if so then no more processing required - } // Is clipboard text - also triggers when copying whitespaces only if (isClipboardText) { - // Check if number of data formats equals 1 and this is unicode or if clipboard is different than last time - if (!isClipboardUnicodeOnly || clipboardText != clipboardTextLast) + // Check if there are any formatted text entries in the clipboard + bool isFormatted = false; + foreach (var format in clipboardObject.GetFormats(false)) { + // If the format is anything but "Text" then we can break and deem this as formatted + if (format.ToUpper() != "TEXT") + { + isFormatted = true; + break; + } + } + + // Check if number of data formats equals 1 and this is unicode or if clipboard is different than last time + if (clipboardText != clipboardTextLast || isFormatted) + { // Trim the text if (isEnabledTrimWhitespacing) { @@ -241,33 +263,29 @@ private void ProcessClipboard() GetEntryCounter(); SetClipboard(false, "WM_CLIPBOARDUPDATE:TEXT"); } - else - { - if (clipboardFormatsCount > 0) - { - Clipboard.Clear(); - } - } } } else if (isClipboardImage) // Is clipboard an image { - - // Get hash value of picture in clipboard - ImageConverter converter = new ImageConverter(); - byte[] byteArray = (byte[])converter.ConvertTo(clipboardImage, typeof(byte[])); - string clipboardImageHash = Convert.ToBase64String(byteArray); - - if (clipboardImageHash != clipboardImageHashLast) + // Only proceed if we should copy the images also + if (isCopyImages) { - // Set the last clipboard image to be identical to this one - clipboardImageHashLast = clipboardImageHash; + // Get hash value of picture in clipboard + ImageConverter converter = new ImageConverter(); + byte[] byteArray = (byte[])converter.ConvertTo(clipboardImage, typeof(byte[])); + string clipboardImageHash = Convert.ToBase64String(byteArray); - // Add the image to the entries array and update the clipboard - AddEntry(); - GetEntryCounter(); - SetClipboard(false, "WM_CLIPBOARDUPDATE:IMAGE"); + if (clipboardImageHash != clipboardImageHashLast) + { + // Set the last clipboard image to be identical to this one + clipboardImageHashLast = clipboardImageHash; + + // Add the image to the entries array and update the clipboard + AddEntry(); + GetEntryCounter(); + SetClipboard(false, "WM_CLIPBOARDUPDATE:IMAGE"); + } } } else @@ -277,8 +295,7 @@ private void ProcessClipboard() if (Clipboard.GetText() == "") { // If active application is EXCEL then restore last entry, as EXCEL clears clipboard when - string activeAppName = GetActiveApplication(); - if (entriesText.Count() > 0 && activeAppName == "EXCEL") + if (entriesText.Count() > 0 && whoUpdatedClipboardName.ToUpper() == "EXCEL") { // Restore the last entry to the clipboard SetClipboard(false, "WM_CLIPBOARDUPDATE:EMPTY-TEXT-2"); @@ -342,7 +359,6 @@ private bool IsClipboardContentAlreadyInDataArrays() private void AddEntry() { - if (isEnabledHistory) { bool isAlreadyInDataArray = IsClipboardContentAlreadyInDataArrays(); @@ -356,33 +372,35 @@ private void AddEntry() entriesText.Add(entryIndex, clipboardText); entriesImage.Add(entryIndex, clipboardImage); - // Walk through all clipboard object formats and store them - /* - var formats = clipboardObject.GetFormats(false); - var dictionary = new SortedDictionary(); - foreach (var format in formats) - { - if ( - // !format.Contains("EnhancedMetafile") - format.Contains("Object Descriptor") || - format.Contains("Embed Source") || - format.Contains("Text") || - format.Contains("HTML") || - format.Contains("Csv") || - format.Contains("Link") || - format.Contains("Hyperlink") || - format.Contains("Bitmap") - ) - { - dictionary.Add(format, clipboardObject.GetData(format)); - } - } - */ - - // Add the process name for the active application to the entries array - string activeAppName = GetActiveApplication(); - entriesApplication.Add(entryIndex, activeAppName); + // Walk through all (relevant) clipboard object formats and store them + var formats = clipboardObject.GetFormats(false); + Dictionary clipboardObjects = new Dictionary(); + foreach (var format in formats) + { + if ( + format.Contains("Text") || + format.Contains("HTML") || + format.Contains("Csv") || + format.Contains("Link") || + format.Contains("Hyperlink") || + format.Contains("Bitmap") + ) + { + clipboardObjects.Add(format, clipboardObject.GetData(format)); + } + } + entriesOriginal.Add(entryIndex, clipboardObjects); + + // Add the process name that has updated the clipboard + if (whoUpdatedClipboardName.Length == 0) + { + whoUpdatedClipboardName = "(unknown)"; + } + entriesApplication.Add(entryIndex, whoUpdatedClipboardName); } + + // Update the entries on the tray icon + UpdateNotifyIconText(); } } @@ -393,7 +411,6 @@ private void AddEntry() private void SetClipboard(bool original, string from) { - string entryText = clipboardText; Image entryImage = clipboardImage; bool isEntryText = isClipboardText; @@ -415,12 +432,11 @@ private void SetClipboard(bool original, string from) { try { - Clipboard.Clear(); - Clipboard.SetText(entryText); + Clipboard.SetText(entryText, TextDataFormat.Text); } catch (Exception ex) { - MessageBox.Show("EXCEPTION 1 [" + ex.ToString() + "]"); + MessageBox.Show("EXCEPTION 1 - please report to developer: [" + ex.ToString() + "]"); } } else @@ -428,49 +444,16 @@ private void SetClipboard(bool original, string from) { try { - Clipboard.Clear(); Clipboard.SetImage(entryImage); } catch (Exception ex) { - MessageBox.Show("EXCEPTION 2 [" + ex.ToString() + "]"); + MessageBox.Show("EXCEPTION 2 - please report to developer: [" + ex.ToString() + "]"); } } else { - MessageBox.Show("EXCEPTION 3"); - } - } - - - // ########################################################################################### - // Update "History" form - // ########################################################################################### - - private void UpdateUiHistory() - { - - string entryText = entriesText[entryIndex]; - Image entryImage = entriesImage[entryIndex]; - string entryApplication = entriesApplication[entryIndex]; - - bool isEntryText = entryText == "" ? false : true; - bool isEntryImage = entryImage == null ? false : true; - - // Show text in form 2 - if (isEntryText) - { - history.ShowText(entryCounter + " of " + entriesText.Count + " from \"" + entryApplication + "\"", entryText); - } - else - if (isEntryImage) // Show the image in form 2 - { - history.ShowImage(entryCounter + " of " + entriesText.Count + " from \"" + entryApplication + "\"", entryImage); - } - else - { - MessageBox.Show("EXCEPTION 4"); - + MessageBox.Show("EXCEPTION 3 - please report to developer"); } } @@ -481,16 +464,22 @@ private void UpdateUiHistory() public void GoEntryLowerNumber() { - // Check if application is enabled if (uiAppEnabled.Checked && entryCounter > 0) { if(isFirstCallAfterHotkey) { + // Hide the "Settings" form if it is visible (it will be restored after key-up) + isSettingsFormVisible = this.Visible; + if(isSettingsFormVisible) + { + Hide(); + } GetActiveApplication(); - ChangeFocusToThisApplication(); } + // Always change focus to HovText to ensure we can catch the key-up event + ChangeFocusToThisApplication(); // Only proceed if the entry counter is equal to or more than 0 if (entryCounter > 0) @@ -502,18 +491,11 @@ public void GoEntryLowerNumber() var element = entriesText.ElementAt(entryCounter - 2); entryIndex = element.Key; } - else - { - if (!isFirstCallAfterHotkey) - { - history.Flash(100); - } - } isFirstCallAfterHotkey = false; - // Update the UI + // Show history UI GetEntryCounter(); - UpdateUiHistory(); + historyList.UpdateHistoryList("down"); } } } @@ -525,16 +507,22 @@ public void GoEntryLowerNumber() public void GoEntryHigherNumber() { - // Check if application is enabled if (uiAppEnabled.Checked && entryCounter > 0) { if(isFirstCallAfterHotkey) { + // Hide the "Settings" form if it is visible (it will be restored after key-up) + isSettingsFormVisible = this.Visible; + if (isSettingsFormVisible) + { + Hide(); + } GetActiveApplication(); - ChangeFocusToThisApplication(); } + // Always change focus to HovText to ensure we can catch the key-up event + ChangeFocusToThisApplication(); // Only proceed if the entry counter is less than the total amount of entries if (entryCounter <= entriesText.Count) @@ -546,25 +534,18 @@ public void GoEntryHigherNumber() var element = entriesText.ElementAt(entryCounter); entryIndex = element.Key; } - else - { - if (!isFirstCallAfterHotkey) - { - history.Flash(100); - } - } isFirstCallAfterHotkey = false; - // Update the UI + // Show history UI GetEntryCounter(); - UpdateUiHistory(); + historyList.UpdateHistoryList("up"); } } } // ########################################################################################### - // Called when ENTER or ESCAPE has been pressed in the "History" form + // Called when a history entry has been selected in the "HistoryList" form // ########################################################################################### public void SelectHistoryEntry() @@ -582,15 +563,13 @@ public void SelectHistoryEntry() // Set focus back to the originating application ChangeFocusToOriginatingApplication(); - // SendKeys.Send("^v"); - // Reset some stuff isFirstCallAfterHotkey = true; entryIndex = entriesText.Keys.Last(); GetEntryCounter(); - // Update UI - history.Hide(); + // Hide history UI + historyList.Hide(); } } @@ -620,7 +599,6 @@ private void GetEntryCounter() private void MoveEntryToTop() { - clipboardTextLast = entriesText[entryIndex]; int lastKey = entriesText.Keys.Last(); @@ -630,12 +608,15 @@ private void MoveEntryToTop() entriesText.Add(insertKey, entriesText[entryIndex]); entriesImage.Add(insertKey, entriesImage[entryIndex]); entriesApplication.Add(insertKey, entriesApplication[entryIndex]); + entriesOriginal.Add(insertKey, entriesOriginal[entryIndex]); // Remove the chosen entry, so it does not show duplicates entriesText.Remove(entryIndex); entriesImage.Remove(entryIndex); entriesApplication.Remove(entryIndex); + entriesOriginal.Remove(entryIndex); + // Set the index to be the last one entryIndex = entriesText.Keys.Last(); } @@ -655,12 +636,13 @@ public void ToggleEnabled() // Event that is triggede when application is toggled, either enabled or disabled // ########################################################################################### - private void uiAppEnabled_CheckedChanged_1(object sender, EventArgs e) + private void uiAppEnabled_CheckedChanged(object sender, EventArgs e) { - // Check if application is enabled if (uiAppEnabled.Checked) { + // Add this application to the clipboard chain again + Program.AddClipboardFormatListener(this.Handle); ProcessClipboard(); @@ -681,8 +663,10 @@ private void uiAppEnabled_CheckedChanged_1(object sender, EventArgs e) break; } - // Enable thw two checkboxes + // Enable other checkboxes uiHistoryEnabled.Enabled = true; + uiRestoreOriginal.Enabled = true; + uiCopyImages.Enabled = true; uiTrimWhitespaces.Enabled = true; uiPasteOnSelection.Enabled = true; uiHotkeyOlder.Enabled = true; @@ -690,12 +674,43 @@ private void uiAppEnabled_CheckedChanged_1(object sender, EventArgs e) } else { + // Remove this application from the clipboard chain + Program.RemoveClipboardFormatListener(this.Handle); + + // Restore the original clipboard format + if (isRestoreOriginal && entriesOriginal.Count() > 0) + { + try + { + // Clipboard.Clear(); + + // Snippet directly taken from legacy HovText - more or less the only thing? :-) + // --- + DataObject data = new DataObject(); + foreach (KeyValuePair kvp in entriesOriginal[entryIndex]) + { + if (kvp.Value != null) + { + data.SetData(kvp.Key, kvp.Value); + } + } + Clipboard.SetDataObject(data, true); + // --- + } + catch (Exception ex) + { + MessageBox.Show("EXCEPTION 5 - please report to developer: [" + ex.ToString() + "]"); + } + } + // Change the icons to be red (inactive) Icon = Resources.Inactive; notifyIcon.Icon = Resources.Inactive; - // Disable thw two checkboxes + // Disable other checkboxes uiHistoryEnabled.Enabled = false; + uiRestoreOriginal.Enabled = false; + uiCopyImages.Enabled = false; uiTrimWhitespaces.Enabled = false; uiPasteOnSelection.Enabled = false; uiHotkeyOlder.Enabled = false; @@ -713,6 +728,7 @@ private void MainWindow_Resize(object sender, EventArgs e) { if (WindowState == FormWindowState.Minimized) { + ShowTrayNotification(); Hide(); } } @@ -732,9 +748,9 @@ private void aboutBox_LinkClicked(object sender, LinkClickedEventArgs e) // Unregister from the clipboard chain when application is closing down // ########################################################################################### - private void MainWindow_FormClosing_1(object sender, FormClosingEventArgs e) + private void MainWindow_FormClosing(object sender, FormClosingEventArgs e) { - // In case windows is trying to shut down, don't hold the process up + // In case windows is trying to shut down, don't hold up the process if (e.CloseReason == CloseReason.WindowsShutDown) { Program.RemoveClipboardFormatListener(this.Handle); @@ -752,6 +768,7 @@ private void MainWindow_FormClosing_1(object sender, FormClosingEventArgs e) // Do not close as the X should minimize if (WindowState == FormWindowState.Normal) { + ShowTrayNotification(); Hide(); } e.Cancel = true; @@ -764,15 +781,14 @@ private void MainWindow_FormClosing_1(object sender, FormClosingEventArgs e) private string GetActiveApplication() { - if (isFirstCallAfterHotkey) - { - originatingHandle = Program.GetForegroundWindow(); - } + // Get the active application + originatingHandle = Program.GetForegroundWindow(); // Get the process ID and find the name for that ID uint processId = 0; Program.GetWindowThreadProcessId(originatingHandle, out processId); string appProcessName = Process.GetProcessById((int)processId).ProcessName; + Console.WriteLine("Active application is ["+ appProcessName +"]"); return appProcessName; } @@ -814,7 +830,7 @@ private void updateTimer_Tick(object sender, EventArgs e) if (checkedVersion.Substring(0,7) == "Version") { checkedVersion = checkedVersion.Substring(9); - update.uiAppVerF3.Text = appDate; + update.uiAppVerYours.Text = appDate; update.uiAppVerOnline.Text = checkedVersion; string lastCheckedVersion = GetRegistryKey(registryPath, "CheckedVersion"); if (lastCheckedVersion != checkedVersion && checkedVersion != appDate) @@ -825,6 +841,7 @@ private void updateTimer_Tick(object sender, EventArgs e) } catch (WebException ex) { + Console.WriteLine("No communication to HovText update checker page"); } } @@ -847,6 +864,11 @@ private void InitializeRegistry() // Check if all registry keys are set - if not the set default values using (RegistryKey registryPathExists = Registry.CurrentUser.OpenSubKey(registryPath, true)) { + // NotificationShown + if (registryPathExists.GetValue("NotificationShown") == null) + { + registryPathExists.SetValue("NotificationShown", "0"); + } // CheckedVersion if (registryPathExists.GetValue("CheckedVersion") == null) { @@ -862,6 +884,16 @@ private void InitializeRegistry() { registryPathExists.SetValue("CloseMinimizes", registryCloseMinimizes); } + // RestoreOriginal + if (registryPathExists.GetValue("RestoreOriginal") == null) + { + registryPathExists.SetValue("RestoreOriginal", registryRestoreOriginal); + } + // CopyImages + if (registryPathExists.GetValue("CopyImages") == null) + { + registryPathExists.SetValue("CopyImages", registryCopyImages); + } // EnablePasteOnSelection if (registryPathExists.GetValue("EnablePasteOnSelection") == null) { @@ -872,6 +904,11 @@ private void InitializeRegistry() { registryPathExists.SetValue("EnableTrimWhitespaces", registryTrimWhitespaces); } + // HistoryEntries + if (registryPathExists.GetValue("HistoryEntries") == null) + { + registryPathExists.SetValue("HistoryEntries", historyListElements.ToString()); + } // HistoryColor if (registryPathExists.GetValue("HistoryColor") == null) { @@ -947,7 +984,7 @@ private void InitializeRegistry() // HistoryLocation if (registryPathExists.GetValue("HistoryLocation") == null) { - registryPathExists.SetValue("HistoryLocation", registryHistoryLocation); + registryPathExists.SetValue("HistoryLocation", historyLocation); } // HistorySize if (registryPathExists.GetValue("HistorySize") == null) @@ -1071,6 +1108,16 @@ private void GetStartupSettings() updateTimer.Enabled = true; } + // Restore original when disabling application + int restoreOriginal = int.Parse((string)GetRegistryKey(registryPath, "RestoreOriginal")); + uiRestoreOriginal.Checked = restoreOriginal == 1 ? true : false; + isRestoreOriginal = uiRestoreOriginal.Checked; + + // Do not copy images + int copyImages = int.Parse((string)GetRegistryKey(registryPath, "CopyImages")); + uiCopyImages.Checked = copyImages == 1 ? true : false; + isCopyImages = uiCopyImages.Checked; + // Close minimizes application to tray int closeMinimizes = int.Parse((string)GetRegistryKey(registryPath, "CloseMinimizes")); uiCloseMinimize.Checked = closeMinimizes == 1 ? true : false; @@ -1148,40 +1195,109 @@ private void GetStartupSettings() // "Apperance" tab // ------------------------------------------ + // History entries + historyListElements = Int32.Parse(GetRegistryKey(registryPath, "HistoryEntries")); + switch (historyListElements) + { + case 2: + uiElement2.Checked = true; + break; + case 3: + uiElement3.Checked = true; + break; + case 4: + uiElement4.Checked = true; + break; + case 5: + uiElement5.Checked = true; + break; + case 6: + uiElement6.Checked = true; + break; + case 7: + uiElement7.Checked = true; + break; + case 8: + uiElement8.Checked = true; + break; + case 9: + uiElement9.Checked = true; + break; + case 10: + uiElement10.Checked = true; + break; + default: + uiElement1.Checked = true; + break; + } + HideHistoryBoxes(); + // History area - string historySize = GetRegistryKey(registryPath, "HistorySize"); - switch (historySize) + string historySizeRegistry = GetRegistryKey(registryPath, "HistorySize"); + switch (historySizeRegistry) { case "Small": uiAreaSmall.Checked = true; - historyWidth = historyWidthSmall; - historyHeight = historyHeightSmall; + historySize = "Small"; break; case "Large": uiAreaLarge.Checked = true; - historyWidth = historyWidthLarge; - historyHeight = historyHeightLarge; + historySize = "Large"; break; - default: + default: // Medium uiAreaMedium.Checked = true; - historyWidth = historyWidthMedium; - historyHeight = historyHeightMedium; + historySize = "Medium"; break; } // History color theme registryHistoryColor = GetRegistryKey(registryPath, "HistoryColor"); SetHistoryColors(registryHistoryColor); + switch (registryHistoryColor) + { + case "Blue": + uiHistoryColorBlue.Checked = true; + break; + case "Brown": + uiHistoryColorBrown.Checked = true; + break; + case "Green": + uiHistoryColorGreen.Checked = true; + break; + case "White": + uiHistoryColorWhite.Checked = true; + break; + default: // Yellow + uiHistoryColorYellow.Checked = true; + break; + } // History location historyLocation = GetRegistryKey(registryPath, "HistoryLocation"); - uiHistoryLocation.SelectedItem = historyLocation; + switch (historyLocation) + { + case "Left Top": + uiHistoryLocationLeftTop.Checked = true; + break; + case "Left Bottom": + uiHistoryLocationLeftBottom.Checked = true; + break; + case "Center": + uiHistoryLocationCenter.Checked = true; + break; + case "Right Top": + uiHistoryLocationRightTop.Checked = true; + break; + default: // Right Bottom + uiHistoryLocationRightBottom.Checked = true; + break; + } // History font historyFontFamily = GetRegistryKey(registryPath, "HistoryFontFamily"); historyFontSize = float.Parse((string)GetRegistryKey(registryPath, "HistoryFontSize")); - uiShowFont.Font = new Font(historyFontFamily, historyFontSize); - uiShowFont.Text = historyFontFamily + ", " + historyFontSize; + uiShowFontBottom.Font = new Font(historyFontFamily, historyFontSize); + uiShowFontBottom.Text = historyFontFamily + ", " + historyFontSize; } @@ -1210,7 +1326,7 @@ private void uiStartWithWindows_CheckedChanged(object sender, EventArgs e) private void uiChangeFont_Click(object sender, EventArgs e) { FontDialog fontDlg = new FontDialog(); - fontDlg.Font = uiShowFont.Font; // initialize the font dialouge with the font from "uiShowFont" + fontDlg.Font = uiShowFontBottom.Font; // initialize the font dialouge with the font from "uiShowFont" fontDlg.AllowVerticalFonts = false; fontDlg.FontMustExist = true; fontDlg.ShowColor = false; @@ -1221,36 +1337,122 @@ private void uiChangeFont_Click(object sender, EventArgs e) { historyFontSize = fontDlg.Font.Size; historyFontFamily = fontDlg.Font.Name; - uiShowFont.Text = historyFontFamily + ", " + historyFontSize; - uiShowFont.Font = new Font(historyFontFamily, historyFontSize); + uiShowFontBottom.Text = historyFontFamily + ", " + historyFontSize; + uiShowFontBottom.Font = new Font(historyFontFamily, historyFontSize); SetRegistryKey(registryPath, "HistoryFontFamily", historyFontFamily); SetRegistryKey(registryPath, "HistoryFontSize", historyFontSize.ToString()); } } + // ########################################################################################### + // Changes in the history elements + // ########################################################################################### + + private void uiElement1_CheckedChanged(object sender, EventArgs e) + { + historyListElements = 1; + SetRegistryKey(registryPath, "HistoryEntries", historyListElements.ToString()); + HideHistoryBoxes(); + } + + private void uiElement2_CheckedChanged(object sender, EventArgs e) + { + historyListElements = 2; + SetRegistryKey(registryPath, "HistoryEntries", historyListElements.ToString()); + HideHistoryBoxes(); + } + + private void uiElement3_CheckedChanged(object sender, EventArgs e) + { + historyListElements = 3; + SetRegistryKey(registryPath, "HistoryEntries", historyListElements.ToString()); + HideHistoryBoxes(); + } + + private void uiElement4_CheckedChanged(object sender, EventArgs e) + { + historyListElements = 4; + SetRegistryKey(registryPath, "HistoryEntries", historyListElements.ToString()); + HideHistoryBoxes(); + } + + private void uiElement5_CheckedChanged(object sender, EventArgs e) + { + historyListElements = 5; + SetRegistryKey(registryPath, "HistoryEntries", historyListElements.ToString()); + HideHistoryBoxes(); + } + + private void uiElement6_CheckedChanged(object sender, EventArgs e) + { + historyListElements = 6; + SetRegistryKey(registryPath, "HistoryEntries", historyListElements.ToString()); + HideHistoryBoxes(); + } + + private void uiElement7_CheckedChanged(object sender, EventArgs e) + { + historyListElements = 7; + SetRegistryKey(registryPath, "HistoryEntries", historyListElements.ToString()); + HideHistoryBoxes(); + } + + private void uiElement8_CheckedChanged(object sender, EventArgs e) + { + historyListElements = 8; + SetRegistryKey(registryPath, "HistoryEntries", historyListElements.ToString()); + HideHistoryBoxes(); + } + + private void uiElement9_CheckedChanged(object sender, EventArgs e) + { + historyListElements = 9; + SetRegistryKey(registryPath, "HistoryEntries", historyListElements.ToString()); + HideHistoryBoxes(); + } + + private void uiElement10_CheckedChanged(object sender, EventArgs e) + { + historyListElements = 10; + SetRegistryKey(registryPath, "HistoryEntries", historyListElements.ToString()); + HideHistoryBoxes(); + } + + private void HideHistoryBoxes() + { + historyList.HideBox(1); + historyList.HideBox(2); + historyList.HideBox(3); + historyList.HideBox(4); + historyList.HideBox(5); + historyList.HideBox(6); + historyList.HideBox(7); + historyList.HideBox(8); + historyList.HideBox(9); + historyList.HideBox(10); + } + + // ########################################################################################### // Changes in the history (area) size // ########################################################################################### private void uiAreaSmall_CheckedChanged(object sender, EventArgs e) { - historyWidth = historyWidthSmall; - historyHeight = historyHeightSmall; + historySize = "Small"; SetRegistryKey(registryPath, "HistorySize", "Small"); } private void uiAreaMedium_CheckedChanged(object sender, EventArgs e) { - historyWidth = historyWidthMedium; - historyHeight = historyHeightMedium; + historySize = "Medium"; SetRegistryKey(registryPath, "HistorySize", "Medium"); } private void uiAreaLarge_CheckedChanged(object sender, EventArgs e) { - historyWidth = historyWidthLarge; - historyHeight = historyHeightLarge; + historySize = "Large"; SetRegistryKey(registryPath, "HistorySize", "Large"); } @@ -1259,11 +1461,34 @@ private void uiAreaLarge_CheckedChanged(object sender, EventArgs e) // Change in the history location // ########################################################################################### - private void uiHistoryLocation_SelectedIndexChanged(object sender, EventArgs e) + private void historyLocationLeftTop_CheckedChanged(object sender, EventArgs e) + { + historyLocation = "Left Top"; + SetRegistryKey(registryPath, "HistoryLocation", historyLocation); + } + + private void historyLocationLeftBottom_CheckedChanged(object sender, EventArgs e) + { + historyLocation = "Left Bottom"; + SetRegistryKey(registryPath, "HistoryLocation", historyLocation); + } + + private void historyLocationCenter_CheckedChanged(object sender, EventArgs e) + { + historyLocation = "Center"; + SetRegistryKey(registryPath, "HistoryLocation", historyLocation); + } + + private void historyLocationRightTop_CheckedChanged(object sender, EventArgs e) + { + historyLocation = "Right Top"; + SetRegistryKey(registryPath, "HistoryLocation", historyLocation); + } + + private void historyLocationRightBottom_CheckedChanged(object sender, EventArgs e) { - registryHistoryLocation = (string)(uiHistoryLocation.SelectedItem); - SetRegistryKey(registryPath, "HistoryLocation", registryHistoryLocation); - historyLocation = registryHistoryLocation; + historyLocation = "Right Bottom"; + SetRegistryKey(registryPath, "HistoryLocation", historyLocation); } @@ -1271,11 +1496,39 @@ private void uiHistoryLocation_SelectedIndexChanged(object sender, EventArgs e) // Change in the history color // ########################################################################################### - private void uiHistoryColorSelector_SelectedIndexChanged(object sender, EventArgs e) + private void uiHistoryColorBlue_CheckedChanged(object sender, EventArgs e) { - registryHistoryColor = (string)(uiHistoryColorSelector.SelectedItem); + registryHistoryColor = "Blue"; + SetRegistryKey(registryPath, "HistoryColor", registryHistoryColor); + SetHistoryColors(registryHistoryColor); + } + + private void uiHistoryColorBrown_CheckedChanged(object sender, EventArgs e) + { + registryHistoryColor = "Brown"; + SetRegistryKey(registryPath, "HistoryColor", registryHistoryColor); SetHistoryColors(registryHistoryColor); + } + + private void uiHistoryColorGreen_CheckedChanged(object sender, EventArgs e) + { + registryHistoryColor = "Green"; SetRegistryKey(registryPath, "HistoryColor", registryHistoryColor); + SetHistoryColors(registryHistoryColor); + } + + private void uiHistoryColorWhite_CheckedChanged(object sender, EventArgs e) + { + registryHistoryColor = "White"; + SetRegistryKey(registryPath, "HistoryColor", registryHistoryColor); + SetHistoryColors(registryHistoryColor); + } + + private void uiHistoryColorYellow_CheckedChanged(object sender, EventArgs e) + { + registryHistoryColor = "Yellow"; + SetRegistryKey(registryPath, "HistoryColor", registryHistoryColor); + SetHistoryColors(registryHistoryColor); } @@ -1290,32 +1543,32 @@ private void SetHistoryColors(string historyColor) case "Blue": historyColorTop = historyColorTopBlue; historyColorBottom = historyColorBottomBlue; - uiShowFont.BackColor = ColorTranslator.FromHtml(historyColorBottomBlue); - uiHistoryColorSelector.SelectedItem = "Blue"; + uiShowFontTop.BackColor = ColorTranslator.FromHtml(historyColorTopBlue); + uiShowFontBottom.BackColor = ColorTranslator.FromHtml(historyColorBottomBlue); break; case "Brown": historyColorTop = historyColorTopBrown; historyColorBottom = historyColorBottomBrown; - uiShowFont.BackColor = ColorTranslator.FromHtml(historyColorBottomBrown); - uiHistoryColorSelector.SelectedItem = "Brown"; + uiShowFontTop.BackColor = ColorTranslator.FromHtml(historyColorTopBrown); + uiShowFontBottom.BackColor = ColorTranslator.FromHtml(historyColorBottomBrown); break; case "Green": historyColorTop = historyColorTopGreen; historyColorBottom = historyColorBottomGreen; - uiShowFont.BackColor = ColorTranslator.FromHtml(historyColorBottomGreen); - uiHistoryColorSelector.SelectedItem = "Green"; + uiShowFontTop.BackColor = ColorTranslator.FromHtml(historyColorTopGreen); + uiShowFontBottom.BackColor = ColorTranslator.FromHtml(historyColorBottomGreen); break; case "White": historyColorTop = historyColorTopWhite; historyColorBottom = historyColorBottomWhite; - uiShowFont.BackColor = ColorTranslator.FromHtml(historyColorBottomWhite); - uiHistoryColorSelector.SelectedItem = "White"; + uiShowFontTop.BackColor = ColorTranslator.FromHtml(historyColorTopWhite); + uiShowFontBottom.BackColor = ColorTranslator.FromHtml(historyColorBottomWhite); break; default: historyColorTop = historyColorTopYellow; historyColorBottom = historyColorBottomYellow; - uiShowFont.BackColor = ColorTranslator.FromHtml(historyColorBottomYellow); - uiHistoryColorSelector.SelectedItem = "Yellow"; + uiShowFontTop.BackColor = ColorTranslator.FromHtml(historyColorTopYellow); + uiShowFontBottom.BackColor = ColorTranslator.FromHtml(historyColorBottomYellow); break; } } @@ -1352,6 +1605,31 @@ private void uiCloseMinimize_CheckedChanged(object sender, EventArgs e) } + // ########################################################################################### + // Changes in "Restore original formatting when disabling application" + // ########################################################################################### + + private void uiRestoreOriginal_CheckedChanged(object sender, EventArgs e) + { + // History enabled + string status = uiRestoreOriginal.Checked ? "1" : "0"; + isRestoreOriginal = uiRestoreOriginal.Checked; + SetRegistryKey(registryPath, "RestoreOriginal", status); + } + + + // ########################################################################################### + // Changes in "Do not copy images" + // ########################################################################################### + + private void uiCopyImages_CheckedChanged(object sender, EventArgs e) + { + string status = uiCopyImages.Checked ? "1" : "0"; + isCopyImages = uiCopyImages.Checked; + SetRegistryKey(registryPath, "CopyImages", status); + } + + // ########################################################################################### // Changes in "Enable history" // ########################################################################################### @@ -1361,19 +1639,24 @@ private void uiHistoryEnabled_CheckedChanged(object sender, EventArgs e) // History enabled string status = uiHistoryEnabled.Checked ? "1" : "0"; isEnabledHistory = uiHistoryEnabled.Checked; - SetRegistryKey(registryPath, "EnableHistory", status); + SetRegistryKey(registryPath, "HistoryEnable", status); if (isEnabledHistory) { uiHotkeyOlder.Enabled = true; uiHotkeyNewer.Enabled = true; + uiCopyImages.Enabled = true; uiPasteOnSelection.Enabled = true; } else { uiHotkeyOlder.Enabled = false; uiHotkeyNewer.Enabled = false; + uiCopyImages.Enabled = false; uiPasteOnSelection.Enabled = false; } + + // Update the tray icon + UpdateNotifyIconText(); } @@ -1424,7 +1707,7 @@ private void MainWindow_Shown(object sender, EventArgs e) private void trayIconAbout_Click(object sender, EventArgs e) { ShowSettingsForm(); - tabControl.SelectedIndex = 3; // About + tabControl.SelectedIndex = 4; // About } @@ -1462,13 +1745,13 @@ private void notifyIcon_MouseClick(object sender, MouseEventArgs e) { // Give the double-click a chance to cancel this mouseClickTimer.Start(); - Console.WriteLine("Start mouse timer"); + Console.WriteLine("Start mouse double-click timer"); } } private void mouseClickTimer_Tick(object sender, EventArgs e) { - Console.WriteLine("Mouse single-click"); + Console.WriteLine("Mouse single-click detected"); mouseClickTimer.Stop(); ToggleEnabled(); } @@ -1480,13 +1763,12 @@ private void mouseClickTimer_Tick(object sender, EventArgs e) private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e) { - if (e.Button == MouseButtons.Left) { // Cancel the single-click mouseClickTimer.Stop(); - Console.WriteLine("Mouse double-click"); + Console.WriteLine("Mouse double-click detected"); ShowSettingsForm(); tabControl.SelectedIndex = 0; } @@ -1505,6 +1787,27 @@ private void ShowSettingsForm() } + // ########################################################################################### + // Changes in "One entry only" look-and-feel + // ########################################################################################### + + private void uiApperanceOne_CheckedChanged(object sender, EventArgs e) + { + SetRegistryKey(registryPath, "HistoryLook", "One entry only"); + } + + + // ########################################################################################### + // Changes in "List of entries" look-and-feel + // ########################################################################################### + + private void uiApperanceList_CheckedChanged(object sender, EventArgs e) + { + SetRegistryKey(registryPath, "HistoryLook", "List of entries"); + } + + + // ########################################################################################### // Changes in "Always action" hotkey behaviour // ########################################################################################### @@ -1519,6 +1822,7 @@ private void uiHotkeyBehaviourSystem_CheckedChanged(object sender, EventArgs e) // ########################################################################################### // Changes in "Action only on hotkey" hotkey behaviour // ########################################################################################### + private void uiHotkeyBehaviourPaste_CheckedChanged(object sender, EventArgs e) { uiHotkeyPaste.Enabled = true; @@ -1549,7 +1853,7 @@ private void uiHelp_Click(object sender, EventArgs e) private void HotkeyToggleApplication(object sender, NHotkey.HotkeyEventArgs e) { - Console.WriteLine("Enable/Disable hotkey"); + Console.WriteLine("Pressed the [Enable/Disable application] hotkey"); ToggleEnabled(); e.Handled = true; } @@ -1561,7 +1865,7 @@ private void HotkeyToggleApplication(object sender, NHotkey.HotkeyEventArgs e) private void HotkeyGetOlderEntry(object sender, NHotkey.HotkeyEventArgs e) { - Console.WriteLine("Get older entry hotkey"); + Console.WriteLine("Pressed the [Get older history entry] hotkey"); GoEntryLowerNumber(); isHistoryHotkeyPressed = true; e.Handled = true; @@ -1574,7 +1878,7 @@ private void HotkeyGetOlderEntry(object sender, NHotkey.HotkeyEventArgs e) private void HotkeyGetNewerEntry(object sender, NHotkey.HotkeyEventArgs e) { - Console.WriteLine("Get newer entry hotkey"); + Console.WriteLine("Pressed the [Get newer history entry] hotkey"); GoEntryHigherNumber(); isHistoryHotkeyPressed = true; e.Handled = true; @@ -1587,7 +1891,7 @@ private void HotkeyGetNewerEntry(object sender, NHotkey.HotkeyEventArgs e) private void HotkeyPasteOnHotkey(object sender, NHotkey.HotkeyEventArgs e) { - Console.WriteLine("Paste only on hotkey"); + Console.WriteLine("Pressed the [Paste only on hotkey] hotkey"); SelectHistoryEntry(); SendKeys.Send("^v"); e.Handled = true; @@ -1600,7 +1904,7 @@ private void HotkeyPasteOnHotkey(object sender, NHotkey.HotkeyEventArgs e) private string ConvertKeyboardInputToString(KeyEventArgs e) { - Console.WriteLine("[" + e.KeyData + "] [" + e.KeyCode + "] [" + e.Modifiers + "] [" + e.SuppressKeyPress + "]"); + Console.WriteLine("Set hotkey: [" + e.KeyData + "] [" + e.KeyCode + "] [" + e.Modifiers + "] [" + e.SuppressKeyPress + "]"); string hotkey = ""; @@ -1717,7 +2021,6 @@ private void hotkeyPaste_Enter(object sender, EventArgs e) private void ModifyHotkey(string hotkey) { - Console.WriteLine("Hotkey enter"); switch (hotkey) { case "hotkeyEnable": @@ -1762,7 +2065,6 @@ private void RemoveAllHotkeys() private void ApplyHotkeys_Click(object sender, EventArgs e) { - Console.WriteLine("Apply hotkeys"); SetHotkeys("Apply"); } @@ -1773,8 +2075,6 @@ private void ApplyHotkeys_Click(object sender, EventArgs e) private void SetHotkeys(string from) { - Console.WriteLine("Set hotkeys"); - // Get all hotkey strings string hotkey1 = uiHotkeyEnable.Text; string hotkey2 = uiHotkeyOlder.Text; @@ -1968,6 +2268,56 @@ private void cancelHotkey_Click(object sender, EventArgs e) } + // ########################################################################################### + // Show a notification if the user closes the application to tray for the very first time + // ########################################################################################### + + private void ShowTrayNotification() + { + // Show a tray notification if this is the first time the user close the form (without exiting the application) + int notificationShown = int.Parse((string)GetRegistryKey(registryPath, "NotificationShown")); + if (notificationShown == 0) + { + notifyIcon.Visible = true; + notifyIcon.ShowBalloonTip( + 10000, + "HovText is still running", + "HovText continues running in the background to perform its duties. You can see the icon in the tray area", + ToolTipIcon.Info + ); + + // Mark that we now have shown this + SetRegistryKey(registryPath, "NotificationShown", "1"); + } + } + + + // ########################################################################################### + // Update the entries on the tray icon (when hovering the mouse over it) + // ########################################################################################### + + private void UpdateNotifyIconText() + { + // Update the counter if the history is enabled + if (isEnabledHistory) + { + int entries = entriesText.Count(); + if (entries == 1) + { + notifyIcon.Text = "HovText (" + entries + " entry)"; + } + else + { + notifyIcon.Text = "HovText (" + entries + " entries)"; + } + } + else + { + notifyIcon.Text = "HovText"; + } + } + + // ########################################################################################### } } diff --git a/HovText/Settings.resx b/HovText/Settings.resx index 5deccd3..27eb39f 100644 --- a/HovText/Settings.resx +++ b/HovText/Settings.resx @@ -386,9 +386,6 @@ 156, 19 - - 156, 19 - 600, 18 diff --git a/HovText/Update.Designer.cs b/HovText/Update.Designer.cs index c4ed0c2..5c02766 100644 --- a/HovText/Update.Designer.cs +++ b/HovText/Update.Designer.cs @@ -34,7 +34,7 @@ private void InitializeComponent() this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); - this.uiAppVerF3 = new System.Windows.Forms.Label(); + this.uiAppVerYours = new System.Windows.Forms.Label(); this.uiAppVerOnline = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.SuspendLayout(); @@ -78,9 +78,9 @@ private void InitializeComponent() this.label2.Location = new System.Drawing.Point(43, 71); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(151, 32); + this.label2.Size = new System.Drawing.Size(152, 32); this.label2.TabIndex = 3; - this.label2.Text = "Your version:"; + this.label2.Text = "New version:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label3 @@ -90,28 +90,28 @@ private void InitializeComponent() this.label3.Location = new System.Drawing.Point(43, 105); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(152, 32); + this.label3.Size = new System.Drawing.Size(151, 32); this.label3.TabIndex = 4; - this.label3.Text = "New version:"; + this.label3.Text = "Your version:"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // uiAppVerF3 + // uiAppVerYours // - this.uiAppVerF3.AutoSize = true; - this.uiAppVerF3.Font = new System.Drawing.Font("Segoe UI", 13.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.uiAppVerF3.Location = new System.Drawing.Point(158, 71); - this.uiAppVerF3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.uiAppVerF3.Name = "uiAppVerF3"; - this.uiAppVerF3.Size = new System.Drawing.Size(29, 32); - this.uiAppVerF3.TabIndex = 5; - this.uiAppVerF3.Text = "#"; - this.uiAppVerF3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.uiAppVerYours.AutoSize = true; + this.uiAppVerYours.Font = new System.Drawing.Font("Segoe UI", 13.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.uiAppVerYours.Location = new System.Drawing.Point(158, 105); + this.uiAppVerYours.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.uiAppVerYours.Name = "uiAppVerYours"; + this.uiAppVerYours.Size = new System.Drawing.Size(29, 32); + this.uiAppVerYours.TabIndex = 5; + this.uiAppVerYours.Text = "#"; + this.uiAppVerYours.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiAppVerOnline // this.uiAppVerOnline.AutoSize = true; this.uiAppVerOnline.Font = new System.Drawing.Font("Segoe UI", 13.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.uiAppVerOnline.Location = new System.Drawing.Point(158, 105); + this.uiAppVerOnline.Location = new System.Drawing.Point(158, 71); this.uiAppVerOnline.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.uiAppVerOnline.Name = "uiAppVerOnline"; this.uiAppVerOnline.Size = new System.Drawing.Size(29, 32); @@ -138,7 +138,7 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(435, 301); this.Controls.Add(this.textBox1); this.Controls.Add(this.uiAppVerOnline); - this.Controls.Add(this.uiAppVerF3); + this.Controls.Add(this.uiAppVerYours); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.label1); @@ -164,7 +164,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; - public System.Windows.Forms.Label uiAppVerF3; + public System.Windows.Forms.Label uiAppVerYours; public System.Windows.Forms.Label uiAppVerOnline; private System.Windows.Forms.TextBox textBox1;