View Full Version : Required window controls wiki page?
Killarny
2008-05-11, 00:57
The wiki refers to a listing of the controls required for each window type, but it doesn't seem to exist anymore.
Some of these controls are required on specific windows, as they're necessary for that window to perform it's duty, or, the contents of the control are only valid on a particular window. The mandatory controls for each window are listed in the window list. While the controls are mandatory, you can ofcourse move them about and change their appearance within the windows to your hearts content!
http://xbmc.org/wiki/?title=Window_Structure
But, the Window List (http://xbmc.org/wiki/?title=Window_IDs) doesn't have this information.
I think this list would ease skin creation quite a bit, because people wouldn't need to dissect another skin to determine what controls are required to be there and which ones are just for design purposes. Would it be a complete waste of time for someone to collect a list of these required controls and post them on the wiki? I'd be willing to lend a hand myself.
jmarshall
2008-05-11, 01:18
It wouldn't be a complete waste of time at all. I'm happy to have a quick scan over it when you're done.
Most of 'em can be found by the #define's at the top of each window class cpp.
Interestingly, though, now some of them are no longer required for functionality to work (consider the viewtype buttons for instance) we try and steer clear of forced id's (where it makes sense to) nowadays.
Cheers,
Jonathan
Killarny
2008-05-12, 00:42
I'll post the information here as I find it before submitting it for the wiki - I'd appreciate anyone looking it over as I'm compiling it. I'll keep adding to this post..
Where I know what it is, I've added the expected control type in parenthesis after the description of the control. As far as I know, these are not always hard-and-fast rules meaning that the control MUST be that type, but keep in mind that XBMC is expecting that type. (ie, when XBMC expects a label, you should be able to use a button instead, since the call to set the label will simply change the button label)
FileManager.xml
Left
12 - Number of Files (label) - Preferred: Container(n).NumItems
20 - Files (any container type)
101 - Current Dir (label)
Right
13 - Number of Files (label) - Preferred: Container(n).NumItems
21 - Files (any container type)
102 - Current Dir (label)
LoginScreen.xml
52 - Profiles (list)
2 - Header (label)
3 - Selected Profile (label) (This is probably doable with ListItem.Label?)
MyMusicNav.xml
2 - View As (button) (This button can be implemented entirely via builtin functions + infolabels)
3 - Sort By (button) (Similarly with this one - though I'm not sure how effective it is)
4 - Sort Direction (button)
5 - Type (button) This is really unsupported - you should use builtins to flick between the two.
50-59 Any container types.
12 - Number of Files (label) - (Can be implemented using Container.NumItems)
8 - Search (button)
15 - Current level (label) - eg Playlists for when you are in the playlists node, and so on.
16 - Party Mode (button) - Use PartyMode(Music) builtin function.
17 - Manual Info (button) - Possibly no longer supported.
19 - Filter (button)
18 - Empty (label) - Used to indicate when the music library is empty - instead it's better to use Library.HasMusic
jmarshall
2008-05-12, 01:29
I have the feeling that kraqh3d wrote a script to dump out the control details from the XBMC source code at some point, specifically intended for the wiki, though perhaps it was never released. I'll see if I can contact him about it.
Cheers,
Jonathan
Killarny
2008-05-12, 01:47
Thanks for updating my post with all that information, jmarshall!
Now I'm torn on whether to even list the id's that are doable through other methods. I suppose for completeness they should be listed, with notes (as you've provided) describing the preferred methods.
That script would be really useful. I've been manually going through the .cpp files for each window, but since I don't know the codebase very well, even finding all the corresponding cpp files is slow work.
Killarny
2008-05-12, 05:58
jmarshall, I just did some quick changes in FileManager.xml from my skin, and verified that Container.NumItems does work as a replacement for controls 12 and 13, but Container.FolderPath does not work.
So, unless I did something wrong, I think 101 and 102 will need to be used still.