Skip to content

Commit

Permalink
v1.3.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-heyns committed Jun 23, 2024
1 parent 1641d6c commit b233de4
Show file tree
Hide file tree
Showing 23 changed files with 656 additions and 214 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion Terminal2/Comms.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Terminal2
*
* Copyright © 2022-23-23 Michael Heyns
* Copyright © 2021-2024 Michael Heyns
*
* This file is part of Terminal2.
*
Expand Down
11 changes: 9 additions & 2 deletions Terminal2/Database.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Terminal2
*
* Copyright © 2022-23-23 Michael Heyns
* Copyright © 2021-2024 Michael Heyns
*
* This file is part of Terminal2.
*
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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);
}

}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Terminal2/EventQueue.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Terminal2
*
* Copyright © 2022-23-23 Michael Heyns
* Copyright © 2021-2024 Michael Heyns
*
* This file is part of Terminal2.
*
Expand Down
2 changes: 1 addition & 1 deletion Terminal2/FrmConnectOptions.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Terminal2/FrmConnectOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Terminal2
*
* Copyright © 2022-23-23 Michael Heyns
* Copyright © 2021-2024 Michael Heyns
*
* This file is part of Terminal2.
*
Expand Down
300 changes: 267 additions & 33 deletions Terminal2/FrmDisplayOptions.Designer.cs

Large diffs are not rendered by default.

156 changes: 103 additions & 53 deletions Terminal2/FrmDisplayOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Terminal2
*
* Copyright © 2022-23-23 Michael Heyns
* Copyright © 2021-2024 Michael Heyns
*
* This file is part of Terminal2.
*
Expand Down Expand Up @@ -35,6 +35,7 @@ public partial class FrmDisplayOptions : Form
{
public DisplayOptions Options;
public DialogResult Result = DialogResult.Cancel;
public List<string> MacroNames = new List<string>();

public readonly ComboBox[] ModeList;
public readonly TextBox[] TextList;
Expand All @@ -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()
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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)
Expand All @@ -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();
}

Expand All @@ -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();
}
}
}
2 changes: 1 addition & 1 deletion Terminal2/FrmFileSend.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Terminal2
*
* Copyright © 2022-23-23 Michael Heyns
* Copyright © 2021-2024 Michael Heyns
*
* This file is part of Terminal2.
*
Expand Down
9 changes: 8 additions & 1 deletion Terminal2/FrmHelp.resx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,14 @@ Source Code:
----</value>
</data>
<data name="textBox1.Text" xml:space="preserve">
<value>v1.3.4.4
<value>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

Expand Down
1 change: 0 additions & 1 deletion Terminal2/FrmHorizontal.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Terminal2/FrmInspect.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Terminal2/FrmMacroOptions.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Terminal2/FrmMacroOptions.resx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit b233de4

Please sign in to comment.