Menu dialog Plugin (1 Viewer)

packstlauren

MP Donator
  • Premium Supporter
  • November 26, 2006
    87
    50
    Home Country
    France France
    Hi all,

    I'm trying to develop a plugin which it's composed of a single menu dialog with some entries.
    I want that this dialog could appear from all screens (ie video and tv fullscreen, music, video, Basic home screen,...)

    I want to call this plugin with a key (for exemple Alt+Ctrl M).

    Does somebody can tell me how to start a such plugin with a menu dialog. I didn't find anything in the documentation or in the forum.

    Thanks in advance,

    Pack
     

    packstlauren

    MP Donator
  • Premium Supporter
  • November 26, 2006
    87
    50
    Home Country
    France France
    No responses,

    Does somebody can tell me if a plugin which use a such menu dialog exist ?

    I will try to be inspirated with this one.
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    Your plugin should be created as a process-plugin and start when MediaPortal starts. Then it should hook the eventlistener and check it an action matches the one you define. Use some parts of the guide here:
    MediaPortal1_Development/PluginDevelopersGuide - MediaPortal Manual Documentation
    and replace

    Code:
    public class Class1 : GUIWindow, ISetupForm

    with

    Code:
    public class Class1 : IPlugin, ISetupForm

    and replace

    Code:
        // Get Windows-ID
        public int GetWindowId()
        {
          // WindowID of windowplugin belonging to this setup
          // enter your own unique code
          return 5678;
        }

    with

    Code:
            // Get Windows-ID
            public int GetWindowId()
            {
                // WindowID of windowplugin belonging to this setup
                // enter your own unique code
                return -1;
            }

    That should actually be enough to change a window-plugin to a process-plugin.

    Then place the eventlistener

    Code:
    GUIGraphicsContext.OnNewAction += new OnActionHandler(OnAction);

    in the

    Code:
            public void Start()
            {
            }

    function. Now you can check keystrokes, buttonpushes etc. in your OnAction function. Like this:

    Code:
    public void OnAction(Action action)
    {
    if(action.wID == Action.ActionType.ACTION_MOVE_DOWN) //user navigated down (key-down or remote-down or...
    {
    //do something
    }
     

    packstlauren

    MP Donator
  • Premium Supporter
  • November 26, 2006
    87
    50
    Home Country
    France France
    Thanks for your Help.

    I'm now trying to debug my plugin with Visual Studio C# 2005. But the documentation did not correspond to this EDI.
    If somebody can give me some links to help me.

    I'm sorry for all those questions, but I a newbe with c# i'm a Java developer and C# environnement is very different...

    I've switched to SharpDevelop and the debuger is now functionnal. I continue my investigations.

    Pack
     

    2BitSculptor

    Super Moderator
  • Team MediaPortal
  • January 23, 2008
    1,948
    498
    South Central Wisconsin
    Home Country
    United States of America United States of America
    I've always wondered why the 'MENU' key on the remote was never used for calling the hidden menu for any particular screen, not just a DVD menu, much better I think than having to move left or right to exit a list or thumbnail facade.

    I Hope to see this working....

    Chuck
     

    packstlauren

    MP Donator
  • Premium Supporter
  • November 26, 2006
    87
    50
    Home Country
    France France
    I'm trying to create a GUIDialogMenu with some default items with no action, one of them shows a second menu. When i click on a default item, the GUIDialogMenu closes and that's ok. But if I click on the item which open another menu, the second menu is shown but i can't closed it, even if i click on one of his items. It reappears systematically.

    Here is my sample code used :

    GUIDialogMenu DialogResult = (GUIDialogMenu)GUIWindowManager.GetWindow(
    (int)GUIWindow.Window.WINDOW_DIALOG_MENU);
    DialogResult.SetHeading("Mon Menu");
    GUIListItem item1 = new GUIListItem();
    item1.Label = "Menu 1";
    DialogResult.Add(item1);
    GUIListItem item2 = new GUIListItem();
    item2.Label = "Menu 2";
    DialogResult.Add(item2);
    DialogResult.DoModal(GUIWindowManager.ActiveWindow);

    if (DialogResult.SelectedId == 1)
    {
    GUIDialogMenu DialogResult2 = (GUIDialogMenu)GUIWindowManager.GetWindow(
    (int)GUIWindow.Window.WINDOW_DIALOG_MENU);
    DialogResult2.SetHeading("Mon Super Menu");
    GUIListItem item3 = new GUIListItem();
    item3.Label = "Menu 3";
    DialogResult2.Add(item3);
    GUIListItem item4 = new GUIListItem();
    item4.Label = "Menu 4";
    DialogResult2.Add(item4);
    DialogResult2.DoModal(GUIWindowManager.ActiveWindow);

    }

    I found myself my problem. It was an error with my action
     

    Users who are viewing this thread

    Top Bottom