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

#include <hikogui/widgets/default_button_delegate.hpp>

Inheritance diagram for v1::default_button_delegate< ButtonType, T >:
v1::button_delegate

Public Types

using value_type = T
 

Public Member Functions

 default_button_delegate (auto &&value, auto &&on_value, auto &&off_value) noexcept
 Construct a delegate.
 
 default_button_delegate (auto &&value, auto &&on_value) noexcept
 Construct a delegate.
 
 default_button_delegate (auto &&value) noexcept
 Construct a delegate.
 
- Public Member Functions inherited from v1::button_delegate
virtual void init (abstract_button_widget &sender) noexcept
 
virtual void deinit (abstract_button_widget &sender) noexcept
 
auto subscribe (abstract_button_widget &sender, callback_flags flags, std::invocable<> auto &&callback) noexcept
 Subscribe a callback for notifying the widget of a data change.
 
auto subscribe (abstract_button_widget &sender, std::invocable<> auto &&callback) noexcept
 Subscribe a callback for notifying the widget of a data change.
 

Data Fields

observable< value_type > value
 
observable< value_type > on_value
 
observable< value_type > off_value
 

Static Public Attributes

static constexpr button_type button_type = ButtonType
 
static constexpr bool can_make_defaults
 

Detailed Description

template<button_type ButtonType, typename T>
class v1::default_button_delegate< ButtonType, T >

A default button delegate.

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

Template Parameters
ButtonTypeThe type of button this delegate manages, either a button_type::radio or button_type::toggle.
TThe type of the observable value.

Constructor & Destructor Documentation

◆ default_button_delegate() [1/3]

template<button_type ButtonType, typename T >
v1::default_button_delegate< ButtonType, T >::default_button_delegate ( auto && value,
auto && on_value,
auto && off_value )
inlinenoexcept

Construct a delegate.

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

◆ default_button_delegate() [2/3]

template<button_type ButtonType, typename T >
v1::default_button_delegate< ButtonType, T >::default_button_delegate ( auto && value,
auto && on_value )
inlinenoexcept

Construct a delegate.

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

◆ default_button_delegate() [3/3]

template<button_type ButtonType, typename T >
v1::default_button_delegate< ButtonType, T >::default_button_delegate ( auto && value)
inlinenoexcept

Construct a delegate.

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

Field Documentation

◆ can_make_defaults

template<button_type ButtonType, typename T >
constexpr bool v1::default_button_delegate< ButtonType, 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: