From 1641d6c73f7bee39bb40dc121b70160d511bccc7 Mon Sep 17 00:00:00 2001 From: Michael Heyns Date: Mon, 10 Jun 2024 14:54:08 +1200 Subject: [PATCH] v1.3.4.4 --- HOWTO.txt | 2 +- README.md | 2 +- Terminal2/FrmHelp.resx | 6 +++++- Terminal2/FrmMacroOptions.Designer.cs | 30 ++++++++++++++++++++++----- Terminal2/FrmMacroOptions.cs | 23 +++++++++++++++++++- Terminal2/FrmMain.cs | 4 ++++ Terminal2/Properties/AssemblyInfo.cs | 4 ++-- 7 files changed, 60 insertions(+), 11 deletions(-) diff --git a/HOWTO.txt b/HOWTO.txt index a058279..351bded 100644 --- a/HOWTO.txt +++ b/HOWTO.txt @@ -12,4 +12,4 @@ 4. If all else fails, open the solution file in your Visual Studio IDE en build it manually Michael Heyns -2022-2424 +2022 diff --git a/README.md b/README.md index 2909923..d86354a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ![Letter-T-icon](https://user-images.githubusercontent.com/4144679/169688149-106da035-d4bd-4b1e-a290-c2a2885a9959.png) -# Terminal2 - v1.3.4.3 (June 2024) +# Terminal2 - v1.3.4.4 (June 2024) Windows 10/11 executable can be found here: https://github.com/michael-heyns/Terminal2_bin diff --git a/Terminal2/FrmHelp.resx b/Terminal2/FrmHelp.resx index 2eace74..cd37e7d 100644 --- a/Terminal2/FrmHelp.resx +++ b/Terminal2/FrmHelp.resx @@ -186,7 +186,11 @@ Source Code: ---- - v1.3.4.3 + v1.3.4.4 + * Pressing ESC when macro editor is open does not close the the dialog if changes were already made + * Added button to clear only the macros in a specific group + +v1.3.4.3 * Bug fix in 'Send as I type' v1.3.4.2 diff --git a/Terminal2/FrmMacroOptions.Designer.cs b/Terminal2/FrmMacroOptions.Designer.cs index d1f762a..91c5e70 100644 --- a/Terminal2/FrmMacroOptions.Designer.cs +++ b/Terminal2/FrmMacroOptions.Designer.cs @@ -85,6 +85,7 @@ private void InitializeComponent() this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this.btnHelp = new System.Windows.Forms.Button(); + this.btnClearGroup = new System.Windows.Forms.Button(); this.localHelp.SuspendLayout(); this.SuspendLayout(); // @@ -147,7 +148,7 @@ private void InitializeComponent() this.btnClear.ForeColor = System.Drawing.Color.Blue; this.btnClear.Location = new System.Drawing.Point(21, 426); this.btnClear.Name = "btnClear"; - this.btnClear.Size = new System.Drawing.Size(120, 23); + this.btnClear.Size = new System.Drawing.Size(130, 23); this.btnClear.TabIndex = 27; this.btnClear.Tag = "28"; this.btnClear.Text = "&Clear THIS macro"; @@ -162,9 +163,9 @@ private void InitializeComponent() this.btnApply.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnApply.ForeColor = System.Drawing.Color.Blue; - this.btnApply.Location = new System.Drawing.Point(482, 426); + this.btnApply.Location = new System.Drawing.Point(480, 426); this.btnApply.Name = "btnApply"; - this.btnApply.Size = new System.Drawing.Size(120, 23); + this.btnApply.Size = new System.Drawing.Size(130, 23); this.btnApply.TabIndex = 26; this.btnApply.Tag = "30"; this.btnApply.Text = "&Apply"; @@ -292,9 +293,9 @@ private void InitializeComponent() this.btnClearAll.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; this.btnClearAll.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnClearAll.ForeColor = System.Drawing.Color.Blue; - this.btnClearAll.Location = new System.Drawing.Point(244, 426); + this.btnClearAll.Location = new System.Drawing.Point(327, 426); this.btnClearAll.Name = "btnClearAll"; - this.btnClearAll.Size = new System.Drawing.Size(120, 23); + this.btnClearAll.Size = new System.Drawing.Size(130, 23); this.btnClearAll.TabIndex = 28; this.btnClearAll.Tag = "29"; this.btnClearAll.Text = "Clear &ALL macros"; @@ -472,11 +473,29 @@ private void InitializeComponent() this.btnHelp.UseVisualStyleBackColor = false; this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click); // + // btnClearGroup + // + this.btnClearGroup.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.btnClearGroup.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.btnClearGroup.FlatAppearance.BorderSize = 0; + this.btnClearGroup.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; + this.btnClearGroup.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnClearGroup.ForeColor = System.Drawing.Color.Blue; + this.btnClearGroup.Location = new System.Drawing.Point(174, 426); + this.btnClearGroup.Name = "btnClearGroup"; + this.btnClearGroup.Size = new System.Drawing.Size(130, 23); + this.btnClearGroup.TabIndex = 38; + this.btnClearGroup.Tag = "29"; + this.btnClearGroup.Text = "xxxxxx"; + this.btnClearGroup.UseVisualStyleBackColor = false; + this.btnClearGroup.Click += new System.EventHandler(this.btnClearGroup_Click); + // // FrmMacroOptions // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(639, 461); + this.Controls.Add(this.btnClearGroup); this.Controls.Add(this.localHelp); this.Controls.Add(this.btnHelp); this.Controls.Add(this.label14); @@ -553,5 +572,6 @@ private void InitializeComponent() private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Button btnHelp; + protected System.Windows.Forms.Button btnClearGroup; } } \ No newline at end of file diff --git a/Terminal2/FrmMacroOptions.cs b/Terminal2/FrmMacroOptions.cs index 79c1b84..bb71f5e 100644 --- a/Terminal2/FrmMacroOptions.cs +++ b/Terminal2/FrmMacroOptions.cs @@ -32,6 +32,8 @@ namespace Terminal public partial class FrmMacroOptions : Form { public bool Modified = false; + public char macroLabel = 'A'; + public int macroGroupStart = 0; private readonly Profile _activeProfile; private int _id; @@ -124,6 +126,7 @@ private void BtnClearAll_Click(object sender, EventArgs e) _activeProfile.macros[m] = null; ClearScreen(); SaveProfile(); + Close(); } } @@ -146,6 +149,7 @@ private void ClearScreen() private void FrmMacroOptions_Load(object sender, EventArgs e) { Modified = false; + btnClearGroup.Text = $"Clear group '{macroLabel}' macros"; } private void MacroText_TextChanged(object sender, EventArgs e) @@ -225,7 +229,7 @@ private void Common_TextChanged(object sender, EventArgs e) protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { - if (keyData == Keys.Escape) + if (keyData == Keys.Escape && !Modified) { this.Close(); return true; @@ -242,5 +246,22 @@ private void textBox3_Click(object sender, EventArgs e) { localHelp.Visible = false; } + + private void btnClearGroup_Click(object sender, EventArgs e) + { + DialogResult yn = MessageBox.Show($"Macros {macroGroupStart + 1} - {macroGroupStart + 48} for this profile will be cleared. Are you sure?", "Clear all macros", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (yn != DialogResult.Yes) + return; + + yn = MessageBox.Show("Are you really, really sure?", "Clear all macros", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (yn == DialogResult.Yes) + { + for (int m = macroGroupStart; m < macroGroupStart + 48; m++) + _activeProfile.macros[m] = null; + ClearScreen(); + SaveProfile(); + Close(); + } + } } } \ No newline at end of file diff --git a/Terminal2/FrmMain.cs b/Terminal2/FrmMain.cs index e4f1069..0985735 100644 --- a/Terminal2/FrmMain.cs +++ b/Terminal2/FrmMain.cs @@ -84,6 +84,7 @@ private enum State { Changing, Disconnected, Connected, Listening }; private bool _macroIsMoving = false; private int _macroBeingMoved; private int _macroOffset = 0; + private char _macroLabel = 'A'; private volatile bool _tickBusy = false; private static bool _terminateFlag = false; @@ -1174,6 +1175,8 @@ private void DgMacroTable_CellMouseDown(object sender, DataGridViewCellMouseEven FrmMacroOptions macros = new FrmMacroOptions(_activeProfile, m); TopMost = false; + macros.macroLabel = _macroLabel; + macros.macroGroupStart = _macroOffset; macros.ShowDialog(); if (macros.Modified) SaveThisProfile(); @@ -2448,6 +2451,7 @@ private void cbSendAsIType_CheckedChanged(object sender, EventArgs e) private void SetMacroOffset(int N) { + _macroLabel = (char)('A' + N); _macroOffset = N * 48; int labelNumber = (N * 12) + 1; for (int f = 1; f <= 12; f++) diff --git a/Terminal2/Properties/AssemblyInfo.cs b/Terminal2/Properties/AssemblyInfo.cs index e65df28..f86ec12 100644 --- a/Terminal2/Properties/AssemblyInfo.cs +++ b/Terminal2/Properties/AssemblyInfo.cs @@ -37,8 +37,8 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.4.3")] -[assembly: AssemblyFileVersion("1.3.4.3")] +[assembly: AssemblyVersion("1.3.4.4")] +[assembly: AssemblyFileVersion("1.3.4.4")] namespace Terminal {