Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
Control Radio Button

\cpp_class{ kodi::gui::controls::CRadioButton } Window control for a radio button (as used for on/off settings) More...

Functions

 kodi::gui::controls::CRadioButton::CRadioButton (CWindow *window, int controlId)
 Construct a new control. More...
 
 kodi::gui::controls::CRadioButton::~CRadioButton () override=default
 Destructor. More...
 
void kodi::gui::controls::CRadioButton::SetVisible (bool visible)
 Set the control on window to visible. More...
 
void kodi::gui::controls::CRadioButton::SetEnabled (bool enabled)
 Set's the control's enabled/disabled state. More...
 
void kodi::gui::controls::CRadioButton::SetLabel (const std::string &label)
 To set the text string on radio button. More...
 
std::string kodi::gui::controls::CRadioButton::GetLabel () const
 Get the used text from control. More...
 
void kodi::gui::controls::CRadioButton::SetSelected (bool selected)
 To set radio button condition to on or off. More...
 
bool kodi::gui::controls::CRadioButton::IsSelected () const
 Get the current selected condition of radio button. More...
 

Detailed Description

\cpp_class{ kodi::gui::controls::CRadioButton } Window control for a radio button (as used for on/off settings)

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.

It has the header #include <kodi/gui/controls/RadioButton.h> be included to enjoy it.

Here you find the needed skin part for a radio button control

Note
The call of the control is only possible from the corresponding window as its class and identification number is required.

Function Documentation

◆ CRadioButton()

kodi::gui::controls::CRadioButton::CRadioButton ( CWindow window,
int  controlId 
)
inline

Construct a new control.

Parameters
[in]windowrelated window control class
[in]controlIdUsed skin xml control id

◆ GetLabel()

std::string kodi::gui::controls::CRadioButton::GetLabel ( ) const
inline

Get the used text from control.

Returns
Text shown

◆ IsSelected()

bool kodi::gui::controls::CRadioButton::IsSelected ( ) const
inline

Get the current selected condition of radio button.

Returns
Selected condition

◆ SetEnabled()

void kodi::gui::controls::CRadioButton::SetEnabled ( bool  enabled)
inline

Set's the control's enabled/disabled state.

Parameters
[in]enabledIf true enabled, otherwise disabled

◆ SetLabel()

void kodi::gui::controls::CRadioButton::SetLabel ( const std::string &  label)
inline

To set the text string on radio button.

Parameters
[in]labelText to show

◆ SetSelected()

void kodi::gui::controls::CRadioButton::SetSelected ( bool  selected)
inline

To set radio button condition to on or off.

Parameters
[in]selectedtrue set radio button to selection on, otherwise off

◆ SetVisible()

void kodi::gui::controls::CRadioButton::SetVisible ( bool  visible)
inline

Set the control on window to visible.

Parameters
[in]visibleIf true visible, otherwise hidden

◆ ~CRadioButton()

kodi::gui::controls::CRadioButton::~CRadioButton ( )
overridedefault

Destructor.