/[EmuXPortal]/branches/mono/EmuXPortal/Form1.cs
ViewVC logotype

Diff of /branches/mono/EmuXPortal/Form1.cs

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

--- trunk/EmuXPortal/Form1.cs	2014/08/05 05:57:55	243
+++ trunk/EmuXPortal/Form1.cs	2014/08/05 06:33:52	246
@@ -216,16 +216,21 @@
             }
             if (e.KeyCode == Keys.Home)
             {
+                rom_flow.SuspendLayout();
                 rom_flow.Controls[0].Select();
                 rom_flow.ScrollControlIntoView(rom_flow.Controls[0]);
+                rom_flow.ResumeLayout(false);
             }
             if (e.KeyCode == Keys.End)
             {
+                rom_flow.SuspendLayout();
                 rom_flow.Controls[rom_flow.Controls.Count - 1].Select();
                 rom_flow.ScrollControlIntoView(rom_flow.Controls[rom_flow.Controls.Count - 1]);
+                rom_flow.ResumeLayout(false);
             }
             if (e.KeyCode == Keys.PageUp)
             {
+                rom_flow.SuspendLayout();
                 changeAmount = rom_flow.VerticalScroll.LargeChange;
                 currentPosition = rom_flow.VerticalScroll.Value;
                 if ((currentPosition - changeAmount) > rom_flow.VerticalScroll.Minimum)
@@ -250,10 +255,11 @@
                 GameControl s = game_ctrl_get_last_visible();
                 s.Select();
                 rom_flow.ScrollControlIntoView(s);
-                rom_flow.PerformLayout();
+                rom_flow.ResumeLayout(false);
             }
             if (e.KeyCode == Keys.PageDown)
             {
+                rom_flow.SuspendLayout();
                 changeAmount = rom_flow.VerticalScroll.LargeChange;
                 currentPosition = rom_flow.VerticalScroll.Value;
                 if ((currentPosition - changeAmount) < rom_flow.VerticalScroll.Maximum)
@@ -277,7 +283,7 @@
                 GameControl s = game_ctrl_get_last_visible();
                 s.Select();
                 rom_flow.ScrollControlIntoView(s);
-                rom_flow.PerformLayout();
+                rom_flow.ResumeLayout(false);
             }
 
             if (e.KeyCode == Keys.Enter)
@@ -306,6 +312,7 @@
             if ((e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z) ||
                 (e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9))
             {
+                rom_flow.SuspendLayout();
                 char t = (char)e.KeyCode;
                 GameControl ctrl = (rom_flow.GetNextControl(CurrentGameControl, true) as GameControl);
                 if (ctrl == null) { ctrl = (rom_flow.GetNextControl(rom_flow.Controls[0], true) as GameControl); }
@@ -337,6 +344,7 @@
                     }
                     pc = ctrl;
                 }
+                rom_flow.ResumeLayout(false);
             }
         }
         void platform_ctrl_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
@@ -346,16 +354,21 @@
             int currentPosition = 0;
             if (e.KeyCode == Keys.Home)
             {
+                platform_flow.SuspendLayout();
                 platform_flow.Controls[0].Select();
                 platform_flow.ScrollControlIntoView(platform_flow.Controls[0]);
+                platform_flow.ResumeLayout(false);
             }
             if (e.KeyCode == Keys.End)
             {
+                platform_flow.SuspendLayout();
                 platform_flow.Controls[platform_flow.Controls.Count -1].Select();
                 platform_flow.ScrollControlIntoView(platform_flow.Controls[platform_flow.Controls.Count - 1]);
+                platform_flow.ResumeLayout(false);
             }
             if (e.KeyCode == Keys.PageUp)
             {
+                platform_flow.SuspendLayout();
                 changeAmount = platform_flow.VerticalScroll.LargeChange;
                 currentPosition = platform_flow.VerticalScroll.Value;
                 if ((currentPosition - changeAmount) > platform_flow.VerticalScroll.Minimum)
@@ -369,10 +382,11 @@
                 PlatformControl s = platform_ctrl_get_last_visible();
                 s.Select();
                 platform_flow.ScrollControlIntoView(s);
-                platform_flow.PerformLayout();
+                platform_flow.ResumeLayout(false);
             }
             if (e.KeyCode == Keys.PageDown)
-            {              
+            {
+                platform_flow.SuspendLayout();
                 changeAmount = platform_flow.VerticalScroll.LargeChange;
                 currentPosition = platform_flow.VerticalScroll.Value;
                 if ((currentPosition - changeAmount) < platform_flow.VerticalScroll.Maximum)
@@ -397,7 +411,7 @@
                 PlatformControl s = platform_ctrl_get_last_visible();
                 s.Select();
                 platform_flow.ScrollControlIntoView(s);
-                platform_flow.PerformLayout();
+                platform_flow.ResumeLayout(false);
             }
             if (e.KeyCode == Keys.Enter)
             {
@@ -413,7 +427,8 @@
             }
             if ((e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z) ||
                 (e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9))
-            {                
+            {
+                platform_flow.SuspendLayout();
                 char t = (char)e.KeyCode;
                 PlatformControl ctrl = (platform_flow.GetNextControl(CurrentPlatformControl, true) as PlatformControl);
                 if (ctrl == null) { ctrl = (platform_flow.GetNextControl(platform_flow.Controls[0], true) as PlatformControl); }
@@ -445,6 +460,7 @@
                     }
                     pc = ctrl;
                 }
+                platform_flow.ResumeLayout(false);
             }
         }
 
@@ -582,6 +598,8 @@
             bar.ProgressColor = Color.LimeGreen;
             bar.Dock = DockStyle.Top;
 
+            if (rom_flow.InvokeRequired) { rom_flow.Invoke((MethodInvoker)delegate() { rom_flow.SuspendLayout(); }); } else { rom_flow.SuspendLayout(); }
+
             if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate() { this.Controls.Add(bar); }); }
             else { this.Controls.Add(bar); }
             bar.Invoke(new MethodInvoker(delegate { bar.Margin = new System.Windows.Forms.Padding(0); bar.Size = new Size(GetFormWidth() - 25, 100); }));
@@ -627,6 +645,7 @@
             bar.Invoke(new MethodInvoker(delegate { bar.Value = 1; bar.Update(); }));
             if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate() { this.Controls.Remove(bar); }); } else { this.Controls.Remove(bar); }
             e.Result = t;
+            if (rom_flow.InvokeRequired) { rom_flow.Invoke((MethodInvoker)delegate() { rom_flow.ResumeLayout(false); }); } else { rom_flow.ResumeLayout(false); }
             parser.Dispose();
         }
         private void gameWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { }
@@ -666,6 +685,9 @@
 #endif
             bar.ProgressColor = Color.LimeGreen;
             bar.Dock = DockStyle.Top;
+
+            if (platform_flow.InvokeRequired) { platform_flow.Invoke((MethodInvoker)delegate() { platform_flow.SuspendLayout(); }); } else { platform_flow.SuspendLayout(); }
+
             if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate() { this.Controls.Add(bar); }); }
             else { this.Controls.Add(bar); }
             bar.Invoke(new MethodInvoker(delegate { bar.Margin = new System.Windows.Forms.Padding(0); bar.Size = new Size(GetFormWidth() - 25, 100); }));
@@ -701,6 +723,7 @@
             bar.Invoke(new MethodInvoker(delegate { bar.Value = 1; bar.Update(); }));
             if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate() { this.Controls.Remove(bar); }); } else { this.Controls.Remove(bar); }
             e.Result = t;
+            if (platform_flow.InvokeRequired) { platform_flow.Invoke((MethodInvoker)delegate() { platform_flow.ResumeLayout(false); }); } else { platform_flow.ResumeLayout(false); }
             parser.Dispose();
         }
         private void platformWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { }

 

  ViewVC Help
Powered by ViewVC 1.1.22