Detect menu movement (1 Viewer)

martijn189

Portal Pro
October 29, 2008
129
11
Home Country
Netherlands Netherlands
Hi everyone,

I am building a plugin to let the dutch users watch dutch emmisions from the internet. I would like my plugin to show a picture of the selected episode but cannot figgure out how to do such a event in the C# code.

What i would like is some sort of image display like the ones being used in the myfilms and tvseries plugins.

The url of the image that has to been displayed is delivererd by xml.

is there a function in mediaportal core that let's me detect a selected listmenu item??

thanks in advance
 

martijn189

Portal Pro
October 29, 2008
129
11
Home Country
Netherlands Netherlands
I found out that when puting the following code into my plugin i can for example show the title of the selected item, problem is that it only shows the previous selected item, not the current one.. anyone got an idear on how to display the current selected facade item?

Code:
if (action.wID == Action.ActionType.ACTION_MOVE_DOWN || action.wID == Action.ActionType.ACTION_MOVE_UP) {
  GUIPropertyManager.SetProperty("#titel", emissions[facadeview.SelectedListItemIndex].title);
  GUIPropertyManager.SetProperty("#thumb", emissions[facadeview.SelectedListItemIndex].thumb);
}
 

armandp

Retired Team Member
  • Premium Supporter
  • April 6, 2008
    990
    620
    Zoetermeer
    Home Country
    Netherlands Netherlands
    There's another way.. when you create the GUIListItem you can attach an eventhandler to it that will fire when the item is selected:
    Code:
    GUIListItem myListItem = new GUIListItem();
    myListItem.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(myOnListItemSelectedEvent);
    ...


    and and example of the handler:

    Code:
    public void myOnListItemSelectedEvent(GUIListItem item, GUIControl parent)  {             
      GUIPropertyManager.SetProperty("#titel", item.title);
      GUIPropertyManager.SetProperty("#thumb", item.thumb);
    }

    take a look at: MovieBrowser.cs - moving-pictures - Google Code for an example
     

    Users who are viewing this thread

    Top Bottom