/[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

--- branches/mono/EmuXPortal/Form1.cs	2016/03/17 07:09:39	271
+++ branches/mono/EmuXPortal/Form1.cs	2016/03/17 07:49:41	272
@@ -2,6 +2,7 @@
 
 //#define DISABLE_CURSOR_HIDE // when this is present, the cursor will not be hidden
 //#define DISABLE_PROGRESS_PERCENTAGE_MESSASGE // when this is present, no progress percent message will be shown on any progressbar
+
 #define DISABLE_RELEASE_MODE_KLOGLEVEL_DEBUG // when defined will turn off kLogLevel_Debug messages, in release mode
 //#define DISABLE_DEBUG_MODE_KLOGLEVEL_VERBOSE_DEBUG // when defined will turn off kLogLevel_VerboseDebug message, in debug mode
 using System;
@@ -19,6 +20,7 @@
 using Utilities.TransparentControls;
 using Enterprise.Logging;
 using System.IO;
+using Enterprise.CrossPlatform;
 
 namespace EmuXPortal
 {
@@ -228,6 +230,22 @@
                 return; // stop processing other keys
 
             }
+			if (e.KeyCode == Keys.Up) {
+				if (OSInfo.OSIsUnix) {
+					rom_flow.SuspendLayout ();
+					var ctl = game_ctrl_get_previous_control (true);
+					rom_flow.ScrollControlIntoView (ctl);
+					rom_flow.ResumeLayout (false);
+				}
+			}
+			if (e.KeyCode == Keys.Down) {
+				if (OSInfo.OSIsUnix) {
+					rom_flow.SuspendLayout ();
+					var ctl = game_ctrl_get_next_control (true);
+					rom_flow.ScrollControlIntoView (ctl);
+					rom_flow.ResumeLayout (false);
+				}
+			}		
             if (e.KeyCode == Keys.Home)
             {
                 rom_flow.SuspendLayout();
@@ -367,6 +385,22 @@
             PlatformControl c = sender as PlatformControl;
             int changeAmount = 0;
             int currentPosition = 0;
+			if (e.KeyCode == Keys.Up) {
+				if (OSInfo.OSIsUnix) {
+					platform_flow.SuspendLayout ();
+					var ctl = platform_ctrl_get_previous_control (true);
+					platform_flow.ScrollControlIntoView (ctl);
+					platform_flow.ResumeLayout (false);
+				}
+			}
+			if (e.KeyCode == Keys.Down) {
+				if (OSInfo.OSIsUnix) {
+					platform_flow.SuspendLayout ();
+					var ctl = platform_ctrl_get_next_control (true);
+					platform_flow.ScrollControlIntoView (ctl);
+					platform_flow.ResumeLayout (false);
+				}
+			}
             if (e.KeyCode == Keys.Home)
             {
                 platform_flow.SuspendLayout();
@@ -538,6 +572,78 @@
             }
             return s;
         }
+		private PlatformControl platform_ctrl_get_next_control(bool update_control)
+		{
+			PlatformControl s = new PlatformControl();
+			int index = platform_flow.Controls.IndexOf (CurrentPlatformControl);
+			index = index + 1;
+			if (index < 0) {
+				index = platform_flow.Controls.Count-1;
+			}
+			if (index > platform_flow.Controls.Count-1) {
+				index = 0;
+			}
+			s = platform_flow.Controls [index] as PlatformControl;
+			if (update_control) {
+				CurrentPlatformControl = s;
+				s.Select ();
+			}
+			return s;
+		}
+		private PlatformControl platform_ctrl_get_previous_control(bool update_control)
+		{
+			PlatformControl s = null;
+			int index = platform_flow.Controls.IndexOf (CurrentPlatformControl);
+			index = index - 1;
+			if (index < 0) {
+				index = platform_flow.Controls.Count-1;
+			}
+			if (index > platform_flow.Controls.Count-1) {
+				index = 0;
+			}
+			s = platform_flow.Controls [index] as PlatformControl;
+			if (update_control) {
+				CurrentPlatformControl = s;
+				s.Select ();
+			}
+			return s;
+		}
+		private GameControl game_ctrl_get_next_control(bool update_control)
+		{
+			GameControl s = new GameControl();
+			int index = rom_flow.Controls.IndexOf (CurrentGameControl);
+			index = index + 1;
+			if (index < 0) {
+				index = rom_flow.Controls.Count-1;
+			}
+			if (index > rom_flow.Controls.Count-1) {
+				index = 0;
+			}
+			s = rom_flow.Controls [index] as GameControl;
+			if (update_control) {
+				CurrentGameControl = s;
+				s.Select ();
+			}
+			return s;
+		}
+		private GameControl game_ctrl_get_previous_control(bool update_control)
+		{
+			GameControl s = new GameControl();
+			int index = rom_flow.Controls.IndexOf (CurrentGameControl);
+			index = index - 1;
+			if (index < 0) {
+				index = rom_flow.Controls.Count-1;
+			}
+			if (index > rom_flow.Controls.Count-1) {
+				index = 0;
+			}
+			s = rom_flow.Controls [index] as GameControl;
+			if (update_control) {
+				CurrentGameControl = s;
+				s.Select ();
+			}
+			return s;
+		}
       
 
         #region Background Workers

 

  ViewVC Help
Powered by ViewVC 1.1.22