ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.ScratchPad/ScratchPad.cs
(Generate patch)

Comparing trunk/RomCheater.ScratchPad/ScratchPad.cs (file contents):
Revision 774 by william, Thu Jun 20 22:33:04 2013 UTC vs.
Revision 775 by william, Thu Jun 20 22:59:40 2013 UTC

--- 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 @@ namespace RomCheater.ScratchPad
             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)