Rectangular Radio/Toggle Buttons?
#1
How can I make a rectangular radio/toggle button? It seems like it always wants to be square based on the width and I can't even change the height if I try. Changing the height just changes the line height for me not the image height/width.

Default.xml
Code:
<default type="radiobutton">
    <posx>0</posx>
    <posy>0</posy>
    <width>150</width>
    <height>30</height>
    <align>center</align>
    <aligny>center</aligny>
    <font>small</font>
    <label>-</label>
    <textcolor>black</textcolor>
    <focusedcolor>white</focusedcolor>
    <disabledcolor>red</disabledcolor>
    <texturenofocus>ButtonNF.png</texturenofocus>
    <texturefocus>ButtonFo.png</texturefocus>
    <textureradiofocus>RadiobuttonFo.png</textureradiofocus>
    <textureradionofocus>RadiobuttonNF.png</textureradionofocus>
    <textoffsetx>5</textoffsetx>
    <pulseonselect>false</pulseonselect>
</default>

<default type="togglebutton">
    <posx>0</posx>
    <posy>0</posy>
    <width>150</width>
    <height>30</height>
    <label>-</label>
    <font>small</font>
    <textcolor>black</textcolor>
    <focusedcolor>white</focusedcolor>
    <disabledcolor>red</disabledcolor>
    <texturenofocus>ButtonNF.png</texturenofocus>
    <texturefocus>ButtonFo.png</texturefocus>
    <alttexturenofocus>ButtonNF.png</alttexturenofocus>
    <alttexturefocus>ButtonFo.png</alttexturefocus>
    <align>center</align>
    <aligny>center</aligny>
    <pulseonselect>false</pulseonselect>
</default>


Settings Category.xml
Code:
<control type="radiobutton" id="8">
    <description>Default Radio Button</description>
    <textcolor>black</textcolor>
    <align>left</align>
    <width>85</width>
    <height>30</height>
    <texturefocus border="1">SettingsFo.png</texturefocus>
    <texturenofocus border="1">SettingsNF.png</texturenofocus>
</control>



I'm using these images each 154 x 54 pixels.

Image


And the result is this:

Image
Reply
#2
Add the following to the radio button control adjusting the <radiowidth> and <radioheight> to suit your images' dimensions:

Code:
<radiowidth>50</radiowidth>
<radioheight>19</radioheight>

Reply
#3
EDIT: Didn't look far enough down the code. Disregard.
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
#4
@Sranshaft: Thanks so much!
Reply

Logout Mark Read Team Forum Stats Members Help
Rectangular Radio/Toggle Buttons?0