Kodi Community Forum
displaying a list of 50 radio buttons in one column on a window - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: displaying a list of 50 radio buttons in one column on a window (/showthread.php?tid=139959)



displaying a list of 50 radio buttons in one column on a window - slinuxgeek - 2012-09-07

How can I display a list of 50 radio buttons on a window each one is displayed below another so that if list reaches to bottom of window a scroll bar appears and radio buttons do not cross the window boundary ?

currently I am doing it like following but is not working:
PHP Code:
        <control type="list" id="100610">
            <
posx>30</posx>
            <
posy>105</posy>
            <
width>950</width>
            <
height>400</height>
            <
onup>9001</onup>
            <
onleft>9000</onleft>
            <
onright>60</onright>
            <
ondown>12</ondown>
            <
pagecontrol>60</pagecontrol>
            <
scrolltime>200</scrolltime>
            <
itemlayout height="40">
                <
control type="radiobutton">
                    <
description>Default RadioButton</description>
                    <
posx>0</posx>
                    <
posy>0</posy>
                    <
width>900</width>
                    <
height>40</height>
                    <
font>font12</font>
                    <
textcolor>grey2</textcolor>
                    <
focusedcolor>white</focusedcolor>
                    <
label>$INFO[ListItem.Label]</label>
                    <
texturefocus border="0,2,0,2">MenuItemFO.png</texturefocus>
                    <
texturenofocus border="0,2,0,2">MenuItemNF.png</texturenofocus>
                    <
textureradioon>radiobutton-focus.png</textureradioon>
                    <
textureradiooff>radiobutton-nofocus.png</textureradiooff>
                </
control>
            </
itemlayout>
            <
focusedlayout height="40">
                <
control type="radiobutton">
                    <
description>Default RadioButton</description>
                    <
posx>0</posx>
                    <
posy>0</posy>
                    <
width>900</width>
                    <
height>40</height>
                    <
font>font12</font>
                    <
textcolor>grey2</textcolor>
                    <
focusedcolor>white</focusedcolor>
                    <
label>$INFO[ListItem.Label]</label>
                    <
texturefocus border="0,2,0,2">MenuItemFO.png</texturefocus>
                    <
texturenofocus border="0,2,0,2">MenuItemNF.png</texturenofocus>
                    <
textureradioon>radiobutton-focus.png</textureradioon>
                    <
textureradiooff>radiobutton-nofocus.png</textureradiooff>
                </
control>
            </
focusedlayout>
            <
content>
                <
item>
                    <
label>zx</label>
                </
item>
                <
item>
                    <
label>cv</label>
                </
item>
                                ----------------------
                                ----------------------
            </
content>
        </
control>
        <
control type="scrollbar" id="60">
            <
posx>950</posx>
            <
posy>105</posy>
            <
width>25</width>
            <
height>400</height>
            <
texturesliderbackground border="0,14,0,14">ScrollBarV.png</texturesliderbackground>
            <
texturesliderbar border="0,14,0,14">ScrollBarV_bar.png</texturesliderbar>
            <
texturesliderbarfocus border="0,14,0,14">ScrollBarV_bar_focus.png</texturesliderbarfocus>
            <
textureslidernib>scrollbar_nib.png</textureslidernib>
            <
textureslidernibfocus>scrollbar_nib.png</textureslidernibfocus>
            <
onleft>10</onleft>
            <
onright>9000</onright>
            <
showonepage>false</showonepage>
            <
orientation>vertical</orientation>
        </
control

Thanks for help in advance.


RE: displaying a list of 50 radio buttons in one column on a window - Hitcher - 2012-09-07

Remove the buttons and replace with labels then add the buttons' functions to the content .

http://wiki.xbmc.org/index.php?title=Static_List_Content


RE: displaying a list of 50 radio buttons in one column on a window - Jezz_X - 2012-09-07

I would suggest put them in a grouplist not a list control but I assume your trying to dynamically fill them and make them dynamically visible? which is also as easy as having a <visible> condition


RE: displaying a list of 50 radio buttons in one column on a window - slinuxgeek - 2012-09-07

@Hitcher , But I want list of radio buttons not simple buttons, that creates simple buttons.


RE: displaying a list of 50 radio buttons in one column on a window - slinuxgeek - 2012-09-07

@ Jezz_X, yes I want to fill that dynamically using python code.
PHP Code:
myWindow xbmcgui.Window(19438# id of my custom window 
myListControlmyWindow.getControl(100610)  # id of List control on the same window
for i in range(20):
    
path 'Radio 'str(i)
    
myListControl.addItem(path

but above code just adds radio buttons to list which is under control of scroll bar but no text appears for any radio button and also radio buttons can not be checked on by clicking on them.




RE: displaying a list of 50 radio buttons in one column on a window - Jezz_X - 2012-09-07

I think you will find that lists just aren't meant to hold radio buttons.

My suggestion is fake the look with graphics that look like a radio button and then use a property like ListItem.Property(IsEnabled) to toggle the visibility of the correct graphics

so each layout has a "Enabled Image" "Disabled Image" visible depending on if "ListItem.Property(IsEnabled)" is true and the Label over the top of them


RE: displaying a list of 50 radio buttons in one column on a window - jmarshall - 2012-09-07

Use a grouplist and add your radio buttons to that.


RE: displaying a list of 50 radio buttons in one column on a window - slinuxgeek - 2012-09-07

@jmarshall, grouplist is not available in python, gives me error.


RE: displaying a list of 50 radio buttons in one column on a window - slinuxgeek - 2012-09-07

Hi Jezz_X, I tried you method but "ListItem.Property(IsEnabled)" always returns false.
I tried to single click/double click/triple click/pressed Enter key /pressed space key over an item in list , but it never displayed focused image.


RE: displaying a list of 50 radio buttons in one column on a window - Jezz_X - 2012-09-07

you would need to set the variable with the script in the same way you set the label


RE: displaying a list of 50 radio buttons in one column on a window - Hitcher - 2012-09-07

(2012-09-07, 08:25)slinuxgeek Wrote: @Hitcher , But I want list of radio buttons not simple buttons, that creates simple buttons.

Sorry, didn't notice that this morning.

As JM suggested use a grouplist.


RE: displaying a list of 50 radio buttons in one column on a window - slinuxgeek - 2012-09-10

grouplist is not available in python, it gives me error if I use.