HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions
v1::text_field_delegate Class Reference
Inheritance diagram for v1::text_field_delegate:
v1::default_text_field_delegate< T > v1::default_text_field_delegate< T >

Public Types

using callback_ptr_type = std::shared_ptr<std::function<void()>>
 

Public Member Functions

virtual void init (text_field_widget const &sender) noexcept
 
virtual void deinit (text_field_widget const &sender) noexcept
 
auto subscribe (text_field_widget &sender, callback_flags flags, std::invocable<> auto &&callback) noexcept
 
auto subscribe (text_field_widget &sender, std::invocable<> auto &&callback) noexcept
 
virtual label validate (text_field_widget &sender, std::string_view text) noexcept
 Validate the text field.
 
virtual std::string text (text_field_widget &sender) noexcept
 Get the text to show in the text field.
 
virtual void set_text (text_field_widget &sender, std::string_view text) noexcept
 Set the text as entered by the user.
 

Member Function Documentation

◆ set_text()

virtual void v1::text_field_delegate::set_text ( text_field_widget & sender,
std::string_view text )
inlinevirtualnoexcept

Set the text as entered by the user.

When the user causes a text field to commit, by pressing enter, tab, or clicking outside the field and when the text was validated the widget will call this function to commit the text with the delegate.

Precondition
text Must have been validated as correct.
Parameters
textThe text entered by the user.

Reimplemented in v1::default_text_field_delegate< T >, and v1::default_text_field_delegate< T >.

◆ text()

virtual std::string v1::text_field_delegate::text ( text_field_widget & sender)
inlinevirtualnoexcept

Get the text to show in the text field.

When the user is not editing the text the text-field will request what to show using this function.

Returns
The text to show in the text field.

Reimplemented in v1::default_text_field_delegate< T >, and v1::default_text_field_delegate< T >.

◆ validate()

virtual label v1::text_field_delegate::validate ( text_field_widget & sender,
std::string_view text )
inlinevirtualnoexcept

Validate the text field.

Parameters
textThe text entered by the user into the text field.
Returns
no-value when valid, or a label to display to the user when invalid.

Reimplemented in v1::default_text_field_delegate< T >, and v1::default_text_field_delegate< T >.


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