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

    Similar threads

    Prerequisites A Spotify account (free or premium) I've not tested with a free account, but according to spotify it should work. Spotify desktop app installed on same computer as you are going to use with MediaPortal Getting ready Create an app at spotify, use this link: Dashboard | Spotify for Developers, you have to login. Click...
    Prerequisites A Spotify account (free or premium) I've not tested with a free account, but according to spotify it should work...
    Prerequisites A Spotify account (free or premium) I've not tested with a free account, but according to spotify it should work...
    Replies
    0
    Views
    707
    Please check the wiki. I never take online sources but perform offline imports. You can use external tools for that and change all data including poster. Also the import speed is much faster + the local data are kept forever, even MP2 is removed. To overwrite only some movies you need to remove them once from the share, place an...
    Please check the wiki. I never take online sources but perform offline imports. You can use external tools for that and change all...
    Hi, I'm new here but have been gradually getting my head around setting everything up but one simple task is throwing me off - how...
    Replies
    1
    Views
    369
    MPEG2 and MPEG4 video play back doesn't work yet. LAVFilters-0.78-x64 is installed (install_audio.bat, install_splitter.bat, install_video.bat). MediaPortal-Error.log: [2023-11-27 08:28:42,457] [Error ] [FilterChecker] [ERROR] - TVHome: * WARNING * Unable to detect registered filter: TsReader.ax!
    MPEG2 and MPEG4 video play back doesn't work yet. LAVFilters-0.78-x64 is installed (install_audio.bat, install_splitter.bat...
    [MP1-5154] Mediaportal x64 version with SharpDX - MediaPortal Jira GitHub - MediaPortal/MediaPortal-1 at...
    Replies
    800
    Views
    45K
    I'm not sure what the issue was, but I decided to try a different way of solving the problem. My server has a 2.5Gbps port and the 10Gbps card I added, so I've connected the HD Homerun directly to the 2.5G port, and its solved the problem, I can now copy large multiple files to the server and not suffer with picture issues. There is...
    I'm not sure what the issue was, but I decided to try a different way of solving the problem. My server has a 2.5Gbps port and the...
    My MP1 installation works perfectly, except if I transfer large files to my server. Network setup. HD Homerun Quad tuner -...
    Replies
    5
    Views
    1K
    I´ll have a look and report back ;)
    I´ll have a look and report back ;)
    Hello @ajs, I would like to add an additional animation for the winner of the MP game Hexxagon in the file MyHexxagon.xml, as used...
    Replies
    2
    Views
    337
    Top Bottom