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

Public Types

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

Public Member Functions

template<typename OptionList , typename Value , typename OffValue >
 default_selection_delegate (OptionList &&option_list, Value &&value, OffValue &&off_value) noexcept
 
template<typename OptionList , typename Value >
 default_selection_delegate (OptionList &&option_list, Value &&value) noexcept
 
callback_ptr_type subscribe (selection_widget &sender, callback_ptr_type const &callback_ptr) noexcept override
 Subscribe a callback for notifying the widget of a data change.
 
void unsubscribe (selection_widget &sender, callback_ptr_type const &callback_ptr) noexcept override
 Unsubscribe a callback.
 
void set_selected (selection_widget &sender, ssize_t index) noexcept override
 Called when an option is selected by the user.
 
std::pair< std::vector< label >, ssize_toptions_and_selected (selection_widget const &sender) const noexcept override
 Retrieve the label of an option.
 
- Public Member Functions inherited from tt::selection_delegate
virtual void init (selection_widget &sender) noexcept
 
virtual void deinit (selection_widget &sender) noexcept
 
template<typename Callback >
requires (std::is_invocable_v<Callback>)
callback_ptr_type subscribe (selection_widget &sender, Callback &&callback) noexcept
 Subscribe a callback for notifying the widget of a data change.
 

Data Fields

observable< std::vector< std::pair< value_type, label > > > options
 
observable< value_type > value
 
observable< value_type > off_value
 

Member Function Documentation

◆ options_and_selected()

template<typename T >
std::pair< std::vector< label >, ssize_t > tt::default_selection_delegate< T >::options_and_selected ( selection_widget const & sender) const
inlineoverridevirtualnoexcept

Retrieve the label of an option.

Reimplemented from tt::selection_delegate.

◆ set_selected()

template<typename T >
void tt::default_selection_delegate< T >::set_selected ( selection_widget & sender,
ssize_t index )
inlineoverridevirtualnoexcept

Called when an option is selected by the user.

Parameters
indexThe index of the option selected, -1 if no option is selected.

Reimplemented from tt::selection_delegate.

◆ subscribe()

template<typename T >
callback_ptr_type tt::default_selection_delegate< T >::subscribe ( selection_widget & sender,
callback_ptr_type const & callback )
inlineoverridevirtualnoexcept

Subscribe a callback for notifying the widget of a data change.

Reimplemented from tt::selection_delegate.

◆ unsubscribe()

template<typename T >
void tt::default_selection_delegate< T >::unsubscribe ( selection_widget & sender,
callback_ptr_type const & callback )
inlineoverridevirtualnoexcept

Unsubscribe a callback.

Reimplemented from tt::selection_delegate.


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