Select Button Control

From DevWiki

Jump to: navigation, search

Applications,Boxee GUI API,Controls

Contents


Overview

The select button control is used for creating a push button that hides multiple options in Boxee. You can choose the position, size, and look of the button, as well as what it looks like when it's pushed in (option arrows etc.) When the button is pushed, two arrows pop up allowing you to alter the contents of the button (thus select different options)


Example

  1. <control type="selectbutton" id="4">
  2.    <description>My first select button control</description>
  3.    <posx>80</posx>
  4.    <posy>60</posy>
  5.    <width>250</width>
  6.    <height>200</height>
  7.    <visible>true</visible>
  8.    <colordiffuse>FFFFFFFF</colordiffuse>
  9.    <texturefocus>myfocustexture.png</texturefocus>
  10.    <texturenofocus>mynormaltexture.png</texturenofocus>
  11.    <texturebg>mybgtexture.png</texturebg>
  12.    <textureleft>mylefttexture.png</textureleft>
  13.    <textureleftfocus>myleftfocustexture.png</textureleftfocus>
  14.    <textureright>myrighttexture.png</textureright>
  15.    <texturerightfocus>myrightfocustexture.png</texturerightfocus>
  16.    <label>29</label>
  17.    <font>font12</font>
  18.    <textcolor>FFFFFFFF</textcolor>
  19.    <disabledcolor>80FFFFFF</disabledcolor>
  20.    <align></align>
  21.    <alignY></alignY>
  22.    <textoffsetx></textoffsetx>
  23.    <textoffsety></textoffsety>
  24.    <pulseonselect></pulseonselect>
  25.    <onup>2</onup>
  26.    <ondown>3</ondown>
  27.    <onleft>1</onleft>
  28.    <onright>1</onright>
  29. </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. See here for additional information about textures. Yes
texturenofocus Specifies the image file which should be displayed when the button does not have focus. Yes
texturebg This texture is rendered in the background, replacing the texturefocus and texturenofocus textures, when the button is pushed in. No
textureleft The texture of the left arrow item when it's not focused. Displayed at the left of the button when it is selected. No
textureleftfocus The texture of the left arrow item when it's focused. Displayed at the left of the button when it is selected. No
textureright The texture of the right arrow item when it's not focused. Displayed at the right of the button when it is selected. No
texturerightfocus The texture of the right arrow item when it's focused. Displayed at the right of the button when it is selected. No
label The label used on the button. It can be a link into strings.xml, or an actual text label. No
font Font used for the button label. From fonts.xml. No
textcolor Color used for displaying the button label. In AARRGGBB hex format, or a name from the colour theme. No
disabledcolor Color used for the button label if the button is disabled. In AARRGGBB hex format, or a name from the colour theme. No
shadowcolor Specifies the color of the drop shadow on the text. In AARRGGBB hex format, or a name from the colour theme. 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


Python Integration

GetButton(controlId:Integer):Button
The button class represents a button control in the user interface.

  1. myButton = mc.GetActiveWindow().GetButton(140)
  1. <onclick lang="python"><![CDATA[
  2. myButton = mc.GetActiveWindow().GetButton(140)
  3. ]]></onclick>


GetLabel

GetLabel():String
Get the label of a button.

  1. oldLabel = myButton.GetLabel()


SetLabel

SetLabel(label:String):Void
Set the label of a button.

  1. myButton.SetLabel('Play')
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox