displaying a list of 50 radio buttons in one column on a window
#1
Lightbulb 
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.
Reply
#2
Remove the buttons and replace with labels then add the buttons' functions to the content .

http://wiki.xbmc.org/index.php?title=Sta...st_Content
Reply
#3
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
Reply
#4
@Hitcher , But I want list of radio buttons not simple buttons, that creates simple buttons.
Reply
#5
@ 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.

Reply
#6
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
Reply
#7
Use a grouplist and add your radio buttons to that.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#8
@jmarshall, grouplist is not available in python, gives me error.
Reply
#9
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.
Reply
#10
you would need to set the variable with the script in the same way you set the label
Reply
#11
(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.
Reply
#12
grouplist is not available in python, it gives me error if I use.
Reply

Logout Mark Read Team Forum Stats Members Help
displaying a list of 50 radio buttons in one column on a window0