Skip to content

Commit

Permalink
Add search-and-replace functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary-Rude committed Dec 19, 2021
1 parent b15c147 commit 25f5907
Show file tree
Hide file tree
Showing 14 changed files with 320 additions and 6 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified Text Editor Setup/Text Editor Setup-cache/cacheIndex.txt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions Text Editor Setup/Text Editor Setup.aip
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]." ValueLocId="*"/>
<ROW Property="ARPPRODUCTICON" Value="icon72.exe" Type="8"/>
<ROW Property="Manufacturer" Value="Zach, Inc."/>
<ROW Property="ProductCode" Value="1033:{8D8754D1-3E4C-4777-AA4B-4B8A8E046CE9} " Type="16"/>
<ROW Property="ProductCode" Value="1033:{2C39E84D-4784-46EC-BDE7-1453512F0D8B} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="Text Editor"/>
<ROW Property="ProductVersion" Value="1.0.0" Type="32"/>
<ROW Property="ProductVersion" Value="1.0.2" Type="32"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
<ROW Property="UpgradeCode" Value="{6F659083-3442-43A7-8DA3-D7192D778487}"/>
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>
Expand Down Expand Up @@ -55,7 +55,7 @@
<ROW BootstrOptKey="GlobalOptions" DownloadFolder="[AppDataFolder][|Manufacturer]\[|ProductName]\prerequisites" Options="2"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.BuildComponent">
<ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFileName="Text_Editor_1_0_0_Setup" Languages="en" InstallationType="4" UseLargeSchema="true"/>
<ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFileName="Text_Editor_1_0_2_Setup" Languages="en" InstallationType="4" UseLargeSchema="true"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent">
<ROW Path="&lt;AI_DICTS&gt;ui.ail"/>
Expand Down
2 changes: 1 addition & 1 deletion Text Editor/AboutForm.Designer.cs

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

22 changes: 20 additions & 2 deletions Text Editor/Form1.Designer.cs

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

18 changes: 18 additions & 0 deletions Text Editor/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ public Form1()
{
InitializeComponent();
menuItem18.Checked = Properties.Settings.Default.EnableWordWrap;
mainEditor.WordWrap = Properties.Settings.Default.EnableWordWrap;
}

public static void QuickReplace(RichTextBox rtb, String word, String word2)
{
rtb.Text = rtb.Text.Replace(word, word2);
}

private void menuItem2_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -158,6 +164,7 @@ private void menuItem18_Click(object sender, EventArgs e)
menuItem18.Checked = !menuItem18.Checked;
Properties.Settings.Default.EnableWordWrap = menuItem18.Checked;
Properties.Settings.Default.Save();
mainEditor.WordWrap = Properties.Settings.Default.EnableWordWrap;
}

private void menuItem20_Click(object sender, EventArgs e)
Expand All @@ -180,5 +187,16 @@ private void menuItem24_Click(object sender, EventArgs e)
AboutForm aboutForm = new AboutForm();
aboutForm.ShowDialog();
}

private void menuItem26_Click(object sender, EventArgs e)
{
using (SearchForm searchForm = new SearchForm())
{
if (searchForm.ShowDialog() == DialogResult.OK)
{
QuickReplace(mainEditor, searchForm.txtSearchString.Text, searchForm.txtReplaceString.Text);
}
}
}
}
}
124 changes: 124 additions & 0 deletions Text Editor/SearchForm.Designer.cs

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

25 changes: 25 additions & 0 deletions Text Editor/SearchForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Text_Editor
{
public partial class SearchForm : Form
{
public SearchForm()
{
InitializeComponent();
string searchString = txtSearchString.Text;
string replaceString = txtReplaceString.Text;
}

public string searchString;
public string replaceString;
}
}
Loading

0 comments on commit 25f5907

Please sign in to comment.