HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Data Fields | Static Public Attributes
hi::v1::default_toggle_delegate< T > Class Template Reference

#include <hikogui/widgets/toggle_delegate.hpp>

Inheritance diagram for hi::v1::default_toggle_delegate< T >:
hi::v1::toggle_delegate

Public Types

using value_type = T
 

Public Member Functions

template<forward_of< observer< value_type > > Value, forward_of< observer< value_type > > OnValue, forward_of< observer< value_type > > OffValue>
 default_toggle_delegate (Value &&value, OnValue &&on_value, OffValue &&off_value) noexcept
 Construct a delegate.
 
template<forward_of< observer< value_type > > Value, forward_of< observer< value_type > > OnValue>
requires can_make_defaults
 default_toggle_delegate (Value &&value, OnValue &&on_value) noexcept
 Construct a delegate.
 
template<forward_of< observer< value_type > > Value>
requires can_make_defaults
 default_toggle_delegate (Value &&value) noexcept
 Construct a delegate.
 
- Public Member Functions inherited from hi::v1::toggle_delegate
virtual void init (widget_intf const &sender) noexcept
 
virtual void deinit (widget_intf const &sender) noexcept
 
template<forward_of< void()> Func>
callback< void()> subscribe (Func &&func, callback_flags flags=callback_flags::synchronous) noexcept
 Subscribe a callback for notifying the widget of a data change.
 

Data Fields

observer< value_type > value
 
observer< value_type > on_value
 
observer< value_type > off_value
 

Static Public Attributes

static constexpr bool can_make_defaults
 

Detailed Description

template<std::equality_comparable T>
class hi::v1::default_toggle_delegate< T >

A default toggle button delegate.

The default toggle button delegate manages the state of a button widget using observer values.

Template Parameters
TThe type of the observer value.

Constructor & Destructor Documentation

◆ default_toggle_delegate() [1/3]

template<std::equality_comparable T>
template<forward_of< observer< value_type > > Value, forward_of< observer< value_type > > OnValue, forward_of< observer< value_type > > OffValue>
hi::v1::default_toggle_delegate< T >::default_toggle_delegate ( Value && value,
OnValue && on_value,
OffValue && off_value )
inlinenoexcept

Construct a delegate.

Parameters
valueA value or observer-value used as a representation of the state.
on_valueThe value or observer-value that mean 'on'.
off_valueThe value or observer-value that mean 'off'.

◆ default_toggle_delegate() [2/3]

template<std::equality_comparable T>
template<forward_of< observer< value_type > > Value, forward_of< observer< value_type > > OnValue>
requires can_make_defaults
hi::v1::default_toggle_delegate< T >::default_toggle_delegate ( Value && value,
OnValue && on_value )
inlinenoexcept

Construct a delegate.

Parameters
valueA value or observer-value used as a representation of the state.
on_valueThe value or observer-value that mean 'on'.

◆ default_toggle_delegate() [3/3]

template<std::equality_comparable T>
template<forward_of< observer< value_type > > Value>
requires can_make_defaults
hi::v1::default_toggle_delegate< T >::default_toggle_delegate ( Value && value)
inlinenoexcept

Construct a delegate.

Parameters
valueA value or observer-value used as a representation of the state.

Field Documentation

◆ can_make_defaults

template<std::equality_comparable T>
constexpr bool hi::v1::default_toggle_delegate< T >::can_make_defaults
staticconstexpr
Initial value:
=
std::is_same_v<value_type, bool> or std::is_integral_v<value_type> or std::is_enum_v<value_type>

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