/[EmuXPortal]/trunk/EmuXPortal/Form1.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Form1.cs

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

--- trunk/EmuXPortal/Form1.cs	2014/08/04 07:31:53	180
+++ trunk/EmuXPortal/Form1.cs	2014/08/04 08:10:19	181
@@ -1,4 +1,5 @@
-´╗┐using System;
+´╗┐#define DISABLE_CURSOR_HIDE // when this is present, the cursor will not be hidden
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
@@ -33,7 +34,15 @@
             Config.LoadConfig(log);
             Config.InitializePresentationForm(log,this);
         }
-        private void Form1_Shown(object sender, EventArgs e) { platform_flow.Visible = true; Cursor.Hide(); }
+        private void Form1_Shown(object sender, EventArgs e)
+        {
+            platform_flow.Visible = true;
+#if !DISABLE_CURSOR_HIDE
+            Cursor.Hide();
+#else 
+            Cursor.Show();
+#endif
+        }
         void platform_ctrl_LostFocus(object sender, EventArgs e)
         {
             PlatformControl c = sender as PlatformControl;
@@ -52,37 +61,6 @@
 
             int changeAmount = 0;
             int currentPosition = 0;
-            if (e.KeyCode == Keys.Up)
-            {
-                int index = 0;
-                var ctl = game_ctrl_get_selected(out index);
-                if (index == 0)
-                {
-                    rom_flow.Controls[index].Select();
-                    rom_flow.ScrollControlIntoView(rom_flow.Controls[index]);
-                }
-                else
-                {
-                    rom_flow.Controls[index].Select();
-                    rom_flow.ScrollControlIntoView(rom_flow.Controls[index]);
-                }
-            }
-            if (e.KeyCode == Keys.Down)
-            {
-                int index = 0;
-                var ctl = game_ctrl_get_selected(out index);
-                if (index == rom_flow.Controls.Count)
-                {
-                    rom_flow.Controls[0].Select();
-                    rom_flow.ScrollControlIntoView(rom_flow.Controls[0]);
-                }
-                else
-                {
-                    rom_flow.Controls[index].Select();
-                    rom_flow.ScrollControlIntoView(rom_flow.Controls[index]);
-                }
-            }
-
             if (e.KeyCode == Keys.F && e.Modifiers.HasFlag(Keys.Control))
             {
                 IRomConfig config = c.Tag as IRomConfig;
@@ -231,7 +209,7 @@
                 (e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9))
             {
                 char t = (char)e.KeyCode;
-                GameControl ctrl = (rom_flow.GetNextControl(CurrentPlatformControl, true) as GameControl);
+                GameControl ctrl = (rom_flow.GetNextControl(CurrentGameControl, true) as GameControl);
                 if (ctrl == null) { ctrl = (rom_flow.GetNextControl(rom_flow.Controls[0], true) as GameControl); }
                 bool found = false;
                 GameControl pc = CurrentGameControl;
@@ -268,36 +246,6 @@
             PlatformControl c = sender as PlatformControl;
             int changeAmount = 0;
             int currentPosition = 0;
-            if (e.KeyCode == Keys.Up)
-            {
-                int index = 0;
-                var ctl = platform_ctrl_get_selected(out index);
-                if (index == 0)
-                {
-                    platform_flow.Controls[index].Select();
-                    platform_flow.ScrollControlIntoView(platform_flow.Controls[index]);
-                }
-                else
-                {
-                    platform_flow.Controls[index].Select();
-                    platform_flow.ScrollControlIntoView(platform_flow.Controls[index]);
-                }
-            }
-            if (e.KeyCode == Keys.Down)
-            {
-                int index = 0;
-                var ctl = platform_ctrl_get_selected(out index);
-                if (index == platform_flow.Controls.Count)
-                {
-                    platform_flow.Controls[0].Select();
-                    platform_flow.ScrollControlIntoView(platform_flow.Controls[0]);
-                }
-                else
-                {
-                    platform_flow.Controls[index ].Select();
-                    platform_flow.ScrollControlIntoView(platform_flow.Controls[index]);
-                }
-            }
             if (e.KeyCode == Keys.Home)
             {
                 platform_flow.Controls[0].Select();
@@ -445,16 +393,6 @@
             }
             return s;
         }
-        private GameControl game_ctrl_get_selected(out int index)
-        {
-            index = rom_flow.Controls.IndexOf(CurrentGameControl);
-            return CurrentGameControl;
-        }
-        private PlatformControl platform_ctrl_get_selected(out int index)
-        {
-            index = platform_flow.Controls.IndexOf(CurrentPlatformControl);
-            return CurrentPlatformControl;
-        }
         private PlatformControl platform_ctrl_get_last_visible()
         {
             PlatformControl s = new PlatformControl();

 

  ViewVC Help
Powered by ViewVC 1.1.22