Radio button control: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
 
(17 intermediate revisions by 7 users not shown)
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 (textureradioon and textureradiooff). Used for settings controls.
<section begin="main content" />
The radio button control is used for creating push button on/off settings in Kodi. 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 (textureradioon and textureradiooff). Used for settings controls.
=== Example ===
=== Example ===
<source lang="xml">
<syntaxhighlight lang="XML" enclose="div">
<control type="radiobutton" id="2">
<control type="radiobutton" id="2">
       <description>My first radiobutton control</description>
       <description>My first radiobutton control</description>
       <type>radiobutton</type>
       <type>radiobutton</type>
       <posx>80</posx>
       <left>80</left>
       <posy>60</posy>
       <top>60</top>
       <width>250</width>
       <width>250</width>
       <height>200</height>
       <height>200</height>
Line 13: Line 14:
       <texturefocus>myfocustexture.png</texturefocus>
       <texturefocus>myfocustexture.png</texturefocus>
       <texturenofocus>mynormaltexture.png</texturenofocus>
       <texturenofocus>mynormaltexture.png</texturenofocus>
       <textureradioon>myradiobutton.png</textureradioon>
       <textureradioonfocus colordiffuse="FFFFAAFF">myradiobutton.png</textureradioonfocus>
       <textureradiooff>myradiobutton_nf.png</textureradiooff>
       <textureradioonnofocus colordiffuse="FFFFAAFF">myradiobutton.png</textureradioonnofocus>
      <textureradioofffocus colordiffuse="FFFFAAFF">myradiobutton_nf.png</textureradioofffocus>
      <textureradiooffnofocus colordiffuse="FFFFAAFF">myradiobutton_nf.png</textureradiooffnofocus>
       <selected>Player.Paused</selected>
       <selected>Player.Paused</selected>
       <onclick>PlayerControls(Pause)</onclick>
       <onclick>PlayerControls(Pause)</onclick>
Line 27: Line 30:
       <textoffsety>5</textoffsety>
       <textoffsety>5</textoffsety>
       <pulseonselect>false</pulseonselect>
       <pulseonselect>false</pulseonselect>
       <onfocus>-</onfocus>
       <onfocus></onfocus>
       <onunfocus>-</onunfocus>
       <onunfocus></onunfocus>
       <onup>2</onup>
       <onup>2</onup>
       <ondown>3</ondown>
       <ondown>3</ondown>
Line 34: Line 37:
       <onright>1</onright>
       <onright>1</onright>
</control>
</control>
</source>
</syntaxhighlight>


=== 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="wikitable"
{| class="prettytable"
! Tag !! Description
|-  
|-  
|  '''texturefocus'''
|  '''texturefocus'''
Line 46: Line 50:
|  '''texturenofocus'''
|  '''texturenofocus'''
|  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.
|-
|  '''textureradioonfocus'''
|  Specifies the image file which should be displayed for the radio button portion when it's the button is on and focused. 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.
|-
|  '''textureradioonnofocus'''
|  Specifies the image file which should be displayed for the radio button portion when it's the button is on and unfocused. 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.
|-  
|-  
|  '''textureradioon'''
|  '''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.
|  A shortcut to set both of the above textures to the same image file.
|-
|  '''textureradioondisabled'''
|  Specifies the image file which should be displayed for the radio button portion when the button is on and disabled.
|-
|  '''textureradioofffocus'''
|  Specifies the image file which should be displayed for the radio button portion when the button is off and focused.
|-
|  '''textureradiooffnofocus'''
|  Specifies the image file which should be displayed for the radio button portion when the button is off and unfocused.
|-  
|-  
|  '''textureradiooff'''
|  '''textureradiooff'''
|  Specifies the image file which should be displayed for the radio button portion when the button is off.
|  A shortcut to set both of the above textures to the same image file.
|-
|  '''textureradioondisabled'''
|  Specifies the image file which should be displayed for the radio button portion when the button is off and disabled.
|-  
|-  
|  '''label'''
|  '''label'''
|  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.po, or an actual text label.
|-
|  '''label2'''
|  Optional. Will display an 'on' or 'off' label. Only available if you specify an empty radiowidth and radioheight.
|-  
|-  
|  '''font'''
|  '''font'''
Line 60: Line 85:
|-  
|-  
|  '''textcolor'''
|  '''textcolor'''
|  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.]]
|-   
|-   
|  '''focusedcolor'''
|  '''focusedcolor'''
|  Color used for the button label when the button has in focus. In AARRGGBB hex format or a name from the [[Colour Themes|colour theme.]]
|  Color used for the button label when the button has in focus. In AARRGGBB hex format or a name from the [[Colour themes|colour theme.]]
|-  
|-  
|  '''disabledcolor'''
|  '''disabledcolor'''
|  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.]]
|-  
|-  
|  '''shadowcolor'''
|  '''shadowcolor'''
|  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.]]
|-  
|-  
|  '''align'''
|  '''align'''
Line 82: Line 107:
|  '''textoffsety'''
|  '''textoffsety'''
|  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.
|- 
| '''textwidth'''
| Will truncate any text that's too long.
|-  
|-  
|  '''selected'''
|  '''selected'''
|  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.]]
|-  
|-  
|  '''onclick'''
|  '''onclick'''
|  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_scripting|built in function.]]
|-  
|-  
|  '''radioposx'''
|  '''radioposx'''
Line 99: Line 127:
|-  
|-  
|  '''radioheight'''
|  '''radioheight'''
|  Height in Pixels offset of the ''dot'' or radio button itself
|  Height in Pixels of the ''dot'' or radio button itself
|-
|-
| '''onfocus'''
| '''onfocus'''
| Specifies the action to perform when the button is focused. Should be a built in function. The action is performed after any focus animations have completed. [[List of Built In Functions|See here for more information.]]
| Specifies the action to perform when the button is focused. Should be a built in function. The action is performed after any focus animations have completed. [[List_of_built-in_functions|See here for more information.]]
|-   
|-   
|  '''onunfocus'''
|  '''onunfocus'''
| Specifies the action to perform when the button loses focus. Should be a built in function.
| Specifies the action to perform when the button loses focus. Should be a built in function.
|}
|}
<section end="main content" />


== See also ==
== See also ==
Line 113: Line 143:
* [[Skinning]]
* [[Skinning]]


[[Category:Skin Development]]
[[Category:Skin development]]

Latest revision as of 00:52, 14 April 2022

The radio button control is used for creating push button on/off settings in Kodi. 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 (textureradioon and textureradiooff). Used for settings controls.

Example

<control type="radiobutton" id="2">
      <description>My first radiobutton control</description>
      <type>radiobutton</type>
      <left>80</left>
      <top>60</top>
      <width>250</width>
      <height>200</height>
      <visible>true</visible>
      <colordiffuse>FFFFFFFF</colordiffuse>
      <texturefocus>myfocustexture.png</texturefocus>
      <texturenofocus>mynormaltexture.png</texturenofocus>
      <textureradioonfocus colordiffuse="FFFFAAFF">myradiobutton.png</textureradioonfocus>
      <textureradioonnofocus colordiffuse="FFFFAAFF">myradiobutton.png</textureradioonnofocus>
      <textureradioofffocus colordiffuse="FFFFAAFF">myradiobutton_nf.png</textureradioofffocus>
      <textureradiooffnofocus colordiffuse="FFFFAAFF">myradiobutton_nf.png</textureradiooffnofocus>
      <selected>Player.Paused</selected>
      <onclick>PlayerControls(Pause)</onclick>
      <label>29</label>
      <font>font12</font>
      <textcolor>FFFFFFFF</textcolor>
      <focusedcolor>FFFFFFFF</focusedcolor>
      <disabledcolor>80FFFFFF</disabledcolor>
      <align>left</align>
      <aligny>center</aligny>
      <textoffsetx>4</textoffsetx>
      <textoffsety>5</textoffsety>
      <pulseonselect>false</pulseonselect>
      <onfocus></onfocus>
      <onunfocus></onunfocus>
      <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.

Tag Description
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.
textureradioonfocus Specifies the image file which should be displayed for the radio button portion when it's the button is on and focused. 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.
textureradioonnofocus Specifies the image file which should be displayed for the radio button portion when it's the button is on and unfocused. 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.
textureradioon A shortcut to set both of the above textures to the same image file.
textureradioondisabled Specifies the image file which should be displayed for the radio button portion when the button is on and disabled.
textureradioofffocus Specifies the image file which should be displayed for the radio button portion when the button is off and focused.
textureradiooffnofocus Specifies the image file which should be displayed for the radio button portion when the button is off and unfocused.
textureradiooff A shortcut to set both of the above textures to the same image file.
textureradioondisabled Specifies the image file which should be displayed for the radio button portion when the button is off and disabled.
label The label used on the button. It can be a link into strings.po, or an actual text label.
label2 Optional. Will display an 'on' or 'off' label. Only available if you specify an empty radiowidth and radioheight.
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.
focusedcolor Color used for the button label when the button has in focus. 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.
textwidth Will truncate any text that's too long.
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 of the dot or radio button itself
onfocus Specifies the action to perform when the button is focused. Should be a built in function. The action is performed after any focus animations have completed. See here for more information.
onunfocus Specifies the action to perform when the button loses focus. Should be a built in function.


See also

Development: