mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-18 17:18:08 +08:00
Feature: Dropdown options with callback
This commit is contained in:
@@ -74,7 +74,7 @@ Component Radiobox(ConstStringListRef entries,
|
||||
int* selected_,
|
||||
RadioboxOption options = {});
|
||||
|
||||
Component Dropdown(ConstStringListRef entries, int* selected);
|
||||
Component Dropdown(ConstStringListRef entries, int* selected, DropdownOption options = {});
|
||||
Component Toggle(ConstStringListRef entries, int* selected);
|
||||
|
||||
// General slider constructor:
|
||||
|
@@ -148,6 +148,17 @@ struct CheckboxOption {
|
||||
std::function<void()> on_change = [] {};
|
||||
};
|
||||
|
||||
/// @brief Option for the Dropdown component.
|
||||
/// @ingroup component
|
||||
struct DropdownOption {
|
||||
|
||||
bool border = true;
|
||||
|
||||
// Observer:
|
||||
/// Called when the user change the state.
|
||||
std::function<void()> on_change = [] {};
|
||||
};
|
||||
|
||||
/// @brief Used to define style for the Input component.
|
||||
struct InputState {
|
||||
Element element;
|
||||
|
Reference in New Issue
Block a user