Simple examle how to populate list control (1 Viewer)

CoolHammer

Retired Team Member
  • Premium Supporter
  • September 28, 2004
    174
    0
    Finland
    Hello,

    I'm looking for a simple example how to work with list control.
    Would like to read folder and display all subfolders as a entry on a list box.

    CoolHammer
     

    CoolHammer

    Retired Team Member
  • Premium Supporter
  • September 28, 2004
    174
    0
    Finland
    What is the name of control that has list of items scrollabel up / down?

    Listcontrol seems to be button with left right scrolling

    CoolHammer
     

    CoolHammer

    Retired Team Member
  • Premium Supporter
  • September 28, 2004
    174
    0
    Finland
    Thanks waeberd :)

    Well ... looks like i need to be more specific when asking questions :oops:

    Im trying to make a myquiz plugin. One part of a plugin is a contol where user can select which quiz she/he will take. It is a list of "quiz names" there can be several quiz to choose from so this list can be several pages long.

    So Im trying to generate control on MP gui.

    CoolHammer
     

    waeberd

    Portal Pro
    August 16, 2004
    314
    1
    Fribourg (CH)
    CoolHammer said:
    So Im trying to generate control on MP gui.

    ok :D

    in this case, I would choose a GUIListControl. This contains many GUIListItems.

    I use the following code to populate this (see GUIPrograms.cs for the whole stuff).

    Code:
    void DisplayApplications()
    {
    	GUIControl.ClearControl(GetID, (int)Controls.CONTROL_LIST ); 
    	foreach(AppItem app in apps ) // this loops an internal structure
    	{
    		GUIListItem gli = new GUIListItem( app.Title );
    		if (app.Imagefile != "")
    		{
    			gli.ThumbnailImage = app.Imagefile;
    			gli.IconImageBig = app.Imagefile;
    			gli.IconImage = app.Imagefile;
    		}
    		else 
    		{
    			gli.ThumbnailImage = GUIGraphicsContext.Skin+@"\media\DefaultFolderBig.png";
    			gli.IconImageBig = GUIGraphicsContext.Skin+@"\media\DefaultFolderBig.png";
    			gli.IconImage = GUIGraphicsContext.Skin+@"\media\DefaultFolderNF.png";
    		}
    		gli.MusicTag = app; // this is for speeding-up only
    		gli.IsFolder = false;
    		GUIControl.AddListItemControl(GetID,(int)Controls.CONTROL_LIST, gli );
    	}
    }

    Hope that helps!

    Daniel
     

    Users who are viewing this thread


    Write your reply...

    Similar threads

    Nice finding! (y)(y)(y) Adapted to new DWHD and PVHD ;) Position is in front of category bar ;)
    Nice finding! (y)(y)(y) Adapted to new DWHD and PVHD ;) Position is in front of category bar ;)
    This thread is intended for skin authors, plus those advanced users who have learnt skin programming and have customised the skins...
    Replies
    1
    Views
    831
    Attached are new TV service logs with your latest DLL. I see lots of EPG events and none of the messages from earlier. Congratulations!
    Attached are new TV service logs with your latest DLL. I see lots of EPG events and none of the messages from earlier. Congratulations!
    I have some weird behavior trying to operate the MP GUI in a new installation of MP 1.36 under Windows 11 Pro. Some of the remote...
    Replies
    33
    Views
    2K
    • Sticky
    MP1 MP2 1.37 DefaultWideHD - Reloaded DE
    It's not like a tiny live TV playing in an overlay is critical to the operation of MP, in practicality, it is only a reminder that I forgot to shut off the TV feed. ;)
    It's not like a tiny live TV playing in an overlay is critical to the operation of MP, in practicality, it is only a reminder that...
    After around 13 years, catavolt and High_Five - our new colleague in the design team - have decided to completely overhaul the...
    Replies
    129
    Views
    6K
    Hello, I would like to use a media server to display various learning categories. I prefer not to use software like Kodi, as it requires extensive metadata scraping that I don't need. Is it possible to instantly access the video categories when landing on the page? I would like to display a single media page with the following...
    Hello, I would like to use a media server to display various learning categories. I prefer not to use software like Kodi, as it...
    Hello, I would like to use a media server to display various learning categories. I prefer not to use software like Kodi, as it...
    Replies
    0
    Views
    468
    • Sticky
    Upgrade install on MP 1.36 x64 proceeded without issue, everything I have tried so far is working and looking very good. Many Thanks(y):)
    Upgrade install on MP 1.36 x64 proceeded without issue, everything I have tried so far is working and looking very good. Many...
    Pre Releases are provided as a way for the community to test and give feedback on all the exciting things we have lined up for the...
    Replies
    1
    Views
    449
    Top Bottom