Class endstone::ActionForm::Button¶
ClassList > endstone > ActionForm > Button
Represents a button with text and an optional icon.
#include <endstone/form/action_form.h>
Public Types¶
| Type | Name | 
|---|---|
| typedef std::function< void(Player *)> | OnClickCallback   | 
Public Functions¶
| Type | Name | 
|---|---|
| Button () = default | 
|
| Button (Message text, std::optional< std::string > icon=std::nullopt, OnClickCallback on_click={})  | 
|
| std::optional< std::string > | getIcon () const Get the icon of the button.  | 
| OnClickCallback | getOnClick () const Gets the on click callback of the button.  | 
| Message | getText () const Gets the text of the button.  | 
| Button & | setIcon (std::string icon)  Sets the icon for the button.  | 
| Button & | setOnClick (OnClickCallback on_click)  Sets the on click callback of the button.  | 
| Button & | setText (Message text)  Sets the text of the button.  | 
Public Types Documentation¶
typedef OnClickCallback¶
Public Functions Documentation¶
function Button [½]¶
function Button [2/2]¶
inline explicit endstone::ActionForm::Button::Button (
    Message text,
    std::optional< std::string > icon=std::nullopt,
    OnClickCallback on_click={}
) 
function getIcon¶
Get the icon of the button.
Returns:
The path or URL to the icon file
function getOnClick¶
Gets the on click callback of the button.
Returns:
The on click callback of the button.
function getText¶
Gets the text of the button.
Returns:
The text.
function setIcon¶
Sets the icon for the button.
Parameters:
iconThe path or URL to the icon file.
Returns:
A reference to the current button.
function setOnClick¶
Sets the on click callback of the button.
Parameters:
on_clickThe callback to be set.
Returns:
A reference to the current button.
function setText¶
Sets the text of the button.
Parameters:
textThe new text for the button.
Returns:
A reference to the current button.
The documentation for this class was generated from the following file include/endstone/form/action_form.h