Can not get the Listcontrol working (1 Viewer)

davemj9876

Portal Member
August 1, 2011
9
0
Home Country
New Zealand New Zealand
Hi,
I have been working on my on plug in. and I have been populating a listcontol with the following code

Code:
     private void LoadAllPlaylists()
        {
            if ((int)GUIWindowManager.ActiveWindow == GetID)
            {
                int j = 0;
                GUIControl.ClearControl(GetID, (int)Controls.CONTROL_PLAYLISTS);
                foreach (IITPlaylist pl in app.LibrarySource.Playlists)
                {
                    j++;
                    GUIListItem item = new GUIListItem(pl.Name);
                    item.Label = pl.Name;
                    item.IsFolder = false;
                    GUIControl.AddListItemControl(GetID, (int)Controls.CONTROL_PLAYLISTS, item);
                }
                GUIPropertyManager.SetProperty("#itemcount", j.ToString());
                GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_PLAYLISTS, j.ToString());

            }
        }

The XML skin for the control is very simple:

Code:
    <control>
      <id>4</id>
      <description>Play List Information</description>
      <type>listcontrol</type>
      <scrollOffset>2</</scrollOffset>
    </control>

When I select my plugin, a list of playlists does appear on the screen, which is great but the list in unselectable. The complete lists highlights, but I am not getting individual items to select (I hope that makes sense).

Can any one point me in the direction of what I might be doing wrong (or even to a very simple working example). I have looked at various plugins and I can not see what I am doing different to them.

Thanks for any help

Cheers

David
 

davemj9876

Portal Member
August 1, 2011
9
0
Home Country
New Zealand New Zealand
Okay it is actually working, but when I have this in the skin file

Code:
  <control>
      <id>1</id>
      <description>BackGround</description>
      <type>image</type>
      <posX>0</posX>
      <posY>0</posY>
      <width>720</width>
      <height>576</height>
      <texture>background.png</texture>
    </control>

Various parts of the Listcontrol are not displayed correctly. If I take this out of the skin file, then it displays as I expected. So I guess I am still doing something wrong some there

And I have worked it out, order is important in the skins file in case anyone wants to know. The background must come first by the looks of it.
 

Users who are viewing this thread


Write your reply...
Top Bottom