Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Class: kodi::gui::controls::CButton

Standard push button control for window
The button control is used for creating push buttons in Kodi. More...

Functions

 kodi::gui::controls::CButton::CButton (CWindow *window, int controlId)
 Construct a new control.
 
 kodi::gui::controls::CButton::~CButton () override=default
 Destructor.
 
void kodi::gui::controls::CButton::SetVisible (bool visible)
 Set the control on window to visible.
 
void kodi::gui::controls::CButton::SetEnabled (bool enabled)
 Set's the control's enabled/disabled state.
 
void kodi::gui::controls::CButton::SetLabel (const std::string &label)
 To set the text string on button.
 
std::string kodi::gui::controls::CButton::GetLabel () const
 Get the used text from button.
 
void kodi::gui::controls::CButton::SetLabel2 (const std::string &label)
 If two labels are used for button becomes it set with them.
 
std::string kodi::gui::controls::CButton::GetLabel2 () const
 Get the second label if present.
 

Detailed Description

Class: kodi::gui::controls::CButton

Standard push button control for window
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.

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

Here you find the needed skin part for a 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

◆ CButton()

kodi::gui::controls::CButton::CButton ( 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::CButton::GetLabel ( ) const
inline

Get the used text from button.

Returns
Text shown

◆ GetLabel2()

std::string kodi::gui::controls::CButton::GetLabel2 ( ) const
inline

Get the second label if present.

Returns
Second label

◆ SetEnabled()

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

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

Parameters
[in]enabledIf true enabled, otherwise disabled

◆ SetLabel()

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

To set the text string on button.

Parameters
[in]labelText to show

◆ SetLabel2()

void kodi::gui::controls::CButton::SetLabel2 ( const std::string & label)
inline

If two labels are used for button becomes it set with them.

Parameters
[in]labelText for second label

◆ SetVisible()

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

Set the control on window to visible.

Parameters
[in]visibleIf true visible, otherwise hidden

◆ ~CButton()

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

Destructor.