aboutsummaryrefslogtreecommitdiff
path: root/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-08-27 15:48:28 +0100
committerAlex-TIMEHACK <[email protected]>2017-08-27 15:48:28 +0100
commita751c8fcac0aab40de9cf0539fff65791da51f34 (patch)
treeff71b4556f20762aa9ebb8d68eca8d43ca5618b3 /Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs
parent1d2e7331e356f71547972f30b6bbbca4c40b35ae (diff)
downloadhistacom2-a751c8fcac0aab40de9cf0539fff65791da51f34.tar.gz
histacom2-a751c8fcac0aab40de9cf0539fff65791da51f34.tar.bz2
histacom2-a751c8fcac0aab40de9cf0539fff65791da51f34.zip
Fixed up a few things
Diffstat (limited to 'Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs')
-rw-r--r--Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs46
1 files changed, 46 insertions, 0 deletions
diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs
index 77d307b..05b5ec1 100644
--- a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs
+++ b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs
@@ -186,6 +186,7 @@ namespace Histacom2.OS.Win95.Win95Apps
try
{
mainText.LoadFile(selectedPath);
+ CurrentFilePath = selectedPath;
} catch
{
(new WindowManager()).StartInfobox95("Wordpad", "An error occured opening the file.", Engine.Template.InfoboxType.Error, Engine.Template.InfoboxButtons.OK);
@@ -233,5 +234,50 @@ namespace Histacom2.OS.Win95.Win95Apps
}
catch (Exception ex) { MessageBox.Show(ex.Message); }
}
+
+ private void btnNew_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private void btnOpen_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ ActivateOpenFileDialog(".rtf");
+ string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath();
+
+ if (selectedPath != null)
+ {
+ try
+ {
+ mainText.LoadFile(selectedPath);
+ }
+ catch
+ {
+ (new WindowManager()).StartInfobox95("Wordpad", "An error occured opening the file.", Engine.Template.InfoboxType.Error, Engine.Template.InfoboxButtons.OK);
+ }
+
+ }
+ }
+ catch
+ {
+ }
+ }
+
+ private void btnSave_Click(object sender, EventArgs e)
+ {
+ if (CurrentFilePath == "")
+ {
+ // We aren't in a file right now
+
+ SaveAs();
+ }
+ else
+ {
+ File.Delete(CurrentFilePath);
+ SaveRtfDocument(mainText, CurrentFilePath);
+ }
+ }
}
} \ No newline at end of file