Get selected item in menu on myHome (1 Viewer)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    Hi

    As a fix for the menu in the skin mediaStream (that stopped working with RC4 for some weird reason), I am trying to build a new process-plugin.

    In this, I need to know which menuitem that is currently the focused one in the menu.

    Whenever I try the code (se further down), I get loads of errors in the log, complaining about "System.NullReferenceException" and a long list of errors:

    ved MediaPortal.Plugins.MediaStream.OnAction(Action action)
    ved MediaPortal.GUI.Library.OnActionHandler.Invoke(Action action)
    ved MediaPortal.GUI.Library.GUIGraphicsContext.OnAction(Action action)
    ved MediaPortalApp.keydown(KeyEventArgs e)
    ved MediaPortal.D3DApp.OnKeyDown(Object sender, KeyEventArgs e)
    ved System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
    ved System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
    ved System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
    ved System.Windows.Forms.Control.WmKeyChar(Message& m)
    ved System.Windows.Forms.Control.WndProc(Message& m)
    ved System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    ved System.Windows.Forms.ContainerControl.WndProc(Message& m)
    ved System.Windows.Forms.Form.WndProc(Message& m)
    ved MediaPortalApp.WndProc(Message& msg)

    The error is triggered by:

    Code:
            private void OnAction(Action action)
            {
                if (action.wID == Action.ActionType.ACTION_MOVE_UP)
                {
                    Log.Info("MediaStream: Button pressed...");
                    GUIListItem mylist = GUIMenuControl.GetSelectedListItem(0, 50);
                    string myitem = mylist.Label.Length.ToString();
                    Log.Info("MediaStream: Button pressed: " + myitem);
                    return;
                }
    }

    Obviously the snippet above is just a small test, but...

    Hope someone can help, or explain why RC4 process-plugins, no longer can set focus on buttons in myHome, when RC1, RC2, RC3 and all SVN's could :(
     

    Users who are viewing this thread

    Top Bottom