FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
MenuOption Struct Reference

Option for the Menu component. More...

#include <component_options.hpp>

+ Collaboration diagram for MenuOption:

Static Public Member Functions

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

Data Fields

ConstStringListRef entries
 
Ref< int > selected = 0
 
UnderlineOption underline
 
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
 
Ref< int > focused_entry = 0
 

Detailed Description

Option for the Menu component.

Examples
examples/component/maybe.cpp, examples/component/menu.cpp, and examples/component/menu2.cpp.

Definition at line 84 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.

Definition at line 75 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.

Definition at line 100 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.

Definition at line 110 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.

Definition at line 132 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.

Definition at line 155 of file component_options.cpp.

Field Documentation

◆ entries

Definition at line 92 of file component_options.hpp.

◆ selected

Ref<int> selected = 0

‍The list of entries.

Definition at line 93 of file component_options.hpp.

◆ underline

UnderlineOption underline

‍The index of the selected entry.

Definition at line 96 of file component_options.hpp.

◆ entries_option

MenuEntryOption entries_option

Definition at line 97 of file component_options.hpp.

◆ direction

Definition at line 98 of file component_options.hpp.

◆ elements_prefix

std::function<Element()> elements_prefix

Definition at line 99 of file component_options.hpp.

◆ elements_infix

std::function<Element()> elements_infix

Definition at line 100 of file component_options.hpp.

◆ elements_postfix

std::function<Element()> elements_postfix

Definition at line 101 of file component_options.hpp.

◆ on_change

std::function<void()> on_change

Definition at line 104 of file component_options.hpp.

◆ on_enter

std::function<void()> on_enter

‍Called when the selected entry changes.

Examples
examples/component/maybe.cpp, and examples/component/menu.cpp.

Definition at line 105 of file component_options.hpp.

◆ focused_entry

Ref<int> focused_entry = 0

‍Called when the user presses enter.

Definition at line 106 of file component_options.hpp.


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