/[RomCheater]/trunk/RomCheater.ScratchPad/ScratchPadDocument.cs
ViewVC logotype

Diff of /trunk/RomCheater.ScratchPad/ScratchPadDocument.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater.ScratchPad/ScratchPadDocument.cs	2013/06/20 23:10:49	777
+++ trunk/RomCheater.ScratchPad/ScratchPadDocument.cs	2013/06/20 23:21:37	778
@@ -32,6 +32,7 @@
             this.DocumentTab.Text = string.Format("{0}{1}", this.DocumentFilename, this.DocumentIndex);
             //this.DocumentClosing += new BaseEventHandler<ControlClosingEventArgs<int>>(ScratchPadDocument_DocumentClosing);
             this.IsDefaultDocument = true;
+            this.DocumentSaved = true;
             this.DocumentTab.Controls.Add(this);
         }
 
@@ -89,6 +90,7 @@
         private void mnuItemOpen_Click(object sender, EventArgs e)
         {
             OpenDocument();
+            this.DocumentSaved = true; // the file was just opened
         }
 
         private void mnuItemSave_Click(object sender, EventArgs e)
@@ -129,6 +131,7 @@
                                 txtEditor.Document.ReParse();
                                 this.UpdateTabName(fi.Name);
                                 this.IsDefaultDocument = false;
+                                this.DocumentSaved = true;
                             }
                             catch (Exception ex)
                             {
@@ -144,6 +147,7 @@
             }
             catch (Exception ex)
             {
+                this.DocumentSaved = false;
                 MessageBox.Show(string.Format("Failed to open: '{0}'", fi.Name), "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 logger.Error.WriteLine("Failed to open: '{0}'", fi.FullName);
                 logger.Error.WriteLine(ex.ToString());

 

  ViewVC Help
Powered by ViewVC 1.1.22