Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
XBMCAddon::xbmcgui::ControlRadioButton Class Reference

#include <Control.h>

Inheritance diagram for XBMCAddon::xbmcgui::ControlRadioButton:
XBMCAddon::xbmcgui::Control XBMCAddon::AddonClass

Public Member Functions

 ControlRadioButton (long x, long y, long width, long height, const String &label, const char *focusOnTexture=NULL, const char *noFocusOnTexture=NULL, const char *focusOffTexture=NULL, const char *noFocusOffTexture=NULL, const char *focusTexture=NULL, const char *noFocusTexture=NULL, long textOffsetX=CONTROL_TEXT_OFFSET_X, long textOffsetY=CONTROL_TEXT_OFFSET_Y, long _alignment=(XBFONT_LEFT|XBFONT_CENTER_Y), const char *font=NULL, const char *textColor=NULL, const char *disabledColor=NULL, long angle=0, const char *shadowColor=NULL, const char *focusedColor=NULL, const char *disabledOnTexture=NULL, const char *disabledOffTexture=NULL)
 
 setSelected (...)
 

Function: setSelected(selected)


Sets the radio buttons's selected status.
 
 isSelected ()
 

Function: isSelected()


Returns the radio buttons's selected status.
 
 setLabel (...)
 

Function: setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor])


Sets the radio buttons text attributes.
 
 setRadioDimension (...)
 

Function: setRadioDimension(x, y, width, height)


Sets the radio buttons's radio texture's position and size.
 
bool canAcceptMessages (int actionId) override
 
CGUIControlCreate () override
 
 ControlRadioButton ()=default
 
- Public Member Functions inherited from XBMCAddon::xbmcgui::Control
 ~Control () override
 
 getId () inline bool operator
 

Function: getId()


Returns the control's current id as an integer.
 
 getX ()
 

Function: getX()


Returns the control's current X position.
 
 getY ()
 

Function: getY()


Returns the control's current Y position.
 
 getHeight ()
 

Function: getHeight()


Returns the control's current height as an integer.
 
 getWidth ()
 

Function: getWidth()


Returns the control's current width as an integer.
 
 setEnabled (...)
 

Function: setEnabled(enabled)


Sets the control's enabled/disabled state.
 
 setVisible (...)
 

Function: setVisible(visible)


Sets the control's visible/hidden state.
 
 isVisible (...)
 

Function: isVisible()


Get the control's visible/hidden state with respect to the container/window
 
 setVisibleCondition (...)
 

Function: setVisibleCondition(visible[,allowHiddenFocus])


Sets the control's visible condition.
 
 setEnableCondition (...)
 

Function: setEnableCondition(enable)


Sets the control's enabled condition.
 
 setAnimations (...)
 

Function: setAnimations([(event, attr,)*])


Sets the control's animations.
 
 setPosition (...)
 

Function: setPosition(x, y)


Sets the controls position.
 
 setWidth (...)
 

Function: setWidth(width)


Sets the controls width.
 
 setHeight (...)
 

Function: setHeight(height)


Sets the controls height.
 
 setNavigation (...)
 

Function: setNavigation(up, down, left, right)


Sets the controls navigation.
 
 controlUp (...)
 

Function: controlUp(control)


Sets the controls up navigation.
 
 controlDown (...)
 

Function: controlDown(control)


Sets the controls down navigation.
 
 controlLeft (...)
 

Function: controlLeft(control)


Sets the controls left navigation.
 
 controlRight (...)
 

Function: controlRight(control)


Sets the controls right navigation.
 
- Public Member Functions inherited from XBMCAddon::AddonClass
 AddonClass ()
 
virtual ~AddonClass ()
 
const char * GetClassname () const
 
LanguageHookGetLanguageHook ()
 
bool isDeallocating ()
 
void Release () const
 
void Acquire () const
 

Public Attributes

std::string strFont
 
std::string strText
 
std::string strTextureFocus
 
std::string strTextureNoFocus
 
std::string strTextureRadioOnFocus
 
std::string strTextureRadioOnNoFocus
 
std::string strTextureRadioOffFocus
 
std::string strTextureRadioOffNoFocus
 
std::string strTextureRadioOnDisabled
 
std::string strTextureRadioOffDisabled
 
KODI::UTILS::COLOR::Color textColor
 
KODI::UTILS::COLOR::Color disabledColor
 
int textOffsetX = 0
 
int textOffsetY = 0
 
uint32_t align
 
int iAngle = 0
 
KODI::UTILS::COLOR::Color shadowColor
 
KODI::UTILS::COLOR::Color focusedColor
 
- Public Attributes inherited from XBMCAddon::xbmcgui::Control
int iControlId = 0
 
int iParentId = 0
 
int dwPosX = 0
 
int dwPosY = 0
 
int dwWidth = 0
 
int dwHeight = 0
 
int iControlUp = 0
 
int iControlDown = 0
 
int iControlLeft = 0
 
int iControlRight = 0
 
std::string m_label {}
 
bool m_visible {true}
 
CGUIControlpGUIControl = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from XBMCAddon::AddonClass
static short getNumAddonClasses ()
 
- Protected Member Functions inherited from XBMCAddon::xbmcgui::Control
 Control ()=default
 
- Protected Member Functions inherited from XBMCAddon::AddonClass
virtual void deallocating ()
 
- Static Protected Member Functions inherited from XBMCAddon::AddonClass
static short getNextClassIndex ()
 
- Protected Attributes inherited from XBMCAddon::AddonClass
LanguageHooklanguageHook
 

Detailed Description

    \defgroup python_xbmcgui_control_radiobutton Subclass - ControlRadioButton
    \ingroup python_xbmcgui_control
    @{
    @brief **A radio button control (as used for on/off settings).**

    \htmlonly <h4><code><span style="font-style: italic;">Class: </span><span style="font-style: bold;"><font color=31363b><big> ControlRadioButton(x, y, width, height, label[, focusOnTexture, noFocusOnTexture,

/// focusOffTexture, noFocusOffTexture, focusTexture, noFocusTexture, /// textOffsetX, textOffsetY, alignment, font, textColor, disabledColor]) </big></font>

    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, as well as the focused and unfocused radio textures. Used
    for settings controls.

    @note This class include also all calls from \ref python_xbmcgui_control "Control"

    @param x                    integer - x coordinate of control.
    @param y                    integer - y coordinate of control.
    @param width                integer - width of control.
    @param height               integer - height of control.
    @param label                string or unicode - text string.
    @param focusOnTexture       [opt] string - filename for radio ON
                                focused texture.
    @param noFocusOnTexture     [opt] string - filename for radio ON not
                                focused texture.
    @param focusOfTexture       [opt] string - filename for radio OFF
                                focused texture.
    @param noFocusOffTexture    [opt] string - filename for radio OFF
                                not focused texture.
    @param focusTexture         [opt] string - filename for focused button
                                texture.
    @param noFocusTexture       [opt] string - filename for not focused button
                                texture.
    @param textOffsetX          [opt] integer - horizontal text offset
    @param textOffsetY          [opt] integer - vertical text offset
    @param alignment            [opt] integer - alignment of label
    - \ref kodi_gui_font_alignment "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
    @param font                 [opt] string - font used for label text.
                                (e.g. 'font13')
    @param textColor            [opt] hexstring - color of label when control
                                is enabled.
                                radiobutton's label. (e.g. '0xFFFFFFFF')
    @param disabledColor        [opt] hexstring - color of label when control
                                is disabled. (e.g. '0xFFFF3300')

    @note You can use the above as keywords for arguments and skip certain
          optional arguments.\n
          Once you use a keyword, all following arguments require the
          keyword.\n
          After you create the control, you need to add it to the window with
          addControl().


   --------------------------------------------------------------------------
    \xrefitem python_v13 "v13 Python API changes" ""  New function added.

    **Example:**
    ~~~~~~~~~~~~~{.py}
    ...
    self.radiobutton = xbmcgui.ControlRadioButton(100, 250, 200, 50, 'Enable', font='font14')
    ...
    ~~~~~~~~~~~~~

Constructor & Destructor Documentation

◆ ControlRadioButton() [1/2]

XBMCAddon::xbmcgui::ControlRadioButton::ControlRadioButton ( long x,
long y,
long width,
long height,
const String & label,
const char * focusOnTexture = NULL,
const char * noFocusOnTexture = NULL,
const char * focusOffTexture = NULL,
const char * noFocusOffTexture = NULL,
const char * focusTexture = NULL,
const char * noFocusTexture = NULL,
long textOffsetX = CONTROL_TEXT_OFFSET_X,
long textOffsetY = CONTROL_TEXT_OFFSET_Y,
long _alignment = (XBFONT_LEFT | XBFONT_CENTER_Y),
const char * font = NULL,
const char * textColor = NULL,
const char * disabledColor = NULL,
long angle = 0,
const char * shadowColor = NULL,
const char * focusedColor = NULL,
const char * disabledOnTexture = NULL,
const char * disabledOffTexture = NULL )

◆ ControlRadioButton() [2/2]

XBMCAddon::xbmcgui::ControlRadioButton::ControlRadioButton ( )
default

Member Function Documentation

◆ canAcceptMessages()

bool XBMCAddon::xbmcgui::ControlRadioButton::canAcceptMessages ( int actionId)
inlineoverridevirtual

Reimplemented from XBMCAddon::xbmcgui::Control.

◆ Create()

CGUIControl * XBMCAddon::xbmcgui::ControlRadioButton::Create ( )
overridevirtual

Reimplemented from XBMCAddon::xbmcgui::Control.

◆ isSelected()

bool XBMCAddon::xbmcgui::ControlRadioButton::isSelected ( )

Function: isSelected()


Returns the radio buttons's selected status.

Returns
True if selected on

Example:

...
is = self.radiobutton.isSelected()
...

◆ setLabel()

void XBMCAddon::xbmcgui::ControlRadioButton::setLabel ( ...)

Function: setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor])


Sets the radio buttons text attributes.

Parameters
labelstring or unicode - text string.
font[opt] string - font used for label text. (e.g. 'font13')
textColor[opt] hexstring - color of enabled radio button's label. (e.g. '0xFFFFFFFF')
disabledColor[opt] hexstring - color of disabled radio button's label. (e.g. '0xFFFF3300')
shadowColor[opt] hexstring - color of radio button's label's shadow. (e.g. '0xFF000000')
focusedColor[opt] hexstring - color of focused radio button's label. (e.g. '0xFFFFFF00')
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.

Example:

...
# setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor])
self.radiobutton.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300', '0xFF000000')
...

◆ setRadioDimension()

void XBMCAddon::xbmcgui::ControlRadioButton::setRadioDimension ( ...)

Function: setRadioDimension(x, y, width, height)


Sets the radio buttons's radio texture's position and size.

Parameters
xinteger - x coordinate of radio texture.
yinteger - y coordinate of radio texture.
widthinteger - width of radio texture.
heightinteger - height of radio texture.
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.

Example:

...
self.radiobutton.setRadioDimension(x=100, y=5, width=20, height=20)
...

◆ setSelected()

void XBMCAddon::xbmcgui::ControlRadioButton::setSelected ( ...)

Function: setSelected(selected)


Sets the radio buttons's selected status.

Parameters
selectedbool - True=selected (on) / False=not selected (off)
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.

Example:

...
self.radiobutton.setSelected(True)
...

Member Data Documentation

◆ align

uint32_t XBMCAddon::xbmcgui::ControlRadioButton::align

◆ disabledColor

KODI::UTILS::COLOR::Color XBMCAddon::xbmcgui::ControlRadioButton::disabledColor

◆ focusedColor

KODI::UTILS::COLOR::Color XBMCAddon::xbmcgui::ControlRadioButton::focusedColor

◆ iAngle

int XBMCAddon::xbmcgui::ControlRadioButton::iAngle = 0

◆ shadowColor

KODI::UTILS::COLOR::Color XBMCAddon::xbmcgui::ControlRadioButton::shadowColor

◆ strFont

std::string XBMCAddon::xbmcgui::ControlRadioButton::strFont

◆ strText

std::string XBMCAddon::xbmcgui::ControlRadioButton::strText

◆ strTextureFocus

std::string XBMCAddon::xbmcgui::ControlRadioButton::strTextureFocus

◆ strTextureNoFocus

std::string XBMCAddon::xbmcgui::ControlRadioButton::strTextureNoFocus

◆ strTextureRadioOffDisabled

std::string XBMCAddon::xbmcgui::ControlRadioButton::strTextureRadioOffDisabled

◆ strTextureRadioOffFocus

std::string XBMCAddon::xbmcgui::ControlRadioButton::strTextureRadioOffFocus

◆ strTextureRadioOffNoFocus

std::string XBMCAddon::xbmcgui::ControlRadioButton::strTextureRadioOffNoFocus

◆ strTextureRadioOnDisabled

std::string XBMCAddon::xbmcgui::ControlRadioButton::strTextureRadioOnDisabled

◆ strTextureRadioOnFocus

std::string XBMCAddon::xbmcgui::ControlRadioButton::strTextureRadioOnFocus

◆ strTextureRadioOnNoFocus

std::string XBMCAddon::xbmcgui::ControlRadioButton::strTextureRadioOnNoFocus

◆ textColor

KODI::UTILS::COLOR::Color XBMCAddon::xbmcgui::ControlRadioButton::textColor

◆ textOffsetX

int XBMCAddon::xbmcgui::ControlRadioButton::textOffsetX = 0

◆ textOffsetY

int XBMCAddon::xbmcgui::ControlRadioButton::textOffsetY = 0

The documentation for this class was generated from the following files: