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

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

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

--- trunk/RomCheater.ScratchPad/ScratchPad.cs	2013/06/20 22:33:04	774
+++ trunk/RomCheater.ScratchPad/ScratchPad.cs	2013/06/20 22:59:40	775
@@ -116,23 +116,28 @@
             catch { }
         }
 
+
+        private void AddDocument(ScratchPadDocument t)
+        {
+            t.DocumentClosing += new BaseEventHandler<ControlClosingEventArgs<int>>(t_DocumentClosing);
+            docuemntList.Add(t);
+            this.tb.TabPages.Add(t.DocumentTab);
+            t.Dock = DockStyle.Fill;
+        }
+
         private void mnuItemNew_Click(object sender, EventArgs e)
         {
             // create new document
             int tp_index = this.tb.TabPages.Count;
             ScratchPadDocument t = new ScratchPadDocument(tp_index);
-            t.DocumentClosing += new BaseEventHandler<ControlClosingEventArgs<int>>(t_DocumentClosing);
-            docuemntList.Add(t);
-            this.tb.TabPages.Add(t.DocumentTab);
+            AddDocument(t);
         }
 
         private void ScratchPad_Load(object sender, EventArgs e)
         {
             int tp_index = this.tb.TabPages.Count;
             ScratchPadDocument t = new ScratchPadDocument(tp_index);
-            t.DocumentClosing += new BaseEventHandler<ControlClosingEventArgs<int>>(t_DocumentClosing);
-            docuemntList.Add(t);
-            this.tb.TabPages.Add(t.DocumentTab);
+            AddDocument(t);
         }
 
         void t_DocumentClosing(ControlClosingEventArgs<int> e)

 

  ViewVC Help
Powered by ViewVC 1.1.22