Radio button control: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Theuni
>NedBot
m (Wikitable class; cosmetic changes)
Line 1: Line 1:
The radio button control is used for creating push button on/off settings in XBMC. You can choose the position, size, and look of the button. When the user clicks on the radio button, the state will change, toggling the extra textures (textureradiofocus and textureradionofocus). Used for settings controls.
The radio button control is used for creating push button on/off settings in XBMC. You can choose the position, size, and look of the button. When the user clicks on the radio button, the state will change, toggling the extra textures (textureradiofocus and textureradionofocus). Used for settings controls.
===Example===
=== Example ===
<source lang="xml">
<source lang="xml">
<control type="radiobutton" id="2">
<control type="radiobutton" id="2">
Line 33: Line 33:
</source>
</source>


===Available Tags===
=== Available Tags ===
In addition to the [[Default Control Tags]] the following tags are available. Note that each tag is '''lower case''' only. This is important, as xml tags are case-sensitive.
In addition to the [[Default Control Tags]] the following tags are available. Note that each tag is '''lower case''' only. This is important, as xml tags are case-sensitive.
{| class="usertable" border="0"
{| class="usertable" border="0"
|- class="userrow"
|-  
| class="usercell" | '''texturefocus'''
| '''texturefocus'''
| class="usercell" |
|  
Specifies the image file which should be displayed when the button has focus. [[Texture Attributes|See here for additional information about textures.]]
Specifies the image file which should be displayed when the button has focus. [[Texture Attributes|See here for additional information about textures.]]
|- class="userrow"
|-  
| class="usercell" | '''texturenofocus'''
| '''texturenofocus'''
| class="usercell" | Specifies the image file which should be displayed when the button does not have focus.
| Specifies the image file which should be displayed when the button does not have focus.
|- class="userrow"
|-  
| class="usercell" | '''textureradioon'''
| '''textureradioon'''
| class="usercell" | Specifies the image file which should be displayed for the radio button portion when it's the button is on. This texture is positioned on the right of the button – it's positioned 24 pixels from the right edge of the button, and 8 pixels above the center vertically.
| Specifies the image file which should be displayed for the radio button portion when it's the button is on. This texture is positioned on the right of the button – it's positioned 24 pixels from the right edge of the button, and 8 pixels above the center vertically.
|- class="userrow"
|-  
| class="usercell" | '''textureradiooff'''
| '''textureradiooff'''
| class="usercell" | Specifies the image file which should be displayed for the radio button portion when the button is off.
| Specifies the image file which should be displayed for the radio button portion when the button is off.
|- class="userrow"
|-  
| class="usercell" | '''label'''
| '''label'''
| class="usercell" | The label used on the button. It can be a link into strings.xml, or an actual text label.
| The label used on the button. It can be a link into strings.xml, or an actual text label.
|- class="userrow"
|-  
| class="usercell" | '''font'''
| '''font'''
| class="usercell" | Font used for the button label. From fonts.xml.
| Font used for the button label. From fonts.xml.
|- class="userrow"
|-  
| class="usercell" | '''textcolor'''
| '''textcolor'''
| class="usercell" | Color used for displaying the button label. In AARRGGBB hex format, or a name from the [[Colour Themes|colour theme.]]
| Color used for displaying the button label. In AARRGGBB hex format, or a name from the [[Colour Themes|colour theme.]]
|- class="userrow"
|-  
| class="usercell" | '''disabledcolor'''
| '''disabledcolor'''
| class="usercell" | Color used for the button label if the button is disabled.  In AARRGGBB hex format, or a name from the [[Colour Themes|colour theme.]]
| Color used for the button label if the button is disabled.  In AARRGGBB hex format, or a name from the [[Colour Themes|colour theme.]]
|- class="userrow"
|-  
| class="usercell" | '''shadowcolor'''
| '''shadowcolor'''
| class="usercell" | Specifies the color of the drop shadow on the text, in AARRGGBB format, or a name from the [[Colour Themes|colour theme.]]
| Specifies the color of the drop shadow on the text, in AARRGGBB format, or a name from the [[Colour Themes|colour theme.]]
|- class="userrow"
|-  
| class="usercell" | '''align'''
| '''align'''
| class="usercell" | Label horizontal alignment on the button. Defaults to left, can also be center or right.
| Label horizontal alignment on the button. Defaults to left, can also be center or right.
|- class="userrow"
|-  
| class="usercell" | '''aligny'''
| '''aligny'''
| class="usercell" | Label vertical alignment on the button. Defaults to top, can also be center.
| Label vertical alignment on the button. Defaults to top, can also be center.
|- class="userrow"
|-  
| class="usercell" | '''textoffsetx'''
| '''textoffsetx'''
| class="usercell" | Amount to offset the label from the left (or right) edge of the button when using left or right alignment.
| Amount to offset the label from the left (or right) edge of the button when using left or right alignment.
|- class="userrow"
|-  
| class="usercell" | '''textoffsety'''
| '''textoffsety'''
| class="usercell" | Amount to offset the label from the top edge of the button when using top alignment.
| Amount to offset the label from the top edge of the button when using top alignment.
|- class="userrow"
|-  
| class="usercell" | '''selected'''
| '''selected'''
| class="usercell" | The boolean condition that when met will cause the control to become selected. [[Conditional Visibility|see here for more information.]]
| The boolean condition that when met will cause the control to become selected. [[Conditional Visibility|see here for more information.]]
|- class="userrow"
|-  
| class="usercell" | '''onclick'''
| '''onclick'''
| class="usercell" | The function to perform when the radio button is clicked. Should be a [[Built-in functions available to FTP, Webserver, skins, keymap and to python|built in function.]]
| The function to perform when the radio button is clicked. Should be a [[Built-in functions available to FTP, Webserver, skins, keymap and to python|built in function.]]
|- class="userrow"
|-  
| class="usercell" | '''radioposx'''
| '''radioposx'''
| class="usercell" | X offset of the ''dot'' or radio button itself
| X offset of the ''dot'' or radio button itself
|- class="userrow"
|-  
| class="usercell" | '''radioposy'''
| '''radioposy'''
| class="usercell" | Y offset of the ''dot'' or radio button itself
| Y offset of the ''dot'' or radio button itself
|- class="userrow"
|-  
| class="usercell" | '''radiowidth'''
| '''radiowidth'''
| class="usercell" | Width in Pixels of the ''dot'' or radio button itself
| Width in Pixels of the ''dot'' or radio button itself
|- class="userrow"
|-  
| class="usercell" | '''radioheight'''
| '''radioheight'''
| class="usercell" | Height in Pixels offset of the ''dot'' or radio button itself
| Height in Pixels offset of the ''dot'' or radio button itself
|}
|}


[[category:Skin Development]]
[[Category:Skin Development]]
[[category:Python]]
[[Category:Python]]

Revision as of 07:53, 26 November 2011

The radio button control is used for creating push button on/off settings in XBMC. You can choose the position, size, and look of the button. When the user clicks on the radio button, the state will change, toggling the extra textures (textureradiofocus and textureradionofocus). Used for settings controls.

Example

<control type="radiobutton" id="2">
      <description>My first radiobutton control</description>
      <type>radiobutton</type>
      <posx>80</posx>
      <posy>60</posy>
      <width>250</width>
      <height>200</height>
      <visible>true</visible>
      <colordiffuse>FFFFFFFF</colordiffuse>
      <texturefocus>myfocustexture.png</texturefocus>
      <texturenofocus>mynormaltexture.png</texturenofocus>
      <textureradioon>myradiobutton.png</textureradioon>
      <textureradiooff>myradiobutton_nf.png</textureradiooff>
      <selected>Player.Paused</selected>
      <onclick>PlayerControls(Pause)</onclick>
      <label>29</label>
      <font>font12</font>
      <textcolor>FFFFFFFF</textcolor>
      <disabledcolor>80FFFFFF</disabledcolor>
      <align>left</align>
      <aligny>center</aligny>
      <textoffsetx>4</textoffsetx>
      <textoffsety>5</textoffsety>
      <pulseonselect>false</pulseonselect>
      <onup>2</onup>
      <ondown>3</ondown>
      <onleft>1</onleft>
      <onright>1</onright>
</control>

Available Tags

In addition to the Default Control Tags the following tags are available. Note that each tag is lower case only. This is important, as xml tags are case-sensitive.

texturefocus

Specifies the image file which should be displayed when the button has focus. See here for additional information about textures.

texturenofocus Specifies the image file which should be displayed when the button does not have focus.
textureradioon Specifies the image file which should be displayed for the radio button portion when it's the button is on. This texture is positioned on the right of the button – it's positioned 24 pixels from the right edge of the button, and 8 pixels above the center vertically.
textureradiooff Specifies the image file which should be displayed for the radio button portion when the button is off.
label The label used on the button. It can be a link into strings.xml, or an actual text label.
font Font used for the button label. From fonts.xml.
textcolor Color used for displaying the button label. In AARRGGBB hex format, or a name from the colour theme.
disabledcolor Color used for the button label if the button is disabled. In AARRGGBB hex format, or a name from the colour theme.
shadowcolor Specifies the color of the drop shadow on the text, in AARRGGBB format, or a name from the colour theme.
align Label horizontal alignment on the button. Defaults to left, can also be center or right.
aligny Label vertical alignment on the button. Defaults to top, can also be center.
textoffsetx Amount to offset the label from the left (or right) edge of the button when using left or right alignment.
textoffsety Amount to offset the label from the top edge of the button when using top alignment.
selected The boolean condition that when met will cause the control to become selected. see here for more information.
onclick The function to perform when the radio button is clicked. Should be a built in function.
radioposx X offset of the dot or radio button itself
radioposy Y offset of the dot or radio button itself
radiowidth Width in Pixels of the dot or radio button itself
radioheight Height in Pixels offset of the dot or radio button itself