diff --git a/DisplayMagician/Properties/AssemblyInfo.cs b/DisplayMagician/Properties/AssemblyInfo.cs index 6180bcf..ac72ce8 100644 --- a/DisplayMagician/Properties/AssemblyInfo.cs +++ b/DisplayMagician/Properties/AssemblyInfo.cs @@ -26,8 +26,8 @@ using System.Resources; [assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")] // Version information -[assembly: AssemblyVersion("2.1.1.22")] -[assembly: AssemblyFileVersion("2.1.1.22")] +[assembly: AssemblyVersion("2.1.1.24")] +[assembly: AssemblyFileVersion("2.1.1.24")] [assembly: NeutralResourcesLanguageAttribute( "en" )] [assembly: CLSCompliant(true)] diff --git a/DisplayMagician/UIForms/ShortcutLibraryForm.Designer.cs b/DisplayMagician/UIForms/ShortcutLibraryForm.Designer.cs index a2bfe9a..c1a170b 100644 --- a/DisplayMagician/UIForms/ShortcutLibraryForm.Designer.cs +++ b/DisplayMagician/UIForms/ShortcutLibraryForm.Designer.cs @@ -51,6 +51,7 @@ this.btn_help = new System.Windows.Forms.Button(); this.btn_donate = new System.Windows.Forms.Button(); this.btn_copy = new System.Windows.Forms.Button(); + this.btn_cancel = new System.Windows.Forms.Button(); this.cms_shortcuts.SuspendLayout(); this.SuspendLayout(); // @@ -323,6 +324,25 @@ this.btn_copy.UseVisualStyleBackColor = false; this.btn_copy.Click += new System.EventHandler(this.btn_copy_Click); // + // btn_cancel + // + this.btn_cancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.btn_cancel.BackColor = System.Drawing.Color.Black; + this.btn_cancel.Enabled = false; + this.btn_cancel.FlatAppearance.MouseDownBackColor = System.Drawing.Color.IndianRed; + this.btn_cancel.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Brown; + this.btn_cancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btn_cancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btn_cancel.ForeColor = System.Drawing.Color.White; + this.btn_cancel.Location = new System.Drawing.Point(503, 488); + this.btn_cancel.Name = "btn_cancel"; + this.btn_cancel.Size = new System.Drawing.Size(120, 40); + this.btn_cancel.TabIndex = 37; + this.btn_cancel.Text = "&Cancel"; + this.btn_cancel.UseVisualStyleBackColor = false; + this.btn_cancel.Visible = false; + this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click); + // // ShortcutLibraryForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -330,6 +350,7 @@ this.BackColor = System.Drawing.Color.Black; this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); this.ClientSize = new System.Drawing.Size(1134, 716); + this.Controls.Add(this.btn_cancel); this.Controls.Add(this.btn_copy); this.Controls.Add(this.btn_donate); this.Controls.Add(this.btn_help); @@ -383,5 +404,6 @@ private System.Windows.Forms.Button btn_donate; private System.Windows.Forms.Button btn_copy; private System.Windows.Forms.ToolStripMenuItem tsmi_copy; + private System.Windows.Forms.Button btn_cancel; } } \ No newline at end of file diff --git a/DisplayMagician/UIForms/ShortcutLibraryForm.cs b/DisplayMagician/UIForms/ShortcutLibraryForm.cs index cc6ff9b..8b69152 100644 --- a/DisplayMagician/UIForms/ShortcutLibraryForm.cs +++ b/DisplayMagician/UIForms/ShortcutLibraryForm.cs @@ -453,6 +453,11 @@ namespace DisplayMagician.UIForms lbl_mask.BringToFront(); lbl_mask.Visible = true; + // Show the cancel button + btn_cancel.Visible = true; + btn_cancel.Enabled = true; + btn_cancel.BringToFront(); + ilv_saved_shortcuts.SuspendLayout(); ilv_saved_shortcuts.Refresh(); @@ -478,6 +483,11 @@ namespace DisplayMagician.UIForms lbl_mask.Visible = false; lbl_mask.SendToBack(); + // Hide the cancel button + btn_cancel.Visible = false; + btn_cancel.Enabled = false; + + // Also refresh the right-click menu (if we have a main form loaded) if (Program.AppMainForm is Form) { @@ -588,5 +598,10 @@ namespace DisplayMagician.UIForms } } + private void btn_cancel_Click(object sender, EventArgs e) + { + // Inform the ShortcutRepository that it needs to cancel the running shortcut. + ShortcutRepository.CancelWait = true; + } } }