Skip to content

Commit 02b9e53

Browse files
committed
Allow user to change default font
1 parent b8d23c4 commit 02b9e53

File tree

8 files changed

+49
-5
lines changed

8 files changed

+49
-5
lines changed

Text Editor/AboutForm.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Text Editor/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
<setting name="EnableWordWrap" serializeAs="String">
1414
<value>False</value>
1515
</setting>
16+
<setting name="Font" serializeAs="String">
17+
<value>Consolas, 11.25pt</value>
18+
</setting>
1619
</Text_Editor.Properties.Settings>
1720
</userSettings>
1821
</configuration>

Text Editor/Form1.Designer.cs

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Text Editor/Form1.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public Form1()
2121
InitializeComponent();
2222
menuItem18.Checked = Properties.Settings.Default.EnableWordWrap;
2323
mainEditor.WordWrap = Properties.Settings.Default.EnableWordWrap;
24+
mainEditor.Font = Properties.Settings.Default.Font;
2425
}
2526

2627
public Form1(string fileName) : this()
@@ -274,5 +275,19 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e)
274275
}
275276
}
276277
}
278+
279+
private void menuItem29_Click(object sender, EventArgs e)
280+
{
281+
using (FontDialog fd = new FontDialog() { Font = Properties.Settings.Default.Font })
282+
{
283+
if (fd.ShowDialog() == DialogResult.OK)
284+
{
285+
Properties.Settings.Default.Font = fd.Font;
286+
Properties.Settings.Default.Save();
287+
mainEditor.Font = Properties.Settings.Default.Font;
288+
this.Text = this.Text.Replace("*", "");
289+
}
290+
}
291+
}
277292
}
278293
}
1.62 MB
Binary file not shown.

Text Editor/Inno/installer.iss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

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

5052
[Icons]

Text Editor/Properties/Settings.Designer.cs

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Text Editor/Properties/Settings.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
<Setting Name="EnableWordWrap" Type="System.Boolean" Scope="User">
66
<Value Profile="(Default)">False</Value>
77
</Setting>
8+
<Setting Name="Font" Type="System.Drawing.Font" Scope="User">
9+
<Value Profile="(Default)">Consolas, 11.25pt</Value>
10+
</Setting>
811
</Settings>
912
</SettingsFile>

0 commit comments

Comments
 (0)