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

Public Types

using value_type = T
 
using value_type = T
 
- Public Types inherited from v1::text_field_delegate
using callback_ptr_type = std::shared_ptr<std::function<void()>>
 

Public Member Functions

 default_text_field_delegate (auto &&value) noexcept
 
std::optional< labelvalidate (text_field_widget &sender, std::string_view text) noexcept override
 Validate the text field.
 
std::string text (text_field_widget &sender) noexcept override
 Get the text to show in the text field.
 
void set_text (text_field_widget &sender, std::string_view text) noexcept override
 Set the text as entered by the user.
 
 default_text_field_delegate (auto &&value) noexcept
 
label validate (text_field_widget &sender, std::string_view text) noexcept override
 Validate the text field.
 
std::string text (text_field_widget &sender) noexcept override
 Get the text to show in the text field.
 
void set_text (text_field_widget &sender, std::string_view text) noexcept override
 Set the text as entered by the user.
 
- Public Member Functions inherited from v1::text_field_delegate
virtual void init (text_field_widget const &sender) noexcept
 
virtual void deinit (text_field_widget const &sender) noexcept
 
auto subscribe (text_field_widget &sender, std::invocable<> auto &&callback) noexcept
 

Data Fields

observable< value_type > value
 

Member Function Documentation

◆ set_text() [1/2]

template<std::integral T>
void v1::default_text_field_delegate< T >::set_text ( text_field_widget & sender,
std::string_view text )
inlineoverridevirtualnoexcept

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 from v1::text_field_delegate.

◆ set_text() [2/2]

template<std::integral T>
void v1::default_text_field_delegate< T >::set_text ( text_field_widget & sender,
std::string_view text )
inlineoverridevirtualnoexcept

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 from v1::text_field_delegate.

◆ text() [1/2]

template<std::integral T>
std::string v1::default_text_field_delegate< T >::text ( text_field_widget & sender)
inlineoverridevirtualnoexcept

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 from v1::text_field_delegate.

◆ text() [2/2]

template<std::integral T>
std::string v1::default_text_field_delegate< T >::text ( text_field_widget & sender)
inlineoverridevirtualnoexcept

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 from v1::text_field_delegate.

◆ validate() [1/2]

template<std::integral T>
std::optional< label > v1::default_text_field_delegate< T >::validate ( text_field_widget & sender,
std::string_view text )
inlineoverridevirtualnoexcept

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 from v1::text_field_delegate.

◆ validate() [2/2]

template<std::integral T>
label v1::default_text_field_delegate< T >::validate ( text_field_widget & sender,
std::string_view text )
inlineoverridevirtualnoexcept

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 from v1::text_field_delegate.


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