Kodi Community Forum

Full Version: CurrentItem and NumItem for Grouplist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is there a way to get the current item and total number of items for a content in a grouplist?
(2015-04-11, 12:13)Eddage Wrote: [ -> ]Is there a way to get the current item and total number of items for a content in a grouplist?
Container(id).NumItems and Container(id).CurrentItem don't work in grouplists ? I know that Container(id).CurrentItem has been fixed in Isengard since it didn't work in previous releases but didn't try for grouplists.

Are you trying to group built-in buttons ? If so, you can still make a simple list with custom items sending clicks to the built-in button id.
As far as I know, nope.

I also searched for a way to display the total number or the current page position a few days ago.
It ended up with a label "scroll down for more" based on the visiblity of a hidden scrollbar.

+1 for this feature.
(2015-04-11, 14:59)sualfred Wrote: [ -> ]As far as I know, nope.

I also searched for a way to display the total number or the current page position a few days ago.
It ended up with a label "scroll down for more" based on the visiblity of a hidden scrollbar.

+1 for this feature.
That make sense having it working in all kind of lists ... +1
(2015-04-11, 14:18)Jayz2K Wrote: [ -> ]
(2015-04-11, 12:13)Eddage Wrote: [ -> ]Is there a way to get the current item and total number of items for a content in a grouplist?
Container(id).NumItems and Container(id).CurrentItem don't work in grouplists ? I know that Container(id).CurrentItem has been fixed in Isengard since it didn't work in previous releases but didn't try for grouplists.

Are you trying to group built-in buttons ? If so, you can still make a simple list with custom items sending clicks to the built-in button id.

It's for things like the video/audio osd settings and context menu so as far as I know there isn't a way around it.

Definitely +1 for this feature to be included though, just wanted to make sure I wasn't missing something!
(2015-04-11, 16:28)Eddage Wrote: [ -> ]It's for things like the video/audio osd settings and context menu so as far as I know there isn't a way around it.

Not yet started OSD skinning. But rebuilt a list with custom items for video window option. It works when using SendClick(id) action in the <onclick> tag ... for a built in contro button.

Seems that you mean the built in grouplist Id="5". Since it's not just button, that won't work as is. Maybe but not sure, using a combination like this in the list item :

Code:
Item 1
<onclick>Control.SetFocus(5,1)</onclick>
<onclick>SendClick(5)</onclick>

Item 2
<onclick>Control.SetFocus(5,2)</onclick>
<onclick>SendClick(5)</onclick>

Etc.
keep in mind that a grouplist can contain a mixture of controls: labels, images, buttons, even disabled buttons and hidden items.
so it's not very straightforward to add those infolabels i think.
(2015-04-11, 17:09)ronie Wrote: [ -> ]keep in mind that a grouplist can contain a mixture of controls: labels, images, buttons, even disabled buttons and hidden items.
so it's not very straightforward to add those infolabels i think.

Yep, you're right. But since a pagecontrol<->scrollbar works fine, I would be satisfied to have something like ControlGroup(id).CurrentPage & ControlGroup(id).NumPages Smile
(2015-04-11, 17:55)sualfred Wrote: [ -> ]
(2015-04-11, 17:09)ronie Wrote: [ -> ]keep in mind that a grouplist can contain a mixture of controls: labels, images, buttons, even disabled buttons and hidden items.
so it's not very straightforward to add those infolabels i think.

Yep, you're right. But since a pagecontrol<->scrollbar works fine, I would be satisfied to have something like ControlGroup(id).CurrentPage & ControlGroup(id).NumPages Smile

+1 for this. For e.g. would be very useful to show up/down indicators that there are more items off page.
Bit late to the party, but shouldn't Container(id).HasNext / HasPrevious work for this?
(2015-08-06, 12:51)mkortstiege Wrote: [ -> ]Bit late to the party, but shouldn't Container(id).HasNext / HasPrevious work for this?

correct, they work pefectly fine for grouplists.
http://mirrors.kodi.tv/test-builds/win32...labels.exe is a testbuild (based on todays master) that adds grouplist support for CurrentItem and NumItems. Right now it only considers items as valid that are Visible and Focusable.

Would love to get some feedback Wink
Working for me apart from the current item offset is one out. ie item 1 is labelled 0, item 2 is labelled 1, etc.
Ah right, mkorstiege already noticed that, but I talked him out of correcting that. Obviously I was mistaken with Container.Position which does start with 0.
Updated the item offset and PR'd @ https://github.com/xbmc/xbmc/pull/7768
Pages: 1 2