diff options
| author | Richie Moch <[email protected]> | 2018-12-23 19:15:07 -0600 |
|---|---|---|
| committer | Richie Moch <[email protected]> | 2018-12-23 19:15:07 -0600 |
| commit | bca879db94bc6395dbfa77628747080311fdb226 (patch) | |
| tree | 24103811cd3df0957f2450bbe579e05d7dc7c4e6 /ShiftOS.Main/Apps/TextPad.cs | |
| parent | d94c79dbf5183230e5fd3342848408f776de60ea (diff) | |
| download | shiftos-rewind-bca879db94bc6395dbfa77628747080311fdb226.tar.gz shiftos-rewind-bca879db94bc6395dbfa77628747080311fdb226.tar.bz2 shiftos-rewind-bca879db94bc6395dbfa77628747080311fdb226.zip | |
started work on the pong, implemented "ShiftToolStrip". (note: pong is very buggy)
Diffstat (limited to 'ShiftOS.Main/Apps/TextPad.cs')
| -rw-r--r-- | ShiftOS.Main/Apps/TextPad.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ShiftOS.Main/Apps/TextPad.cs b/ShiftOS.Main/Apps/TextPad.cs new file mode 100644 index 0000000..ee4a379 --- /dev/null +++ b/ShiftOS.Main/Apps/TextPad.cs @@ -0,0 +1,40 @@ +using ShiftOS.Engine.ShiftFS.FileGUI; +using ShiftOS.Engine.WindowManager; +using System; +using System.IO; +using System.Windows.Forms; + +namespace ShiftOS.Main.Apps +{ + public partial class TextPad : UserControl + { + readonly string _editedText; + + public TextPad() + { + InitializeComponent(); + _editedText = textBox.Text; + } + + bool IsEdited() => _editedText != textBox.Text; + + void openToolStripMenuItem_Click(object sender, EventArgs e) + { + if (openFileDialog1.ShowDialog() != DialogResult.OK) return; + + var sr = new StreamReader(openFileDialog1.FileName); + textBox.Text = sr.ReadToEnd(); + sr.Close(); + } + + void newToolStripMenuItem_Click(object sender, EventArgs e) + { + if (IsEdited()) + { + MessageBox.Show("yay it works"); + } + var f = new FileOpener(); + ShiftWM.Init(f, "testing", null); + } + } +}
\ No newline at end of file |
