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

#include <ttauri/widgets/default_button_delegate.hpp>

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

Public Types

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

Public Member Functions

template<typename Value , typename OnValue , typename OffValue >
 default_button_delegate (Value &&value, OnValue &&on_value, OffValue &&off_value) noexcept
 Construct a delegate.
 
template<typename Value , typename OnValue >
requires (can_make_defaults or button_type == button_type::radio)
 default_button_delegate (Value &&value, OnValue &&on_value) noexcept
 Construct a delegate.
 
template<typename Value >
requires (can_make_defaults)
 default_button_delegate (Value &&value) noexcept
 Construct a delegate.
 
- Public Member Functions inherited from tt::button_delegate
virtual void init (abstract_button_widget &sender) noexcept
 
virtual void deinit (abstract_button_widget &sender) noexcept
 
template<typename Callback >
requires (std::is_invocable_v<Callback>)
callback_ptr_type subscribe (abstract_button_widget &sender, Callback &&callback) noexcept
 Subscribe a callback for notifying the widget of a data change.
 

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 tt::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 >
template<typename Value , typename OnValue , typename OffValue >
tt::default_button_delegate< ButtonType, T >::default_button_delegate ( Value && value,
OnValue && on_value,
OffValue && 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 >
template<typename Value , typename OnValue >
requires (can_make_defaults or button_type == button_type::radio)
tt::default_button_delegate< ButtonType, T >::default_button_delegate ( Value && value,
OnValue && 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 >
template<typename Value >
requires (can_make_defaults)
tt::default_button_delegate< ButtonType, T >::default_button_delegate ( Value && 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 tt::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: