diff --git a/README.md b/README.md index d86354a..a129a5f 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.4 (June 2024) +# Terminal2 - v1.3.5.2 (June 2024) Windows 10/11 executable can be found here: https://github.com/michael-heyns/Terminal2_bin diff --git a/Terminal2/Comms.cs b/Terminal2/Comms.cs index 6a3b566..9d4032b 100644 --- a/Terminal2/Comms.cs +++ b/Terminal2/Comms.cs @@ -1,7 +1,7 @@ /* * Terminal2 * - * Copyright © 2022-23-23 Michael Heyns + * Copyright © 2021-2024 Michael Heyns * * This file is part of Terminal2. * diff --git a/Terminal2/Database.cs b/Terminal2/Database.cs index 087c43f..bc1f01c 100644 --- a/Terminal2/Database.cs +++ b/Terminal2/Database.cs @@ -1,7 +1,7 @@ /* * Terminal2 * - * Copyright © 2022-23-23 Michael Heyns + * Copyright © 2021-2024 Michael Heyns * * This file is part of Terminal2. * @@ -446,9 +446,9 @@ public static bool SaveProfile(Profile profile, string filename) data += $"F{i}Text={profile.displayOptions.filter[i].text}\n"; data += $"F{i}Color={profile.displayOptions.filter[i].foreColor.ToArgb()}\n"; data += $"F{i}Back={profile.displayOptions.filter[i].backColor.ToArgb()}\n"; + data += $"F{i}Macro={profile.displayOptions.filter[i].macro}\n"; } } - data += $"\n"; data += "[Connect]\n"; @@ -682,6 +682,13 @@ public static Profile ReadProfile(string name) { profile.displayOptions.filter[i].backColor = Color.FromArgb(Utils.Int(line.Substring(key.Length))); } + + key = $"F{i}Macro="; + if (line.StartsWith(key)) + { + profile.displayOptions.filter[i].macro = line.Substring(key.Length); + } + } } } diff --git a/Terminal2/EventQueue.cs b/Terminal2/EventQueue.cs index d76f3d4..4b42ba2 100644 --- a/Terminal2/EventQueue.cs +++ b/Terminal2/EventQueue.cs @@ -1,7 +1,7 @@ /* * Terminal2 * - * Copyright © 2022-23-23 Michael Heyns + * Copyright © 2021-2024 Michael Heyns * * This file is part of Terminal2. * diff --git a/Terminal2/FrmConnectOptions.Designer.cs b/Terminal2/FrmConnectOptions.Designer.cs index c855ba8..5445559 100644 --- a/Terminal2/FrmConnectOptions.Designer.cs +++ b/Terminal2/FrmConnectOptions.Designer.cs @@ -1,7 +1,7 @@ /* * Terminal2 * - * Copyright © 2022-23-23 Michael Heyns + * Copyright © 2021-2024 Michael Heyns * * This file is part of Terminal2. * diff --git a/Terminal2/FrmConnectOptions.cs b/Terminal2/FrmConnectOptions.cs index 3cb375a..58348d4 100644 --- a/Terminal2/FrmConnectOptions.cs +++ b/Terminal2/FrmConnectOptions.cs @@ -1,7 +1,7 @@ /* * Terminal2 * - * Copyright © 2022-23-23 Michael Heyns + * Copyright © 2021-2024 Michael Heyns * * This file is part of Terminal2. * diff --git a/Terminal2/FrmDisplayOptions.Designer.cs b/Terminal2/FrmDisplayOptions.Designer.cs index 57929e0..e03b0f3 100644 --- a/Terminal2/FrmDisplayOptions.Designer.cs +++ b/Terminal2/FrmDisplayOptions.Designer.cs @@ -1,7 +1,7 @@ /* * Terminal2 * - * Copyright © 2022-23-23 Michael Heyns + * Copyright © 2021-2024 Michael Heyns * * This file is part of Terminal2. * @@ -59,6 +59,24 @@ private void InitializeComponent() this.btnOk = new System.Windows.Forms.Button(); this.btnSelectFontInput = new System.Windows.Forms.Button(); this.grpColourFilters = new System.Windows.Forms.GroupBox(); + this.btnClearTriggers = new System.Windows.Forms.Button(); + this.label8 = new System.Windows.Forms.Label(); + this.btnReset = new System.Windows.Forms.Button(); + this.label7 = new System.Windows.Forms.Label(); + this.btnClearMacros = new System.Windows.Forms.Button(); + this.mac11 = new System.Windows.Forms.ComboBox(); + this.mac10 = new System.Windows.Forms.ComboBox(); + this.mac9 = new System.Windows.Forms.ComboBox(); + this.mac8 = new System.Windows.Forms.ComboBox(); + this.mac7 = new System.Windows.Forms.ComboBox(); + this.mac6 = new System.Windows.Forms.ComboBox(); + this.mac5 = new System.Windows.Forms.ComboBox(); + this.mac4 = new System.Windows.Forms.ComboBox(); + this.mac3 = new System.Windows.Forms.ComboBox(); + this.mac2 = new System.Windows.Forms.ComboBox(); + this.label5 = new System.Windows.Forms.Label(); + this.mac1 = new System.Windows.Forms.ComboBox(); + this.label4 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.x12 = new System.Windows.Forms.ComboBox(); this.cbFilterCase = new System.Windows.Forms.CheckBox(); @@ -131,11 +149,12 @@ private void InitializeComponent() this.t2 = new System.Windows.Forms.TextBox(); this.c1 = new System.Windows.Forms.Panel(); this.t1 = new System.Windows.Forms.TextBox(); - this.btnReset = new System.Windows.Forms.Button(); this.btnSelectFontOutput = new System.Windows.Forms.Button(); this.cbTimestampOutputLines = new System.Windows.Forms.CheckBox(); this.BackColorOutput = new System.Windows.Forms.Panel(); this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.label6 = new System.Windows.Forms.Label(); + this.btnCancel = new System.Windows.Forms.Button(); this.grpColourFilters.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); @@ -147,11 +166,11 @@ private void InitializeComponent() this.label1.Anchor = System.Windows.Forms.AnchorStyles.Top; this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(209, 14); + this.label1.Location = new System.Drawing.Point(302, 15); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(117, 16); + this.label1.Size = new System.Drawing.Size(129, 16); this.label1.TabIndex = 9; - this.label1.Text = "Display Options"; + this.label1.Text = "Event Responses"; // // btnOk // @@ -160,7 +179,7 @@ private void InitializeComponent() this.btnOk.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnOk.ForeColor = System.Drawing.Color.Blue; - this.btnOk.Location = new System.Drawing.Point(448, 499); + this.btnOk.Location = new System.Drawing.Point(631, 547); this.btnOk.Name = "btnOk"; this.btnOk.Size = new System.Drawing.Size(75, 20); this.btnOk.TabIndex = 10; @@ -186,6 +205,24 @@ private void InitializeComponent() // // grpColourFilters // + this.grpColourFilters.Controls.Add(this.btnClearTriggers); + this.grpColourFilters.Controls.Add(this.label8); + this.grpColourFilters.Controls.Add(this.btnReset); + this.grpColourFilters.Controls.Add(this.label7); + this.grpColourFilters.Controls.Add(this.btnClearMacros); + this.grpColourFilters.Controls.Add(this.mac11); + this.grpColourFilters.Controls.Add(this.mac10); + this.grpColourFilters.Controls.Add(this.mac9); + this.grpColourFilters.Controls.Add(this.mac8); + this.grpColourFilters.Controls.Add(this.mac7); + this.grpColourFilters.Controls.Add(this.mac6); + this.grpColourFilters.Controls.Add(this.mac5); + this.grpColourFilters.Controls.Add(this.mac4); + this.grpColourFilters.Controls.Add(this.mac3); + this.grpColourFilters.Controls.Add(this.mac2); + this.grpColourFilters.Controls.Add(this.label5); + this.grpColourFilters.Controls.Add(this.mac1); + this.grpColourFilters.Controls.Add(this.label4); this.grpColourFilters.Controls.Add(this.panel1); this.grpColourFilters.Controls.Add(this.x12); this.grpColourFilters.Controls.Add(this.cbFilterCase); @@ -261,18 +298,187 @@ private void InitializeComponent() this.grpColourFilters.Controls.Add(this.t1); this.grpColourFilters.Location = new System.Drawing.Point(9, 42); this.grpColourFilters.Name = "grpColourFilters"; - this.grpColourFilters.Size = new System.Drawing.Size(514, 429); + this.grpColourFilters.Size = new System.Drawing.Size(716, 460); this.grpColourFilters.TabIndex = 15; this.grpColourFilters.TabStop = false; this.grpColourFilters.Text = "Input panel"; // + // btnClearTriggers + // + this.btnClearTriggers.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.btnClearTriggers.FlatAppearance.BorderSize = 0; + this.btnClearTriggers.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; + this.btnClearTriggers.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnClearTriggers.ForeColor = System.Drawing.Color.Blue; + this.btnClearTriggers.Location = new System.Drawing.Point(19, 420); + this.btnClearTriggers.Name = "btnClearTriggers"; + this.btnClearTriggers.Size = new System.Drawing.Size(123, 22); + this.btnClearTriggers.TabIndex = 130; + this.btnClearTriggers.Text = "Clear All"; + this.btnClearTriggers.UseVisualStyleBackColor = false; + this.btnClearTriggers.Click += new System.EventHandler(this.btnClearAll_Click); + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(150, 91); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(63, 13); + this.label8.TabIndex = 129; + this.label8.Text = "... this string"; + // + // btnReset + // + this.btnReset.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.btnReset.FlatAppearance.BorderSize = 0; + this.btnReset.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; + this.btnReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnReset.ForeColor = System.Drawing.Color.Blue; + this.btnReset.Location = new System.Drawing.Point(245, 420); + this.btnReset.Name = "btnReset"; + this.btnReset.Size = new System.Drawing.Size(78, 22); + this.btnReset.TabIndex = 71; + this.btnReset.Text = "&Reset Colors"; + this.btnReset.UseVisualStyleBackColor = false; + this.btnReset.Click += new System.EventHandler(this.BtnDefault_Click); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(255, 91); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(68, 13); + this.label7.TabIndex = 128; + this.label7.Text = "set color to..."; + // + // btnClearMacros + // + this.btnClearMacros.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.btnClearMacros.FlatAppearance.BorderSize = 0; + this.btnClearMacros.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; + this.btnClearMacros.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnClearMacros.ForeColor = System.Drawing.Color.Blue; + this.btnClearMacros.Location = new System.Drawing.Point(574, 420); + this.btnClearMacros.Name = "btnClearMacros"; + this.btnClearMacros.Size = new System.Drawing.Size(123, 22); + this.btnClearMacros.TabIndex = 127; + this.btnClearMacros.Text = "Clear Macros"; + this.btnClearMacros.UseVisualStyleBackColor = false; + this.btnClearMacros.Click += new System.EventHandler(this.btnClearMacros_Click); + // + // mac11 + // + this.mac11.FormattingEnabled = true; + this.mac11.Location = new System.Drawing.Point(496, 368); + this.mac11.Name = "mac11"; + this.mac11.Size = new System.Drawing.Size(201, 21); + this.mac11.TabIndex = 126; + // + // mac10 + // + this.mac10.FormattingEnabled = true; + this.mac10.Location = new System.Drawing.Point(496, 342); + this.mac10.Name = "mac10"; + this.mac10.Size = new System.Drawing.Size(201, 21); + this.mac10.TabIndex = 125; + // + // mac9 + // + this.mac9.FormattingEnabled = true; + this.mac9.Location = new System.Drawing.Point(496, 316); + this.mac9.Name = "mac9"; + this.mac9.Size = new System.Drawing.Size(201, 21); + this.mac9.TabIndex = 124; + // + // mac8 + // + this.mac8.FormattingEnabled = true; + this.mac8.Location = new System.Drawing.Point(496, 290); + this.mac8.Name = "mac8"; + this.mac8.Size = new System.Drawing.Size(201, 21); + this.mac8.TabIndex = 123; + // + // mac7 + // + this.mac7.FormattingEnabled = true; + this.mac7.Location = new System.Drawing.Point(496, 264); + this.mac7.Name = "mac7"; + this.mac7.Size = new System.Drawing.Size(201, 21); + this.mac7.TabIndex = 122; + // + // mac6 + // + this.mac6.FormattingEnabled = true; + this.mac6.Location = new System.Drawing.Point(496, 238); + this.mac6.Name = "mac6"; + this.mac6.Size = new System.Drawing.Size(201, 21); + this.mac6.TabIndex = 121; + // + // mac5 + // + this.mac5.FormattingEnabled = true; + this.mac5.Location = new System.Drawing.Point(496, 212); + this.mac5.Name = "mac5"; + this.mac5.Size = new System.Drawing.Size(201, 21); + this.mac5.TabIndex = 120; + // + // mac4 + // + this.mac4.FormattingEnabled = true; + this.mac4.Location = new System.Drawing.Point(496, 186); + this.mac4.Name = "mac4"; + this.mac4.Size = new System.Drawing.Size(201, 21); + this.mac4.TabIndex = 119; + // + // mac3 + // + this.mac3.FormattingEnabled = true; + this.mac3.Location = new System.Drawing.Point(496, 159); + this.mac3.Name = "mac3"; + this.mac3.Size = new System.Drawing.Size(201, 21); + this.mac3.TabIndex = 118; + // + // mac2 + // + this.mac2.FormattingEnabled = true; + this.mac2.Location = new System.Drawing.Point(496, 134); + this.mac2.Name = "mac2"; + this.mac2.Size = new System.Drawing.Size(201, 21); + this.mac2.TabIndex = 117; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(548, 92); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(91, 13); + this.label5.TabIndex = 116; + this.label5.Text = "... then call macro"; + // + // mac1 + // + this.mac1.FormattingEnabled = true; + this.mac1.Location = new System.Drawing.Point(496, 108); + this.mac1.Name = "mac1"; + this.mac1.Size = new System.Drawing.Size(201, 21); + this.mac1.TabIndex = 115; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(376, 91); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(46, 13); + this.label4.TabIndex = 114; + this.label4.Text = "(sample)"; + // // panel1 // this.panel1.BackColor = System.Drawing.Color.LightGray; this.panel1.Location = new System.Drawing.Point(19, 84); this.panel1.Margin = new System.Windows.Forms.Padding(2); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(475, 3); + this.panel1.Size = new System.Drawing.Size(678, 2); this.panel1.TabIndex = 113; // // x12 @@ -290,7 +496,7 @@ private void InitializeComponent() this.cbFilterCase.AutoSize = true; this.cbFilterCase.Checked = true; this.cbFilterCase.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbFilterCase.Location = new System.Drawing.Point(145, 90); + this.cbFilterCase.Location = new System.Drawing.Point(614, 63); this.cbFilterCase.Margin = new System.Windows.Forms.Padding(2); this.cbFilterCase.Name = "cbFilterCase"; this.cbFilterCase.Size = new System.Drawing.Size(83, 17); @@ -482,11 +688,11 @@ private void InitializeComponent() // label16 // this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(37, 92); + this.label16.Location = new System.Drawing.Point(16, 92); this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(51, 13); + this.label16.Size = new System.Drawing.Size(114, 13); this.label16.TabIndex = 69; - this.label16.Text = "Condition"; + this.label16.Text = "If a line starts/contains"; // // m12 // @@ -1086,21 +1292,6 @@ private void InitializeComponent() this.t1.Tag = "0"; this.t1.TextChanged += new System.EventHandler(this.T1_TextChanged); // - // btnReset - // - this.btnReset.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.btnReset.FlatAppearance.BorderSize = 0; - this.btnReset.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; - this.btnReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnReset.ForeColor = System.Drawing.Color.Blue; - this.btnReset.Location = new System.Drawing.Point(358, 499); - this.btnReset.Name = "btnReset"; - this.btnReset.Size = new System.Drawing.Size(74, 20); - this.btnReset.TabIndex = 71; - this.btnReset.Text = "&Reset"; - this.btnReset.UseVisualStyleBackColor = false; - this.btnReset.Click += new System.EventHandler(this.BtnDefault_Click); - // // btnSelectFontOutput // this.btnSelectFontOutput.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); @@ -1141,35 +1332,59 @@ private void InitializeComponent() // // groupBox3 // + this.groupBox3.Controls.Add(this.label6); this.groupBox3.Controls.Add(this.btnSelectFontOutput); this.groupBox3.Controls.Add(this.cbTimestampOutputLines); this.groupBox3.Controls.Add(this.BackColorOutput); - this.groupBox3.Location = new System.Drawing.Point(9, 477); + this.groupBox3.Location = new System.Drawing.Point(9, 508); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(344, 59); + this.groupBox3.Size = new System.Drawing.Size(475, 59); this.groupBox3.TabIndex = 20; this.groupBox3.TabStop = false; this.groupBox3.Text = "Output Panel"; // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(327, 26); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(113, 13); + this.label6.TabIndex = 58; + this.label6.Text = "Colour of Output panel"; + // + // btnCancel + // + this.btnCancel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.btnCancel.FlatAppearance.BorderSize = 0; + this.btnCancel.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; + this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnCancel.ForeColor = System.Drawing.Color.Blue; + this.btnCancel.Location = new System.Drawing.Point(538, 547); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 20); + this.btnCancel.TabIndex = 21; + this.btnCancel.Text = "&Cancel"; + this.btnCancel.UseVisualStyleBackColor = false; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // // FrmDisplayOptions // this.AcceptButton = this.btnOk; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(533, 548); + this.ClientSize = new System.Drawing.Size(736, 586); + this.Controls.Add(this.btnCancel); this.Controls.Add(this.groupBox3); - this.Controls.Add(this.btnReset); this.Controls.Add(this.grpColourFilters); this.Controls.Add(this.label1); this.Controls.Add(this.btnOk); - this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "FrmDisplayOptions"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Display Options"; + this.Text = "Event Responses"; this.TopMost = true; this.Shown += new System.EventHandler(this.FrmDisplayOptions_Shown); this.grpColourFilters.ResumeLayout(false); @@ -1268,5 +1483,24 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbFilterCase; private System.Windows.Forms.ComboBox x12; private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox mac11; + private System.Windows.Forms.ComboBox mac10; + private System.Windows.Forms.ComboBox mac9; + private System.Windows.Forms.ComboBox mac8; + private System.Windows.Forms.ComboBox mac7; + private System.Windows.Forms.ComboBox mac6; + private System.Windows.Forms.ComboBox mac5; + private System.Windows.Forms.ComboBox mac4; + private System.Windows.Forms.ComboBox mac3; + private System.Windows.Forms.ComboBox mac2; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.ComboBox mac1; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Button btnClearMacros; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Button btnClearTriggers; + private System.Windows.Forms.Button btnCancel; } } \ No newline at end of file diff --git a/Terminal2/FrmDisplayOptions.cs b/Terminal2/FrmDisplayOptions.cs index 56d992c..ba92061 100644 --- a/Terminal2/FrmDisplayOptions.cs +++ b/Terminal2/FrmDisplayOptions.cs @@ -1,7 +1,7 @@ /* * Terminal2 * - * Copyright © 2022-23-23 Michael Heyns + * Copyright © 2021-2024 Michael Heyns * * This file is part of Terminal2. * @@ -35,6 +35,7 @@ public partial class FrmDisplayOptions : Form { public DisplayOptions Options; public DialogResult Result = DialogResult.Cancel; + public List MacroNames = new List(); public readonly ComboBox[] ModeList; public readonly TextBox[] TextList; @@ -53,6 +54,9 @@ public FrmDisplayOptions() ForePanelList = new Panel[] { c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12 }; BackPanelList = new Panel[] { b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12 }; SampleList = new Label[] { sample1, sample2, sample3, sample4, sample5, sample6, sample7, sample8, sample9, sample10, sample11, sample12 }; + + ComboBox dummy = new ComboBox(); + MacroList = new ComboBox[] { mac1, mac2, mac3, mac4, mac5, mac6, mac7, mac8, mac9, mac10, mac11, dummy }; } private void RefreshScreenFromDatabase() @@ -81,11 +85,16 @@ private void RefreshScreenFromDatabase() SampleList[i].Font = Options.inputFont; SampleList[i].ForeColor = Options.filter[i].foreColor; SampleList[i].BackColor = Options.filter[i].backColor; + + MacroList[i].Text = Options.filter[i].macro; } + Application.DoEvents(); } private void BtnOk_Click(object sender, EventArgs e) { + for (int i = 0; i <= 10; i++) + Options.filter[i].macro = MacroList[i].Text; Result = DialogResult.OK; Close(); } @@ -123,15 +132,10 @@ private void BackColorInput_Click(object sender, EventArgs e) if (ok == DialogResult.OK) { Options.inputBackground = colorDialog.Color; - - DialogResult yn = MessageBox.Show("Do you want to set all filter backgrounds to this color as well?", "Option", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (yn == DialogResult.Yes) + for (int i = 0; i <= 10; i++) { - for (int i = 0; i < Options.filter.Length; i++) - { - if (i != SEARCH_INDEX) - Options.filter[i].backColor = colorDialog.Color; - } + if (Options.filter[i].text.Length == 0) + Options.filter[i].backColor = colorDialog.Color; } RefreshScreenFromDatabase(); } @@ -182,12 +186,62 @@ private void M1_SelectedIndexChanged(object sender, EventArgs e) Options.filter[i].mode = cbox.SelectedIndex; } + private void ResetRow(int row) + { + switch (row) + { + case 0: + Options.filter[row].foreColor = Color.DarkOrange; + break; + case 1: + Options.filter[row].foreColor = Color.Blue; + break; + case 2: + Options.filter[row].foreColor = Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + break; + case 3: + Options.filter[row].foreColor = Color.DarkGreen; + break; + case 4: + Options.filter[row].foreColor = Color.Fuchsia; + break; + case 5: + Options.filter[row].foreColor = Color.Olive; + break; + case 6: + Options.filter[row].foreColor = Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); + break; + case 7: + Options.filter[row].foreColor = Color.Green; + break; + case 8: + Options.filter[row].foreColor = Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); + break; + case 9: + Options.filter[row].foreColor = Color.LightSalmon; + break; + case 10: + Options.filter[row].foreColor = Color.Yellow; + break; + default: + return; + } + + Options.filter[row].backColor = BackColorInput.BackColor; + } + private void T1_TextChanged(object sender, EventArgs e) { TextBox tb = (TextBox)sender; - int i = Utils.Int(tb.Tag.ToString()); - Options.filter[i].text = tb.Text; - ModeList[i].Enabled = (tb.Text.Length > 0); + int row = Utils.Int(tb.Tag.ToString()); + Options.filter[row].text = tb.Text; + ModeList[row].Enabled = (tb.Text.Length > 0); + + if (!ModeList[row].Enabled) + { + ResetRow(row); + RefreshScreenFromDatabase(); + } } private void TextColorInput_Click(object sender, EventArgs e) @@ -203,49 +257,10 @@ private void TextColorInput_Click(object sender, EventArgs e) private void BtnDefault_Click(object sender, EventArgs e) { - DialogResult yn = MessageBox.Show("Are you sure?", "Please Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (yn != DialogResult.Yes) - return; - - Options.filter[9].foreColor = Color.LightSalmon; - Options.filter[8].foreColor = Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); - Options.filter[7].foreColor = Color.Green; - Options.filter[6].foreColor = Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); - Options.filter[5].foreColor = Color.Olive; - Options.filter[4].foreColor = Color.Fuchsia; - Options.filter[3].foreColor = Color.DarkGreen; - Options.filter[2].foreColor = Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); - Options.filter[1].foreColor = Color.Blue; - Options.filter[0].foreColor = Color.DarkOrange; - - Options.outputBackground = Color.White; - - Options.inputDefaultForeground = Color.Black; - Options.inputBackground = Color.White; - - Options.outputBackground = Color.Gainsboro; - - TypeConverter converter = TypeDescriptor.GetConverter(typeof(Font)); - Options.inputFont = (Font)converter.ConvertFromString(Utils.DefaultInputFont); - Options.outputFont = (Font)converter.ConvertFromString(Utils.DefaultOutputFont); - - for (int i = 0; i < Options.filter.Length; i++) - { - Options.filter[i].mode = 1; - Options.filter[i].text = string.Empty; - Options.filter[i].backColor = Color.White; - } - Options.IgnoreCase = true; - - // search option + for (int row = 0; row <= 10; row++) + ResetRow(row); Options.filter[SEARCH_INDEX].foreColor = Color.Black; Options.filter[SEARCH_INDEX].backColor = Color.Lime; - - // suggest error condition - Options.filter[10].foreColor = Color.Yellow; - Options.filter[10].backColor = Color.Red; - Options.filter[10].text = "ERROR"; - RefreshScreenFromDatabase(); } @@ -266,8 +281,43 @@ private void cbFilterCase_CheckedChanged(object sender, EventArgs e) } private void FrmDisplayOptions_Shown(object sender, EventArgs e) { + RefreshScreenFromDatabase(); + Application.DoEvents(); + foreach (var mac in MacroList) + { + mac.Items.Clear(); + foreach (string s in MacroNames) + mac.Items.Add(s); + } cbTimestampOutputLines.Checked = Options.ShowOutputTimestamp; RefreshScreenFromDatabase(); } + + private void btnClearMacros_Click(object sender, EventArgs e) + { + for (int row = 0; row <= 10; row++) + { + Options.filter[row].macro = string.Empty; + } + RefreshScreenFromDatabase(); + } + + private void btnClearAll_Click(object sender, EventArgs e) + { + for (int row = 0; row <= 10; row++) + { + Options.filter[row].mode = 1; + Options.filter[row].text = string.Empty; + Options.filter[row].macro = string.Empty; + } + RefreshScreenFromDatabase(); + + } + + private void btnCancel_Click(object sender, EventArgs e) + { + Result = DialogResult.Cancel; + Close(); + } } } \ No newline at end of file diff --git a/Terminal2/FrmFileSend.cs b/Terminal2/FrmFileSend.cs index db840df..c6d57f4 100644 --- a/Terminal2/FrmFileSend.cs +++ b/Terminal2/FrmFileSend.cs @@ -1,7 +1,7 @@ /* * Terminal2 * - * Copyright © 2022-23-23 Michael Heyns + * Copyright © 2021-2024 Michael Heyns * * This file is part of Terminal2. * diff --git a/Terminal2/FrmHelp.resx b/Terminal2/FrmHelp.resx index cd37e7d..584e435 100644 --- a/Terminal2/FrmHelp.resx +++ b/Terminal2/FrmHelp.resx @@ -186,7 +186,14 @@ Source Code: ---- - v1.3.4.4 + v1.3.5.0 + * Events can change colors and trigger macros + * Redesign of the Options screen (called Events now) + +v1.3.4.5 + * Ability to toggle Freeze, DTR and RTS from a macro + +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 diff --git a/Terminal2/FrmHorizontal.Designer.cs b/Terminal2/FrmHorizontal.Designer.cs index df65aa4..795d5b5 100644 --- a/Terminal2/FrmHorizontal.Designer.cs +++ b/Terminal2/FrmHorizontal.Designer.cs @@ -140,7 +140,6 @@ private void InitializeComponent() this.Controls.Add(this.tbRight); this.Controls.Add(this.tbLeft); this.Controls.Add(this.grid); - this.DoubleBuffered = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; diff --git a/Terminal2/FrmInspect.Designer.cs b/Terminal2/FrmInspect.Designer.cs index fcdb7ca..4f407c2 100644 --- a/Terminal2/FrmInspect.Designer.cs +++ b/Terminal2/FrmInspect.Designer.cs @@ -657,7 +657,6 @@ private void InitializeComponent() this.Controls.Add(this.panel3); this.Controls.Add(this.panel1); this.Controls.Add(this.menuStrip1); - this.DoubleBuffered = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip1; this.Name = "FrmInspect"; diff --git a/Terminal2/FrmMacroOptions.Designer.cs b/Terminal2/FrmMacroOptions.Designer.cs index 91c5e70..697718b 100644 --- a/Terminal2/FrmMacroOptions.Designer.cs +++ b/Terminal2/FrmMacroOptions.Designer.cs @@ -412,7 +412,7 @@ private void InitializeComponent() this.localHelp.Controls.Add(this.textBox1); this.localHelp.Location = new System.Drawing.Point(177, 108); this.localHelp.Name = "localHelp"; - this.localHelp.Size = new System.Drawing.Size(414, 147); + this.localHelp.Size = new System.Drawing.Size(414, 212); this.localHelp.TabIndex = 36; this.localHelp.Visible = false; // @@ -439,7 +439,7 @@ private void InitializeComponent() this.textBox2.Multiline = true; this.textBox2.Name = "textBox2"; this.textBox2.ReadOnly = true; - this.textBox2.Size = new System.Drawing.Size(292, 102); + this.textBox2.Size = new System.Drawing.Size(292, 179); this.textBox2.TabIndex = 2; this.textBox2.Text = resources.GetString("textBox2.Text"); // @@ -452,10 +452,10 @@ private void InitializeComponent() this.textBox1.Multiline = true; this.textBox1.Name = "textBox1"; this.textBox1.ReadOnly = true; - this.textBox1.Size = new System.Drawing.Size(111, 102); + this.textBox1.Size = new System.Drawing.Size(111, 148); this.textBox1.TabIndex = 1; this.textBox1.Text = "-> Empty lines\r\n-> $nn\r\n-> # comment \r\n-> ## comments\r\n-> #DELAY nn \r\n-> #STX t" + - "ext\r\n-> #MACRO title\r\n "; + "ext\r\n-> #FREEZE\r\n-> #DTR\r\n-> #RTS\r\n-> #MACRO title\r\n "; // // btnHelp // diff --git a/Terminal2/FrmMacroOptions.resx b/Terminal2/FrmMacroOptions.resx index b76a567..2cfae24 100644 --- a/Terminal2/FrmMacroOptions.resx +++ b/Terminal2/FrmMacroOptions.resx @@ -124,6 +124,9 @@ - Also gets injected into the input stream - Delays macro execution for nn milliseonds - Encapsulates 'text' in STX...ETX LRC packet +- Presses the 'Freeze' button +- Presses Ctrl-1 (DTR in serial mode) button +- Presses Ctrl-2 (RTS in serial mode) button - Executes another macro with that title (case sensitive) NOTE: Because they execute in parallel, you may want to add #DELAY when executing more than one. diff --git a/Terminal2/FrmMain.Designer.cs b/Terminal2/FrmMain.Designer.cs index d024cad..58a261d 100644 --- a/Terminal2/FrmMain.Designer.cs +++ b/Terminal2/FrmMain.Designer.cs @@ -54,19 +54,19 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle116 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle117 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle105 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle106 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle107 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle108 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle109 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle110 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle111 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle112 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle113 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle114 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle115 = new System.Windows.Forms.DataGridViewCellStyle(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.blank2 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel4 = new System.Windows.Forms.ToolStripStatusLabel(); @@ -164,6 +164,7 @@ private void InitializeComponent() this.LeftToolStripPanel = new System.Windows.Forms.ToolStripPanel(); this.ContentPanel = new System.Windows.Forms.ToolStripContentPanel(); this.backupTimer = new System.Windows.Forms.Timer(this.components); + this.colorDialog = new System.Windows.Forms.ColorDialog(); this.statusStrip1.SuspendLayout(); this.PanelOne.SuspendLayout(); this.MacroPanel.SuspendLayout(); @@ -421,13 +422,14 @@ private void InitializeComponent() this.btnColorConfig.FlatAppearance.BorderSize = 0; this.btnColorConfig.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; this.btnColorConfig.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnColorConfig.ForeColor = System.Drawing.Color.Blue; this.btnColorConfig.Image = global::Terminal.Properties.Resources.Gear; this.btnColorConfig.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.btnColorConfig.Location = new System.Drawing.Point(343, 4); this.btnColorConfig.Name = "btnColorConfig"; this.btnColorConfig.Size = new System.Drawing.Size(86, 21); this.btnColorConfig.TabIndex = 15; - this.btnColorConfig.Text = " &Display"; + this.btnColorConfig.Text = " &Events"; this.btnColorConfig.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.btnColorConfig.UseVisualStyleBackColor = false; this.btnColorConfig.Click += new System.EventHandler(this.BtnColorConfig_Click); @@ -591,14 +593,14 @@ private void InitializeComponent() this.scF11, this.scF12}); this.dgMacroTable.Cursor = System.Windows.Forms.Cursors.Default; - dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgMacroTable.DefaultCellStyle = dataGridViewCellStyle12; + dataGridViewCellStyle116.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle116.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle116.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle116.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle116.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle116.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle116.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgMacroTable.DefaultCellStyle = dataGridViewCellStyle116; this.dgMacroTable.Dock = System.Windows.Forms.DockStyle.Top; this.dgMacroTable.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgMacroTable.Location = new System.Drawing.Point(34, 0); @@ -608,8 +610,8 @@ private void InitializeComponent() this.dgMacroTable.RowHeadersVisible = false; this.dgMacroTable.RowHeadersWidth = 62; this.dgMacroTable.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.dgMacroTable.RowsDefaultCellStyle = dataGridViewCellStyle13; + dataGridViewCellStyle117.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.dgMacroTable.RowsDefaultCellStyle = dataGridViewCellStyle117; this.dgMacroTable.RowTemplate.ReadOnly = true; this.dgMacroTable.ScrollBars = System.Windows.Forms.ScrollBars.None; this.dgMacroTable.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; @@ -634,8 +636,8 @@ private void InitializeComponent() // // F1 // - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.F1.DefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle105.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.F1.DefaultCellStyle = dataGridViewCellStyle105; this.F1.HeaderText = "F1"; this.F1.MinimumWidth = 8; this.F1.Name = "F1"; @@ -643,8 +645,8 @@ private void InitializeComponent() // // scF2 // - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.scF2.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle106.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.scF2.DefaultCellStyle = dataGridViewCellStyle106; this.scF2.HeaderText = "F2"; this.scF2.MinimumWidth = 8; this.scF2.Name = "scF2"; @@ -652,8 +654,8 @@ private void InitializeComponent() // // scF3 // - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.scF3.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle107.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.scF3.DefaultCellStyle = dataGridViewCellStyle107; this.scF3.HeaderText = "F3"; this.scF3.MinimumWidth = 8; this.scF3.Name = "scF3"; @@ -661,8 +663,8 @@ private void InitializeComponent() // // scF4 // - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.scF4.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle108.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.scF4.DefaultCellStyle = dataGridViewCellStyle108; this.scF4.HeaderText = "F4"; this.scF4.MinimumWidth = 8; this.scF4.Name = "scF4"; @@ -670,8 +672,8 @@ private void InitializeComponent() // // scF5 // - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.scF5.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle109.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.scF5.DefaultCellStyle = dataGridViewCellStyle109; this.scF5.HeaderText = "F5"; this.scF5.MinimumWidth = 8; this.scF5.Name = "scF5"; @@ -679,8 +681,8 @@ private void InitializeComponent() // // scF6 // - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.scF6.DefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle110.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.scF6.DefaultCellStyle = dataGridViewCellStyle110; this.scF6.HeaderText = "F6"; this.scF6.MinimumWidth = 8; this.scF6.Name = "scF6"; @@ -688,8 +690,8 @@ private void InitializeComponent() // // scF7 // - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.scF7.DefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle111.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.scF7.DefaultCellStyle = dataGridViewCellStyle111; this.scF7.HeaderText = "F7"; this.scF7.MinimumWidth = 8; this.scF7.Name = "scF7"; @@ -697,8 +699,8 @@ private void InitializeComponent() // // scF8 // - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.scF8.DefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle112.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.scF8.DefaultCellStyle = dataGridViewCellStyle112; this.scF8.HeaderText = "F8"; this.scF8.MinimumWidth = 8; this.scF8.Name = "scF8"; @@ -706,8 +708,8 @@ private void InitializeComponent() // // scF9 // - dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.scF9.DefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle113.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.scF9.DefaultCellStyle = dataGridViewCellStyle113; this.scF9.HeaderText = "F9"; this.scF9.MinimumWidth = 8; this.scF9.Name = "scF9"; @@ -715,8 +717,8 @@ private void InitializeComponent() // // scF10 // - dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.scF10.DefaultCellStyle = dataGridViewCellStyle10; + dataGridViewCellStyle114.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.scF10.DefaultCellStyle = dataGridViewCellStyle114; this.scF10.HeaderText = "F10"; this.scF10.MinimumWidth = 8; this.scF10.Name = "scF10"; @@ -731,8 +733,8 @@ private void InitializeComponent() // // scF12 // - dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; - this.scF12.DefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle115.Alignment = System.Windows.Forms.DataGridViewContentAlignment.BottomCenter; + this.scF12.DefaultCellStyle = dataGridViewCellStyle115; this.scF12.HeaderText = "F12"; this.scF12.MinimumWidth = 8; this.scF12.Name = "scF12"; @@ -760,11 +762,10 @@ private void InitializeComponent() // // btnGroup4 // - this.btnGroup4.BackColor = System.Drawing.SystemColors.ScrollBar; + this.btnGroup4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(227))))); this.btnGroup4.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnGroup4.FlatAppearance.BorderSize = 0; this.btnGroup4.FlatAppearance.CheckedBackColor = System.Drawing.Color.White; - this.btnGroup4.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; this.btnGroup4.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnGroup4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnGroup4.Location = new System.Drawing.Point(7, 66); @@ -773,15 +774,14 @@ private void InitializeComponent() this.btnGroup4.TabIndex = 6; this.btnGroup4.Text = "D"; this.btnGroup4.UseVisualStyleBackColor = false; - this.btnGroup4.Click += new System.EventHandler(this.btnGroup4_Click); + this.btnGroup4.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnGroup4_MouseDown); // // btnGroup2 // - this.btnGroup2.BackColor = System.Drawing.SystemColors.ScrollBar; + this.btnGroup2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(239)))), ((int)(((byte)(227))))); this.btnGroup2.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnGroup2.FlatAppearance.BorderSize = 0; this.btnGroup2.FlatAppearance.CheckedBackColor = System.Drawing.Color.White; - this.btnGroup2.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; this.btnGroup2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnGroup2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnGroup2.Location = new System.Drawing.Point(7, 26); @@ -790,15 +790,14 @@ private void InitializeComponent() this.btnGroup2.TabIndex = 4; this.btnGroup2.Text = "B"; this.btnGroup2.UseVisualStyleBackColor = false; - this.btnGroup2.Click += new System.EventHandler(this.btnGroup2_Click); + this.btnGroup2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnGroup2_MouseDown); // // btnGroup3 // - this.btnGroup3.BackColor = System.Drawing.SystemColors.ScrollBar; + this.btnGroup3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(255)))), ((int)(((byte)(227))))); this.btnGroup3.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnGroup3.FlatAppearance.BorderSize = 0; this.btnGroup3.FlatAppearance.CheckedBackColor = System.Drawing.Color.White; - this.btnGroup3.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; this.btnGroup3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnGroup3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnGroup3.Location = new System.Drawing.Point(7, 46); @@ -807,15 +806,14 @@ private void InitializeComponent() this.btnGroup3.TabIndex = 5; this.btnGroup3.Text = "C"; this.btnGroup3.UseVisualStyleBackColor = false; - this.btnGroup3.Click += new System.EventHandler(this.btnGroup3_Click); + this.btnGroup3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnGroup3_MouseDown); // // btnGroup1 // - this.btnGroup1.BackColor = System.Drawing.SystemColors.ScrollBar; + this.btnGroup1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); this.btnGroup1.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnGroup1.FlatAppearance.BorderSize = 0; this.btnGroup1.FlatAppearance.CheckedBackColor = System.Drawing.Color.White; - this.btnGroup1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Bisque; this.btnGroup1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnGroup1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnGroup1.Location = new System.Drawing.Point(7, 6); @@ -824,7 +822,7 @@ private void InitializeComponent() this.btnGroup1.TabIndex = 3; this.btnGroup1.Text = "A"; this.btnGroup1.UseVisualStyleBackColor = false; - this.btnGroup1.Click += new System.EventHandler(this.btnGroup1_Click); + this.btnGroup1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnGroup1_MouseDown); // // btnFile // @@ -1659,6 +1657,7 @@ private void InitializeComponent() private System.Windows.Forms.Button btnGroup4; private System.Windows.Forms.Button btnGroup3; private System.Windows.Forms.Button btnGroup2; + private System.Windows.Forms.ColorDialog colorDialog; } } diff --git a/Terminal2/FrmMain.cs b/Terminal2/FrmMain.cs index 0985735..67624d6 100644 --- a/Terminal2/FrmMain.cs +++ b/Terminal2/FrmMain.cs @@ -27,6 +27,8 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Reflection; +using System.Runtime.Serialization.Formatters.Binary; using System.Text; using System.Threading; using System.Windows.Forms; @@ -48,7 +50,6 @@ public partial class FrmMain : Form public bool ExitFlag = false; private Profile _activeProfile = new Profile(); - private FrmDisplayOptions _config = new FrmDisplayOptions(); private FrmHelp _help = new FrmHelp(); private int _ticks = 0; @@ -65,6 +66,7 @@ private enum State { Changing, Disconnected, Connected, Listening }; private readonly Thread[] _macroThread = new Thread[48 * 4]; private static readonly AutoResetEvent[] _macroTrigger = new AutoResetEvent[48 * 4]; private static readonly bool[] _macroBusy = new bool[48 * 4]; + private static readonly bool[] _macroTriggeredByFilter = new bool[48 * 4]; // TCP Server listening thread private Thread _connectThread = null; @@ -95,6 +97,7 @@ private enum State { Changing, Disconnected, Connected, Listening }; private const int SEARCH_INDEX = 11; private Brush[] _filterFrontBrush = new Brush[12]; private Brush[] _filterBackBrush = new Brush[12]; + private string[] _filterMacro = new string[12]; private Brush _inputDefaultFrontBrush; private Brush _inputBackBrush; private Brush _outputFrontBrush; @@ -112,9 +115,12 @@ private enum State { Changing, Disconnected, Connected, Listening }; private bool _typingPaused = false; private bool _typingWarnedAboutDelete = false; + private bool _freezeTriggeredFromMacro = false; + private bool _resetHistoryIndex = true; + private StringBuilder _macroTriggerString = new StringBuilder(); - ////private int[] _appliedFilter = new int[MAX_INPUT_LINE_COUNT]; + private Button[] _btnGroups = new Button[4]; private string[] _LogLimits = { "No limits", "1000", "5000", "10000", "50000", "100000", "500000", "1000000"}; @@ -267,6 +273,42 @@ private void LogAdd(string msg) } } + private void AddToMacropActivationString(string str) + { + Filters filters = new Filters(); + for (int i = 0; i < str.Length; i++) + { + char ch = str[i]; + if (ch < ' ') + { + string line = _macroTriggerString.ToString(); + int offset = 0; + if (Utils.HasTimestamp(line)) + offset += Utils.TimestampLength(); + int filter = filters.FindApplicableFilter(_activeProfile, line, offset); + if (filter >= 0) + { + int m = FindMacro(_filterMacro[filter]); + if (m >= 0) + { + if (!_macroTriggeredByFilter[m]) + { + _macroTriggeredByFilter[m] = true; + if (!_macroBusy[m]) + _macroTrigger[m].Set(); + } + } + } + _macroTriggerString.Clear(); + } + else + { + _macroTriggerString.Append(ch); + } + } + + } + private void UIInputQueueHandler() { if (_frozen) @@ -280,6 +322,8 @@ private void UIInputQueueHandler() string str = (string)_uiInputQueue.Dequeue(); LogAdd(str); + AddToMacropActivationString(str); + char[] delim = { '\n' }; string[] lines = str.Split(delim); @@ -406,11 +450,11 @@ public FrmMain(string[] args) for (int f = 1; f <= 12; f++) { dgMacroTable.Rows[0].Cells[f].Value = $"{f}"; - dgMacroTable.Rows[0].Cells[f].Style.BackColor = Color.LightGray;// Ivory; + dgMacroTable.Rows[0].Cells[f].Style.BackColor = btnGroup1.BackColor; } for (int r = 0; r <= 4; r++) - dgMacroTable.Rows[r].Cells[0].Style.BackColor = Color.LightGray;// Ivory; + dgMacroTable.Rows[r].Cells[0].Style.BackColor = btnGroup1.BackColor; //dgMacroTable.Rows[0].Cells[0].Value = " <-- --> "; dgMacroTable.Rows[1].Cells[0].Value = "Plain"; // "1 - 48"; @@ -469,14 +513,26 @@ private void BtnColorConfig_Click(object sender, EventArgs e) SaveThisProfile(); TopMost = false; - _config.Options = _activeProfile.displayOptions.Clone(); - _config.ShowDialog(); + + FrmDisplayOptions DialogOptions = new FrmDisplayOptions(); + DialogOptions.MacroNames.Clear(); + foreach (Macro m in _activeProfile.macros) + { + if (m != null) + { + if (m.title.Length > 0) + DialogOptions.MacroNames.Add(m.title); + } + } + + DialogOptions.Options = _activeProfile.displayOptions.Clone(); + DialogOptions.ShowDialog(); TopMost = cbStayOnTop.Checked; - if (_config.Result == DialogResult.OK) + if (DialogOptions.Result == DialogResult.OK) { - _activeProfile.displayOptions = _config.Options.Clone(); + _activeProfile.displayOptions = DialogOptions.Options.Clone(); SaveThisProfile(); lbInput.BackColor = _activeProfile.displayOptions.inputBackground; @@ -495,8 +551,10 @@ private void BtnColorConfig_Click(object sender, EventArgs e) { _filterFrontBrush[f] = new SolidBrush(_activeProfile.displayOptions.filter[f].foreColor); _filterBackBrush[f] = new SolidBrush(_activeProfile.displayOptions.filter[f].backColor); + _filterMacro[f] = _activeProfile.displayOptions.filter[f].macro; } } + DialogOptions = null; } btnColorConfig.Enabled = true; lbInput.Refresh(); @@ -614,6 +672,7 @@ private void DoConnectDisconnect() MessageBox.Show("Please configure a port", "Port not configured", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } + _macroTriggerString.Clear(); btnConnect.Enabled = false; _cancelRestart = true; if (_state == State.Disconnected) @@ -911,6 +970,16 @@ private void RestartAllMacros() RestartMacro(m); } + private void ChangeMacroButtonColor(int m, Color color) + { + if (m < _macroOffset || m > (_macroOffset + 48)) return; + + int num = m - _macroOffset; + int col = (num % 12) + 1; + int row = (num / 12) + 1; + dgMacroTable.Rows[row].Cells[col].Style.BackColor = color; + } + private void MacroThread() { int m = Utils.Int(Thread.CurrentThread.Name); @@ -921,6 +990,7 @@ private void MacroThread() { while (!_terminateFlag) { + _macroTriggeredByFilter[m] = false; _macroBusy[m] = false; _macroTrigger[m].WaitOne(); Thread.Sleep(10); @@ -939,7 +1009,7 @@ private void MacroThread() if (mac.runLines.Length == 0) continue; - dgMacroTable.Rows[mac.uiRow].Cells[mac.uiColumn].Style.BackColor = Color.Tomato; + ChangeMacroButtonColor(m, Color.Tomato); _macroBusy[m] = true; int repeatCount = 0; @@ -994,6 +1064,48 @@ private void MacroThread() line = mac.runLines[x]; } + // detect #FREEZE nn + cmdIndex = line.IndexOf("#FREEZE"); + if (cmdIndex >= 0) + { + line = line.TrimEnd(); + if (line.StartsWith("#FREEZE")) + { + _freezeTriggeredFromMacro = true; + } + + // restore and continue + line = mac.runLines[x]; + } + + // detect #DTR nn + cmdIndex = line.IndexOf("#DTR"); + if (cmdIndex >= 0) + { + line = line.TrimEnd(); + if (line.StartsWith("#DTR")) + { + _comms.ControlPressed(0); + } + + // restore and continue + line = mac.runLines[x]; + } + + // detect #RTS nn + cmdIndex = line.IndexOf("#RTS"); + if (cmdIndex >= 0) + { + line = line.TrimEnd(); + if (line.StartsWith("#RTS")) + { + _comms.ControlPressed(1); + } + + // restore and continue + line = mac.runLines[x]; + } + // double comments go to input stream as well int noteStart = line.IndexOf("##"); if (noteStart >= 0) @@ -1050,7 +1162,7 @@ private void MacroThread() break; Thread.Sleep(mac.resendEveryMs); } - dgMacroTable.Rows[mac.uiRow].Cells[mac.uiColumn].Style.BackColor = Color.White; + ChangeMacroButtonColor(m, Color.White); } } catch { } @@ -1107,20 +1219,25 @@ private void FrmMain_Load(object sender, EventArgs e) lbInput.Items.Add(string.Empty); _lineFinished = false; - ////Rectangle rec = Screen.GetWorkingArea(System.Windows.Forms.Cursor.Position); - ////this.Width = (rec.Width * 3) / 4; - ////this.Height = (rec.Height * 3) / 4; - + _btnGroups[0] = btnGroup1; + _btnGroups[1] = btnGroup2; + _btnGroups[2] = btnGroup3; + _btnGroups[3] = btnGroup4; this.CenterToScreen(); } private int FindMacro(string title) { + if (title.Length == 0) return -1; + for (int m = 0; m < _activeProfile.macros.Length; m++) { Macro mac = _activeProfile.macros[m]; - if (mac.title.Equals(title)) - return m; + if (mac != null) + { + if (mac.title.Equals(title)) + return m; + } } return -1; } @@ -1268,15 +1385,18 @@ private void SaveThisProfile() private void ShowMacroTitles() { int i = _macroOffset; - for (int r = 1; r <= 4; r++) + for (int mRow = 1; mRow <= 4; mRow++) { - for (int f = 1; f <= 12; f++) + for (int mCol = 1; mCol <= 12; mCol++) { Macro m = _activeProfile.macros[i++]; - if (m == null) - dgMacroTable.Rows[r].Cells[f].Value = string.Empty; - else - dgMacroTable.Rows[r].Cells[f].Value = m.title; + if (m != null) + { + if (m == null) + dgMacroTable.Rows[mRow].Cells[mCol].Value = string.Empty; + else + dgMacroTable.Rows[mRow].Cells[mCol].Value = m.title; + } } } } @@ -1310,6 +1430,7 @@ private void SwitchToProfile(string name) { _filterFrontBrush[f] = new SolidBrush(_activeProfile.displayOptions.filter[f].foreColor); _filterBackBrush[f] = new SolidBrush(_activeProfile.displayOptions.filter[f].backColor); + _filterMacro[f] = _activeProfile.displayOptions.filter[f].macro; } btnProfile.Text = _activeProfile.name; @@ -1326,6 +1447,12 @@ private void SwitchToProfile(string name) cbShowCR.Checked = _activeProfile.embellishments.ShowCR; cbShowLF.Checked = _activeProfile.embellishments.ShowLF; + for (int f = 1; f <= 12; f++) + dgMacroTable.Rows[0].Cells[f].Style.BackColor = btnGroup1.BackColor; + + for (int r = 0; r <= 4; r++) + dgMacroTable.Rows[r].Cells[0].Style.BackColor = btnGroup1.BackColor; + UnFreeze(); ShowMacroTitles(); RefreshPortPulldown(); @@ -1585,6 +1712,12 @@ private void TickHandler() if (_terminateFlag) return; + if (_freezeTriggeredFromMacro) + { + _freezeTriggeredFromMacro = false; + BtnFreeze_Click(new object(), new EventArgs()); + } + dgMacroTable.ClearSelection(); if (_comms == null) return; @@ -2449,6 +2582,15 @@ private void cbSendAsIType_CheckedChanged(object sender, EventArgs e) tbCommand.Focus(); } + private void ShowButtonColours(int N) + { + for (int f = 1; f <= 12; f++) + dgMacroTable.Rows[0].Cells[f].Style.BackColor = _btnGroups[N].BackColor; + + for (int r = 0; r <= 4; r++) + dgMacroTable.Rows[r].Cells[0].Style.BackColor = _btnGroups[N].BackColor; + } + private void SetMacroOffset(int N) { _macroLabel = (char)('A' + N); @@ -2459,25 +2601,27 @@ private void SetMacroOffset(int N) dgMacroTable.Rows[0].Cells[f].Value = $"{labelNumber}"; labelNumber++; } + ShowButtonColours(N); ShowMacroTitles(); tbCommand.Focus(); } - private void btnGroup1_Click(object sender, EventArgs e) + + private void btnGroup1_MouseDown(object sender, MouseEventArgs e) { SetMacroOffset(0); } - private void btnGroup2_Click(object sender, EventArgs e) + private void btnGroup2_MouseDown(object sender, MouseEventArgs e) { SetMacroOffset(1); } - private void btnGroup3_Click(object sender, EventArgs e) + private void btnGroup3_MouseDown(object sender, MouseEventArgs e) { SetMacroOffset(2); } - private void btnGroup4_Click(object sender, EventArgs e) + private void btnGroup4_MouseDown(object sender, MouseEventArgs e) { SetMacroOffset(3); } diff --git a/Terminal2/FrmMain.resx b/Terminal2/FrmMain.resx index 592f993..98aad5b 100644 --- a/Terminal2/FrmMain.resx +++ b/Terminal2/FrmMain.resx @@ -199,6 +199,9 @@ 376, 14 + + 499, 14 + AAABAAgAAAAAAAEAIABqlgAAhgAAAICAAAABACAAKAgBAPCWAABISAAAAQAgAIhUAAAYnwEAQEAAAAEA diff --git a/Terminal2/FrmNumber.Designer.cs b/Terminal2/FrmNumber.Designer.cs index 3f0d54f..ba4b8eb 100644 --- a/Terminal2/FrmNumber.Designer.cs +++ b/Terminal2/FrmNumber.Designer.cs @@ -140,7 +140,6 @@ private void InitializeComponent() this.Controls.Add(this.ASCIIcharacter); this.Controls.Add(this.DecValue); this.Controls.Add(this.HexValue); - this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; diff --git a/Terminal2/FrmVertical.Designer.cs b/Terminal2/FrmVertical.Designer.cs index 476d7fc..1d6b4e6 100644 --- a/Terminal2/FrmVertical.Designer.cs +++ b/Terminal2/FrmVertical.Designer.cs @@ -163,7 +163,6 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(207, 498); this.Controls.Add(this.grid); - this.DoubleBuffered = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; diff --git a/Terminal2/Options.cs b/Terminal2/Options.cs index e8c2cc3..c88c2c8 100644 --- a/Terminal2/Options.cs +++ b/Terminal2/Options.cs @@ -25,6 +25,8 @@ using System.ComponentModel; using System.Drawing; +using static System.Net.Mime.MediaTypeNames; + namespace Terminal { public class ConOptions @@ -92,7 +94,7 @@ public class Macro public Macro Clone() { - return (Macro)MemberwiseClone(); + return (Macro)this.MemberwiseClone(); } } @@ -102,10 +104,7 @@ public class ColorFilter public string text = string.Empty; public Color foreColor = Color.Black; public Color backColor = Color.White; - public ColorFilter Clone() - { - return (ColorFilter)MemberwiseClone(); - } + public string macro = string.Empty; } public class DisplayOptions @@ -133,13 +132,28 @@ public DisplayOptions() public DisplayOptions Clone() { - DisplayOptions opt = (DisplayOptions)this.MemberwiseClone(); - for (int dl = 0; dl < filter.Length; dl++) + DisplayOptions opt = new DisplayOptions(); + opt.inputFont = inputFont; + opt.outputFont = outputFont; + opt.inputDefaultForeground = inputDefaultForeground; + opt.inputBackground = inputBackground; + opt.IgnoreCase = IgnoreCase; + opt.outputBackground = outputBackground; + opt.ShowOutputTimestamp = ShowOutputTimestamp; + + for (int f = 0; f < filter.Length; f++) { - if (filter[dl] != null) - opt.filter[dl] = filter[dl].Clone(); + if (filter[f] != null) + { + opt.filter[f] = new ColorFilter(); + opt.filter[f].mode = filter[f].mode; + opt.filter[f].text = filter[f].text; + opt.filter[f].foreColor = filter[f].foreColor; + opt.filter[f].backColor = filter[f].backColor; + opt.filter[f].macro = filter[f].macro; + } else - opt.filter[dl] = null; + opt.filter[f] = null; } return opt; } diff --git a/Terminal2/Properties/AssemblyInfo.cs b/Terminal2/Properties/AssemblyInfo.cs index f86ec12..930c880 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.4")] -[assembly: AssemblyFileVersion("1.3.4.4")] +[assembly: AssemblyVersion("1.3.5.2")] +[assembly: AssemblyFileVersion("1.3.5.2")] namespace Terminal { diff --git a/Terminal2/Properties/app.manifest b/Terminal2/Properties/app.manifest index d6818bd..2fedfcf 100644 --- a/Terminal2/Properties/app.manifest +++ b/Terminal2/Properties/app.manifest @@ -54,18 +54,4 @@ - \ No newline at end of file diff --git a/Terminal2/frmASCII.Designer.cs b/Terminal2/frmASCII.Designer.cs index 104d94e..a40a8e4 100644 --- a/Terminal2/frmASCII.Designer.cs +++ b/Terminal2/frmASCII.Designer.cs @@ -70,7 +70,6 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(157, 436); this.Controls.Add(this.helpASCII); - this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false;