Skip to content

Class endstone::TextInput

ClassList > endstone > TextInput

Represents a text input field.

  • #include <endstone/form/controls/text_input.h>

Public Functions

Type Name
TextInput () = default
TextInput (Message label, Message placeholder, std::optional< std::string > default_text=std::nullopt)
std::optional< std::string > getDefaultValue () const
Gets the default text of the text input field.
Message getLabel () const
Gets the label of the text input field.
Message getPlaceholder () const
Gets the placeholder of the text input field.
TextInput & setDefaultValue (std::optional< std::string > text)
Sets the default text of the text input field.
TextInput & setLabel (Message label)
Sets the label of the text input field.
TextInput & setPlaceholder (Message placeholder)
Sets the placeholder of the text input field.

Public Functions Documentation

function TextInput [½]

endstone::TextInput::TextInput () = default

function TextInput [2/2]

inline explicit endstone::TextInput::TextInput (
    Message label,
    Message placeholder,
    std::optional< std::string > default_text=std::nullopt
) 

function getDefaultValue

Gets the default text of the text input field.

inline std::optional< std::string > endstone::TextInput::getDefaultValue () const

Returns:

The default text of the text input field.


function getLabel

Gets the label of the text input field.

inline Message endstone::TextInput::getLabel () const

Returns:

The label of the text input field.


function getPlaceholder

Gets the placeholder of the text input field.

inline Message endstone::TextInput::getPlaceholder () const

Returns:

The placeholder of the text input field.


function setDefaultValue

Sets the default text of the text input field.

inline TextInput & endstone::TextInput::setDefaultValue (
    std::optional< std::string > text
) 

Parameters:

  • text The new default text for the text input field.

Returns:

A reference to the text input field itself.


function setLabel

Sets the label of the text input field.

inline TextInput & endstone::TextInput::setLabel (
    Message label
) 

Parameters:

  • label The new label for the text input field.

Returns:

A reference to the text input field itself.


function setPlaceholder

Sets the placeholder of the text input field.

inline TextInput & endstone::TextInput::setPlaceholder (
    Message placeholder
) 

Parameters:

  • placeholder The new placeholder for the text input field.

Returns:

A reference to the text input field itself.



The documentation for this class was generated from the following file include/endstone/form/controls/text_input.h