HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions
hi::v1::selection_delegate Class Reference

#include <hikogui/widgets/selection_delegate.hpp>

Inheritance diagram for hi::v1::selection_delegate:
hi::v1::default_selection_delegate< T >

Public Types

using notifier_type = notifier<>
 
using callback_token = notifier_type::callback_token
 
using callback_proto = notifier_type::callback_proto
 

Public Member Functions

virtual void init (widget &sender) noexcept
 
virtual void deinit (widget &sender) noexcept
 
virtual void set_selected (widget &sender, ssize_t index) noexcept
 Called when an option is selected by the user.
 
virtual std::pair< std::vector< label >, ssize_toptions_and_selected (widget const &sender) const noexcept
 Retrieve the label of an option.
 
callback_token subscribe (forward_of< callback_proto > auto &&callback, callback_flags flags=callback_flags::synchronous) noexcept
 Subscribe a callback for notifying the widget of a data change.
 

Detailed Description

A delegate that controls the state of a selection_widget.

Member Function Documentation

◆ options_and_selected()

virtual std::pair< std::vector< label >, ssize_t > hi::v1::selection_delegate::options_and_selected ( widget const & sender) const
inlinevirtualnoexcept

Retrieve the label of an option.

Parameters
senderThe widget that called this function.

Reimplemented in hi::v1::default_selection_delegate< T >.

◆ set_selected()

virtual void hi::v1::selection_delegate::set_selected ( widget & sender,
ssize_t index )
inlinevirtualnoexcept

Called when an option is selected by the user.

Parameters
senderThe widget that called this function.
indexThe index of the option selected, -1 if no option is selected.

◆ subscribe()

callback_token hi::v1::selection_delegate::subscribe ( forward_of< callback_proto > auto && callback,
callback_flags flags = callback_flags::synchronous )
inlinenoexcept

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


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