Finally! Multiple buttons in a list with ease in Jarvis?
#1
Wink 
Hi,

So how is this done these days?

I need more clickable thingys in a row in a list!
I have a dynamic filled list (type is panel, content is songs filled by plugin).
I need on each "row" to have more than one "clickable" thingy (button, label, cheese, I don't care, I don't want to rule anything out here)

My aim is that:
ItemLayout looks like:
4:33 SongTitle
And FocusedLayout (with working buttons):
4:33 SongTitle [Add to Queue] [Play now] [Play Album]

Don't get hung up on any details, this doesn't have to be in a panel as long as the functionality is there.
I read something in a thread from 2009, that clickable buttons was perhaps being added?, but I can't get them working.
See: http://forum.kodi.tv/showthread.php?tid=54879

I tried adding a button to the focused layout:
Code:
<control type="button" id="96892">
    ....
    <onclick>SetProperty(mediaListQueueIconActive,Yes,home)</onclick>
</control>
Never fires.

I tried with focus/unfocus:
Code:
<control type="button" id="96892">
    ....
    <onfocus>SetProperty(mediaListQueueIconActive,Yes,home)</onfocus>
    <onunfocus>SetProperty(mediaListQueueIconActive,No,home)</onunfocus>
</control>
But the value of mediaListQueueIconActive changed with no logical pattern.
Also the button is always showing as focused. (The focus of the panel item is probably working its way "down the line" and polluting the button focus)

I tried adding the entire contents of the focused layout to a grouplist:
Code:
<panel...
   <focusedlayout..
       <grouplist...
          button and  labels..
but that seems to have made it worse as now the labels aren't filled. The button is now always unfocused.

I am sorry if you think this question has already been successfully answered but my search of this site has not lead me to believe that.

So, what is the method you skinning-gurus use to achieve this these days?
Reply
#2
use
<content>
<item id="x">
...
</item>
</content>

or control panel with own buttons, check skin.eunique home page, few exaamples there used on wiidgets
Reply
#3
Thanks badaas. But how will that work with dynamic content?
Reply
#4
What is your code atm to display the dynamic content?
Reply
#5
Panel with a content tag filled by plugin. Python plugin using listitem.
Reply
#6
<control type="list" id="19001">
<itemlayout width="1" height="1"/>
<focusedlayout width="1" height="1"/>
<content limit="8" target="$VAR[DefWidget21Target]">$VAR[DefWidget21Content]</content>
</control>
<control type="button" id="19002">
<visible>StringCompare(Container(300).ListItem.Property(defaultID),movies)</visible>
<left>3558</left>
<top>330</top>
<width>473</width>
<height>705</height>
<onright>19003</onright>
<onleft>18003</onleft>
<onback>300</onback>
<onup>300</onup>
<texturefocus>-</texturefocus>
<texturenofocus>-</texturenofocus>
<onfocus>SetProperty(SkinHelper.WidgetContainer,19001)</onfocus>
<onup>setfocus(19003,0)</onup>
<ondown>setfocus(19003,3)</ondown>
<oninfo>RunScript(script.extendedinfo,info=extendedinfo,name=$INFO[Container(19001).ListItem(4).Label])</oninfo>
<onclick>sendclick(19001)</onclick>
</control>
<control type="image">
<visible>StringCompare(Container(300).ListItem.Property(defaultID),movies)</visible>
<left>3558</left>
<top>330</top>
<width>473</width>
<height>705</height>
<texture>$INFO[Container(19001).ListItem(4).icon]</texture>
<animation effect="zoom" start="105" end="90" time="200" tween="quadratic" reversible="false" center="auto" condition="Control.HasFocus(19002)">Conditional</animation>
</control>
Reply
#7
So buttons work in a list control? Or did I miss something?

Rhanks for your patience! :-)
Reply
#8
If I understand your question correctly it is not possible. How would you handle navigation of the buttons once focused?
Reply
#9
Whilst you can't actually put buttons inside the container, you can definitely fake this with any list container.

Put all your list content inside the list container like usual.
Then put your buttons in a grouplist outside of the container. Use slide animations to position the grouplist based upon the list position. Then use <onright>grouplist-ID</onright> or whatever from the list container to get to the grouplist and vice versa to get back...

For instance if you use this inside the grouplist it will slide the grouplist down 50 pixels for each position of container 211 (assuming your list items are 50 pixels high and in a vertical layout with 3 items)
Code:
<animation effect="slide" end="0,50" condition="IntegerGreaterThan(Container(211).Position,0)">Conditional</animation>
<animation effect="slide" end="0,50" condition="IntegerGreaterThan(Container(211).Position,1)">Conditional</animation>
<animation effect="slide" end="0,50" condition="IntegerGreaterThan(Container(211).Position,2)">Conditional</animation>

Then say your group list is 311 you use <onright>311</onright> for the container and <onleft>211</onleft> for the grouplist.
You could do this with a panel container in Jarvis by overriding the container <onclick> condition to send focus to the grouplist, but I've only tried with lists so I'm not 100% sure if it would work (technically should though). If using a panel you would use Column and Row info labels instead of Position for the slide conditions.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#10
You want mulitple buttons per item?
So if you say used a list [like example above], then left/right would nav buttons in each item, up/down would nav the list [basically].
You would run the content undrawn, then draw your layout with each listitem[xx].whatever.
The buttons would control the undrawn list. ie. topmost button <onup>Control.Move(container#,-1)</onup> +1 for ondown.
A panel would be a sh#tload of mess to do! Wink

Or you could draw the content as normal then onright have a grouplist of buttons that move with left container.
Reply
#11
Oh, munkey beat me Wink
Reply
#12
The trickery you guys have discovered.. amazing hackers you are :-) I should probably have mentioned that I am the mouse only kinda guy. Ill add keys eventually but mouse is primary. I wonder if a script could get at the listitem position and move the button list accordingly?
Reply

Logout Mark Read Team Forum Stats Members Help
Finally! Multiple buttons in a list with ease in Jarvis?0