Skip to content

Commit

Permalink
Allow user to change default font
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary-Rude committed Dec 22, 2021
1 parent b8d23c4 commit 02b9e53
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 5 deletions.
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.

3 changes: 3 additions & 0 deletions Text Editor/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<setting name="EnableWordWrap" serializeAs="String">
<value>False</value>
</setting>
<setting name="Font" serializeAs="String">
<value>Consolas, 11.25pt</value>
</setting>
</Text_Editor.Properties.Settings>
</userSettings>
</configuration>
11 changes: 10 additions & 1 deletion Text Editor/Form1.Designer.cs

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

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

public Form1(string fileName) : this()
Expand Down Expand Up @@ -274,5 +275,19 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e)
}
}
}

private void menuItem29_Click(object sender, EventArgs e)
{
using (FontDialog fd = new FontDialog() { Font = Properties.Settings.Default.Font })
{
if (fd.ShowDialog() == DialogResult.OK)
{
Properties.Settings.Default.Font = fd.Font;
Properties.Settings.Default.Save();
mainEditor.Font = Properties.Settings.Default.Font;
this.Text = this.Text.Replace("*", "");
}
}
}
}
}
Binary file added Text Editor/Inno/Text_Editor_1_1_3_Setup.exe
Binary file not shown.
8 changes: 5 additions & 3 deletions Text Editor/Inno/installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Text Editor"
#define MyAppVersion "1.1.2"
#define MyAppVersion "1.1.3"
#define MyAppPublisher "Zach, Inc."
#define MyAppExeName "Text Editor.exe"
#define MyAppAssocName "Text File"
Expand All @@ -17,14 +17,15 @@ AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName=C:\Program Files (x86)\{#MyAppName}
DefaultDirName={autopf}\{#MyAppName}
ChangesAssociations=yes
DisableProgramGroupPage=yes
DisableWelcomePage=no
LicenseFile=C:\Users\zacha\Documents\License Agreement.rtf
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=C:\Users\zacha\source\repos\Text Editor\Text Editor\Inno
OutputBaseFilename=Text_Editor_1_1_2_Setup
OutputBaseFilename=Text_Editor_1_1_3_Setup
Compression=lzma
SolidCompression=yes
WizardStyle=modern
Expand All @@ -45,6 +46,7 @@ Root: HKCR; Subkey: "{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; Value
Root: HKCR; Subkey: "{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
Root: HKCR; Subkey: "{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "C:\Windows\System32\imageres.dll,246"
Root: HKCR; Subkey: "{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
Root: HKCR; Subkey: "{#MyAppAssocKey}\shell\edit\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
Root: HKCR; Subkey: "Applications\{#MyAppExeName}\SupportedTypes"; ValueType: string; ValueName: ".txt"; ValueData: ""

[Icons]
Expand Down
12 changes: 12 additions & 0 deletions Text Editor/Properties/Settings.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 Text Editor/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
<Setting Name="EnableWordWrap" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Font" Type="System.Drawing.Font" Scope="User">
<Value Profile="(Default)">Consolas, 11.25pt</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit 02b9e53

Please sign in to comment.