GULISTITEM Question (1 Viewer)

chrisonline

MP Donator
  • Premium Supporter
  • August 17, 2007
    515
    37
    45
    Tirol/Wörgl
    Home Country
    Austria Austria
    I try to write my first plugin and have no experience in C# :)
    Perfect situation to begin ;-)

    First i have made the tutorial plugin successfully and now i want to add an listcontrol to the screen.
    The listcontrol shows up perfectly.

    When i click on the listcontrol it should play a URL.

    And this is my problem how could i know which list item is clicked?
    And how could i set an value to every list item (the value should be the url) ?

    Below theres a code example.
    The popup works but how could i show in the popup the clicked item?

    ----------------------
    protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
    {
    if (control == trailerList)
    OnTrailerList();

    base.OnClicked(controlId, control, actionType);
    }

    private void OnTrailerList()
    {
    GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow(
    (int)GUIWindow.Window.WINDOW_DIALOG_OK);
    dlg.SetHeading("Trailerlist wurde gedrückt");
    dlg.SetLine(1, "YEAH");
    dlg.DoModal(GUIWindowManager.ActiveWindow);
    }
    ..
    trailerList.Add(new GUIListItem("Test"));
    trailerList.Add(new GUIListItem("Test 2"));
    ...
    ---------------

    Please help :)
     

    Users who are viewing this thread

    Top Bottom