/[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/04 10:30:21	197
+++ trunk/EmuXPortal/Form1.cs	2014/08/04 10:37:13	198
@@ -541,30 +541,19 @@
         private void gameWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
         {
             Stopwatch t = e.Result as Stopwatch;
-            if (rom_flow.Controls.Count > 0)
-            {
-                rom_flow.Controls[0].Select();
-            }
-            else
+            if (rom_flow.Controls.Count == 0)
             {
                 GameControl game_ctrl = new GameControl();
+                game_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(game_ctrl_PreviewKeyDown);
+                game_ctrl.GotFocus += new EventHandler(game_ctrl_GotFocus);
+                game_ctrl.LostFocus += new EventHandler(game_ctrl_LostFocus);
                 game_ctrl.Font = GetFormFont();
                 game_ctrl.Dock = DockStyle.Top;
                 game_ctrl.Width = this.Width - 10;
-                //try
-                //{
-                //    lock (gameimage_lock)
-                //    {
-                //        game_ctrl.GameImage = (Image)DefaultGameImage.Clone();
-                //    }
-                //}
-                //catch (Exception ex)
-                //{
-                //    throw ex;
-                //}
                 game_ctrl.GameName = "You haven't favorited any games, select a game and then press CTRL+F to favorite it";
                 rom_flow.Controls.Add(game_ctrl);
             }
+            rom_flow.Controls[0].Select();
             t.Stop();
             log.WriteLine("RomParser took: {0}s to parse roms", (int)t.Elapsed.TotalSeconds);
         }
@@ -626,30 +615,19 @@
         private void platformWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
         {
             Stopwatch t = e.Result as Stopwatch;
-            if (platform_flow.Controls.Count > 0)
-            {
-                platform_flow.Controls[0].Select();
-            }
-            else
+            if (platform_flow.Controls.Count == 0)
             {
                 PlatformControl platform_ctrl = new PlatformControl();
+                platform_ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(platform_ctrl_PreviewKeyDown);
+                platform_ctrl.GotFocus += new EventHandler(platform_ctrl_GotFocus);
+                platform_ctrl.LostFocus += new EventHandler(platform_ctrl_LostFocus);
                 platform_ctrl.Font = GetFormFont();
                 platform_ctrl.Dock = DockStyle.Top;
                 platform_ctrl.Width = this.Width - 10;
-                //try
-                //{
-                //    lock (platformimage_lock)
-                //    {
-                //        platform_ctrl.PlatformImage = (Image)DefaultPlatformImage.Clone();
-                //    }
-                //}
-                //catch (Exception ex)
-                //{
-                //    throw ex;
-                //}
                 platform_ctrl.PlatformName = string.Format("You don't have any roms in your rompath: '{0}'",Config.RomPath);
                 platform_flow.Controls.Add(platform_ctrl);
             }
+            platform_flow.Controls[0].Select();
             log.WriteLine("PlatformParser took: {0}s to parse platforms", (int)t.Elapsed.TotalSeconds);
         }
         #endregion

 

  ViewVC Help
Powered by ViewVC 1.1.22