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

    Sums up the problem I am having. Sorry if I wasn't clear. No, #selectedthumb is not preserved on going to the next window. That's exactly what I am trying to solve. An example is moving from mytvrecordedtv.xml to mytvRecordedInfo. The variable changes from a screen grab thumbnail from the video file to a channel logo during...
    Sums up the problem I am having. Sorry if I wasn't clear. No, #selectedthumb is not preserved on going to the next window. That's...
    Good evening, I have a basic understanding of using skin.setstring and am able to set a skin property when a control gets focus...
    Replies
    2
    Views
    832
    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
    1K
    MP1 MP2 MP2 - V2.5 No genres after upgrade to 2.5 DE
    You need to check the wiki for TVMosaic, you have recordings as source available once TVM is installed. And of course images and music are part of the NET6 version as for NET4. If you have issues with it further infos would be good.
    You need to check the wiki for TVMosaic, you have recordings as source available once TVM is installed. And of course images and...
    Make sure that your system (Windows, codecs and drivers) is up to date, matching the Requirements and you've filled in your System...
    Replies
    10
    Views
    874
    I am Sure the Issues will be fixed towards a stable. NET6 Version. Please don't get me wrong - My Intent was not any Complaint at all. I just wanted to: understand current Status & Situation understand my Options for a stable System improve my Knowledge & learn from Experts Especially because your limited Dev Resources and the...
    I am Sure the Issues will be fixed towards a stable. NET6 Version. Please don't get me wrong - My Intent was not any Complaint at...
    Hello Folks, Yesterday I upgraded to Mediaportal 2.5 via uninstalling 2.4.1 first and then install the latest .NET6 Variant of...
    Replies
    12
    Views
    1K
    I had the same issue and found the executable under C:\ProgramData\Team MediaPortal\MediaPortal\skin\Titan\BasicHome.Editor\TitanEditor.exe Only the shortcut was missing.
    I had the same issue and found the executable under C:\ProgramData\Team...
    Hi all, Not a rant, more a sharing of experience (maybe hoping to get some clarification on which wrong turn I took) It has been...
    Replies
    9
    Views
    1K
    Top Bottom