|
From: <nic...@us...> - 2014-06-09 19:18:16
|
Revision: 4835
http://sourceforge.net/p/mp-plugins/code/4835
Author: nicsergio
Date: 2014-06-09 19:18:12 +0000 (Mon, 09 Jun 2014)
Log Message:
-----------
Modified Paths:
--------------
trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs 2014-06-09 14:16:11 UTC (rev 4834)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs 2014-06-09 19:18:12 UTC (rev 4835)
@@ -4,6 +4,8 @@
using MediaPortal.ExtensionMethods;
using MediaPortal.GUI.Library;
using My.Common;
+using System;
+using Action = MediaPortal.GUI.Library.Action;
namespace ShortCuter.Plugin
{
@@ -15,12 +17,9 @@
#endregion
#region Controlli Grafici
- [SkinControl(10)]
- protected GUIImage selectedIcon; //Icona elemento selezionato
- [SkinControl(11)]
- protected GUIThumbnailPanel panelView; //Pannello icone per visualizzazione alternativa a lista
- [SkinControl(20)]
- protected GUIImage logo; //Immagine logo Skin Navigator
+ [SkinControl(10)] protected GUIImage selectedIcon = null; //Icona elemento selezionato
+ [SkinControl(11)] protected GUIThumbnailPanel panelView = null; //Pannello icone per visualizzazione alternativa a lista
+ [SkinControl(20)] protected GUIImage logo = null; //Logo Skin Navigator
#endregion
#region Metodi Pubblici
@@ -54,22 +53,61 @@
public override bool OnMessage(GUIMessage message)
{
- if (message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_INIT) //& alternativeView
+ /*if (message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_INIT) //& alternativeView
{
//base.base.OnMessage();
return true;
}
- else
+ else*/
return base.OnMessage(message);
}
protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
{
base.OnClicked(controlId, control, actionType);
}
- public override void selectOption(string keySelected)
+ //public override void selectOption(string keySelected)
+ //{
+ // base.selectOption(keySelected);
+ //}
+
+ public override void OnAction(Action action)
{
- base.selectOption(keySelected);
+ char key = (char)0;
+
+ // if we have a keypress or a remote button press
+ if ((action.wID == Action.ActionType.ACTION_KEY_PRESSED) ||
+ ((Action.ActionType.REMOTE_0 <= action.wID) && (Action.ActionType.REMOTE_9 >= action.wID)))
+ {
+ if (action.m_key != null)
+ {
+ if (action.m_key.KeyChar >= '0' && action.m_key.KeyChar <= '9')
+ {
+ // Get offset to item
+ key = (char)action.m_key.KeyChar;
+ }
+ }
+ else
+ {
+ key = ((char)('0' + action.wID - Action.ActionType.REMOTE_0));
+ }
+ if (key == (char)0)
+ {
+ return;
+ }
+ keySelection += key;
+ if (keySelection.Length == listItems.Count.ToString().Length)
+ {
+ selectOption(keySelection);
+ keySelection = string.Empty;
+ return;
+ }
+ keyTimer = DateTime.Now;
+ return;
+ }
+
+ base.OnAction(action);
+ //base.OnAction(action);
}
#endregion
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|