xbmc
Classes
Subclass - ControlButton

A standard push button control. More...

Collaboration diagram for Subclass - ControlButton:

Classes

class  XBMCAddon::xbmcgui::ControlButton
 

Detailed Description

A standard push button control.

{ ControlButton(x, y, width, height, label[, focusTexture, noFocusTexture, textOffsetX, textOffsetY, alignment, font, textColor, disabledColor, angle, shadowColor, focusedColor]) }

The button control is used for creating push buttons in Kodi. You can choose the position, size, and look of the button, as well as choosing what action(s) should be performed when pushed.

Note
This class include also all calls from Control
Parameters
xinteger - x coordinate of control.
yinteger - y coordinate of control.
widthinteger - width of control.
heightinteger - height of control.
labelstring or unicode - text string.
focusTexture[opt] string - filename for focus texture.
noFocusTexture[opt] string - filename for no focus texture.
textOffsetX[opt] integer - x offset of label.
textOffsetY[opt] integer - y offset of label.
alignment[opt] integer - alignment of label
  • Flags for alignment used as bits to have several together:
    Definition name Bitflag Description
    XBFONT_LEFT 0x00000000 Align X left
    XBFONT_RIGHT 0x00000001 Align X right
    XBFONT_CENTER_X 0x00000002 Align X center
    XBFONT_CENTER_Y 0x00000004 Align Y center
    XBFONT_TRUNCATED 0x00000008 Truncated text
    XBFONT_JUSTIFIED 0x00000010 Justify text
    XBFONT_TRUNCATED_LEFT 0x00000020 Truncated text from left
font[opt] string - font used for label text. (e.g. 'font13')
textColor[opt] hexstring - color of enabled button's label. (e.g. '0xFFFFFFFF')
disabledColor[opt] hexstring - color of disabled button's label. (e.g. '0xFFFF3300')
angle[opt] integer - angle of control. (+ rotates CCW, - rotates CW)
shadowColor[opt] hexstring - color of button's label's shadow. (e.g. '0xFF000000')
focusedColor[opt] hexstring - color of focused button's label. (e.g. '0xFF00FFFF')
Note
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.
After you create the control, you need to add it to the window with addControl().

Example:

...
# ControlButton(x, y, width, height, label[, focusTexture, noFocusTexture, textOffsetX, textOffsetY,
# alignment, font, textColor, disabledColor, angle, shadowColor, focusedColor])
self.button = xbmcgui.ControlButton(100, 250, 200, 50, 'Status', font='font14')
...