Radio Button Control

From DevWiki

Jump to: navigation, search

Applications,Boxee GUI API,Controls

Contents


Overview

Radio button controls are used to create on/off push buttons. When clicked the radio buttons state will change, toggling the extra textures (textureradiofocus and textureradionofocus). Used for settings controls. The radio button can be customized for position, size, looks and text and has several events for push and navigation. Radio buttons can also be contained in grouplists which makes it much simpler to automatically position and navigate between them.


Example

  1. <control type="radiobutton" id="61">   
  2.    <posx>180</posx>
  3.    <posy>0</posy>
  4.    <height>50</height>
  5.    <width>50</width>
  6.    <aligny>top</aligny>
  7.    <texturefocus>-</texturefocus>
  8.    <texturenofocus>-</texturenofocus>
  9.    <textureradiofocus>settings_radio_button_selected.png</textureradiofocus>
  10.    <textureradionofocus>settings_radio_button.png</textureradionofocus>
  11.    <radioposx>2</radioposx>
  12.    <radioposy>8</radioposy>
  13.    <radiowidth>33</radiowidth>
  14.    <radioheight>33</radioheight>
  15.    <onup>50</onup>
  16.    <ondown>72</ondown>
  17.    <onright>62</onright>
  18.    <onleft>-</onleft>
  19.    <label>Video</label>
  20.    <focusedcolor>green</focusedcolor>
  21.    <textcolor>grey</textcolor>
  22.    <textoffsetx>50</textoffsetx>
  23.    <textoffsety>9</textoffsety>
  24.    <font>font23</font>
  25.    <hitrect x="180" y="0" w="110" h="50"/>
  26. </control>


Available Tags

In addition to the Default Control Properties the following tags are available. Note that all XML tags are in lower case.

Element Description Required
texturefocus Specifies the image file which should be displayed when the button has focus. No
texturenofocus Specifies the image file which should be displayed when the button does not have focus. No
textureradiofocus 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. As it’s not displayed when the button is off, you may wish to have the off-state look rendered into the texturefocus and texturenofocus images. No
textureradionofocus Specifies the image file which should be displayed for the radio button portion when the button is on but does not have focus. No
selected Specifies the conditions under which the Alternative Textures should be shown. Yes
label The label used on the button. It can be a link into strings.xml, or an actual text label. No
radioposx X offset of the radio button itself No
radioposy Y offset of the radio button itself No
radiowidth Width in Pixels of the radio button itself No
radioheight Height in Pixels of the radio button itself No
font Font used for the button label. From the skin /720p/fonts.xml. No
textcolor Color used for displaying the button label. In AARRGGBB hex format or a name from the skin color themes /colors/defaults.xml. No
focusedcolor Color used for the button label when the button has in focus. In AARRGGBB hex format or a name from the skin color themes /colors/defaults.xml. No
disabledcolor Color used for the button label if the button is disabled. In AARRGGBB hex format or a name from the skin color themes /colors/defaults.xml. No
shadowcolor Specifies the color of the drop shadow on the text. In AARRGGBB hex format or a name from the skin color themes /colors/defaults.xml. No
angle The angle the text should be rendered at, in degrees. A value of 0 is horizontal. No
align Label horizontal alignment on the button. Defaults to left, can also be center or right. No
aligny Label vertical alignment on the button. Defaults to top, can also be center. No
textoffsetx Amount to offset the label from the left (or right) edge of the button when using left or right alignment. No
textoffsety Amount to offset the label from the top edge of the button when using top alignment. No


Available Events

In addition to the Default Control Properties the following tags are available. Note that all XML tags are in lower case.

Element Description Required
onclick Specifies actions or a python script which will run when the button is pressed. You may have more than one <onclick> tag, and they’ll be executed in sequence. Yes
onfocus Specifies actions or a python script which will run when the button is focused. The action is performed after any focus animations have completed. No
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox