/[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:21:37	778
+++ trunk/RomCheater.ScratchPad/ScratchPadDocument.cs	2013/06/21 04:26:36	783
@@ -10,15 +10,15 @@
 using RomCheater.Core;
 using System.IO;
 using RomCheater.Logging;
-using Fireball.CodeEditor.SyntaxFiles;
 
 namespace RomCheater.ScratchPad
 {
     public partial class ScratchPadDocument : UserControl
-    {
+    {        
+        public event EventHandler<LinkClickedEventArgs> LinkClicked;
         public event BaseEventHandler<ControlClosingEventArgs<int>> DocumentClosing;
 
-        const string NewDocumentFilename = "New";
+        const string NewDocumentFilename = "ScratchPad";
         public ScratchPadDocument() : this(NewDocumentFilename, new TabPage(), 0) { }
         public ScratchPadDocument(TabPage tp, int index) : this(NewDocumentFilename, tp, index) { }
         public ScratchPadDocument(int index) : this(NewDocumentFilename, new TabPage(), index) { }
@@ -87,6 +87,22 @@
             }
         }
 
+        public override Font Font
+        {
+            get
+            {
+                return base.Font;
+            }
+            set
+            {
+                base.Font = value;
+                txtEditor.Font = base.Font;
+                mnuItemClose.Font = base.Font;
+                mnuItemOpen.Font = base.Font;
+                mnuItemSave.Font = base.Font;
+            }
+        }
+
         private void mnuItemOpen_Click(object sender, EventArgs e)
         {
             OpenDocument();
@@ -123,12 +139,7 @@
                             {
                                 var text = sr.ReadToEnd();           
                                 sr.Close();
-
-                                txtEditor.Document = new Fireball.Syntax.SyntaxDocument();
-                                txtEditor.Document.Text = text;                                
-                                SyntaxLanguage language = SyntaxLanguage.Text;
-                                CodeEditorSyntaxLoader.SetSyntax(txtEditor, language);
-                                txtEditor.Document.ReParse();
+                                txtEditor.Text = text;                                
                                 this.UpdateTabName(fi.Name);
                                 this.IsDefaultDocument = false;
                                 this.DocumentSaved = true;
@@ -176,7 +187,7 @@
                         {
                             try
                             {
-                                foreach (var t in txtEditor.Document.Lines)
+                                foreach (var t in txtEditor.Lines)
                                 {
                                     sw.WriteLine(t);
                                 }
@@ -223,5 +234,13 @@
         {
             this.DocumentSaved = false;
         }
+
+        private void txtEditor_LinkClicked(object sender, LinkClickedEventArgs e)
+        {
+            if (this.LinkClicked != null)
+            {
+                this.LinkClicked.Invoke(sender, e);
+            }
+        }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22