FTXUI  5.0.0
C++ functional terminal UI.
MenuOption Struct Reference

Option for the Menu component. More...

Inherited by MenuBase.

Static Public Member Functions

static MenuOption Horizontal ()
 Standard options for an horizontal menu. This can be useful to implement a tab bar. More...
 
static MenuOption HorizontalAnimated ()
 Standard options for an animated horizontal menu. This can be useful to implement a tab bar. More...
 
static MenuOption Vertical ()
 Standard options for a vertical menu. This can be useful to implement a list of selectable items. More...
 
static MenuOption VerticalAnimated ()
 Standard options for an animated vertical menu. This can be useful to implement a list of selectable items. More...
 
static MenuOption Toggle ()
 Standard options for a horitontal menu with some separator. This can be useful to implement a tab bar. More...
 

Data Fields

ConstStringListRef entries
 
Ref< int > selected = 0
 

The list of entries.

More...
 
UnderlineOption underline
 

The index of the selected entry.

More...
 
MenuEntryOption entries_option
 
Direction direction = Direction::Down
 
std::function< Element()> elements_prefix
 
std::function< Element()> elements_infix
 
std::function< Element()> elements_postfix
 
std::function< void()> on_change
 
std::function< void()> on_enter
 

Called when the selected entry changes.

More...
 
Ref< int > focused_entry = 0
 

Called when the user presses enter.

More...
 

Detailed Description

Option for the Menu component.

Definition at line 85 of file component_options.hpp.

Member Function Documentation

◆ Horizontal()

MenuOption Horizontal ( )
static

Standard options for an horizontal menu. This can be useful to implement a tab bar.

Examples
examples/component/menu_in_frame_horizontal.cpp, and examples/component/menu_style.cpp.

Definition at line 76 of file component_options.cpp.

◆ HorizontalAnimated()

MenuOption HorizontalAnimated ( )
static

Standard options for an animated horizontal menu. This can be useful to implement a tab bar.

Examples
examples/component/homescreen.cpp, examples/component/menu_style.cpp, and examples/component/menu_underline_animated_gallery.cpp.

Definition at line 101 of file component_options.cpp.

◆ Vertical()

MenuOption Vertical ( )
static

Standard options for a vertical menu. This can be useful to implement a list of selectable items.

Examples
examples/component/menu_style.cpp.

Definition at line 111 of file component_options.cpp.

◆ VerticalAnimated()

MenuOption VerticalAnimated ( )
static

Standard options for an animated vertical menu. This can be useful to implement a list of selectable items.

Examples
examples/component/menu_style.cpp.

Definition at line 133 of file component_options.cpp.

◆ Toggle()

MenuOption Toggle ( )
static

Standard options for a horitontal menu with some separator. This can be useful to implement a tab bar.

Examples
examples/component/menu_style.cpp.

Definition at line 156 of file component_options.cpp.

Field Documentation

◆ entries

Definition at line 93 of file component_options.hpp.

◆ selected

Ref<int> selected = 0

The list of entries.

Definition at line 94 of file component_options.hpp.

◆ underline

UnderlineOption underline

The index of the selected entry.

Definition at line 97 of file component_options.hpp.

◆ entries_option

MenuEntryOption entries_option

Definition at line 98 of file component_options.hpp.

◆ direction

Definition at line 99 of file component_options.hpp.

◆ elements_prefix

std::function<Element()> elements_prefix

Definition at line 100 of file component_options.hpp.

◆ elements_infix

std::function<Element()> elements_infix

Definition at line 101 of file component_options.hpp.

◆ elements_postfix

std::function<Element()> elements_postfix

Definition at line 102 of file component_options.hpp.

◆ on_change

std::function<void()> on_change

Definition at line 105 of file component_options.hpp.

◆ on_enter

std::function<void()> on_enter

Called when the selected entry changes.

Definition at line 106 of file component_options.hpp.

◆ focused_entry

Ref<int> focused_entry = 0

Called when the user presses enter.

Definition at line 107 of file component_options.hpp.


The documentation for this struct was generated from the following files: