diff options
Diffstat (limited to 'Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs')
| -rw-r--r-- | Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs | 46 |
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 |
