From d94c79dbf5183230e5fd3342848408f776de60ea Mon Sep 17 00:00:00 2001 From: Richie Moch Date: Sat, 22 Dec 2018 15:24:55 -0600 Subject: Various changes, began working on the texture skinning. --- ShiftOS.Main/MainGame/Apps/TextPad.cs | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 ShiftOS.Main/MainGame/Apps/TextPad.cs (limited to 'ShiftOS.Main/MainGame/Apps/TextPad.cs') diff --git a/ShiftOS.Main/MainGame/Apps/TextPad.cs b/ShiftOS.Main/MainGame/Apps/TextPad.cs new file mode 100644 index 0000000..66863cf --- /dev/null +++ b/ShiftOS.Main/MainGame/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.ShiftOS.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 -- cgit v1.2.3