ftxui::MenuOption
#include <ftxui/component/component_options.hpp>Option for the Menu component.
Examples: component/homescreen, component/menu, component/menu2, component/menu_in_frame_horizontal, component/menu_style, component/menu_underline_animated_gallery
Summary
| Symbol | Description |
|---|---|
entries | |
selected | The list of entries. |
underline | The index of the selected entry. |
entries_option | |
direction | |
elements_prefix | |
elements_infix | |
elements_postfix | |
on_change | |
on_enter | Called when the selected entry changes. |
focused_entry | Called when the user presses enter. |
Horizontal | Standard options for a horizontal menu. This can be useful to implement a tab bar. |
HorizontalAnimated | Standard options for an animated horizontal menu. This can be useful to implement a tab bar. |
Vertical | Standard options for a vertical menu. This can be useful to implement a list of selectable items. |
VerticalAnimated | Standard options for an animated vertical menu. This can be useful to implement a list of selectable items. |
Toggle | Standard options for a horizontal menu with some separator. This can be useful to implement a tab bar. |
Public Attributes
entries
ConstStringListRef entries;selected
Ref< int > selected = 0;The list of entries.
underline
UnderlineOption underline;The index of the selected entry.
entries_option
MenuEntryOption entries_option;direction
elements_prefix
std::function< Element()> elements_prefix;elements_infix
std::function< Element()> elements_infix;elements_postfix
std::function< Element()> elements_postfix;on_change
std::function< void()> on_change;on_enter
std::function< void()> on_enter;Called when the selected entry changes.
Examples: component/menu
focused_entry
Ref< int > focused_entry = 0;Called when the user presses enter.
Static Functions
Horizontal
static MenuOption Horizontal();Standard options for a horizontal menu. This can be useful to implement a tab bar.
Examples: component/button, component/button_animated, component/button_style, component/canvas_animated, component/composition, component/dropdown, component/dropdown_custom, component/flexbox_gallery, component/homescreen, component/input_style, component/menu2, component/menu_in_frame_horizontal (+7 more)
HorizontalAnimated
static MenuOption HorizontalAnimated();Standard options for an animated horizontal menu. This can be useful to implement a tab bar.
Vertical
static MenuOption Vertical();Standard options for a vertical menu. This can be useful to implement a list of selectable items.
Examples: component/button, component/button_in_frame, component/button_style, component/checkbox, component/checkbox_in_frame, component/collapsible, component/dropdown, component/flexbox_gallery, component/focus, component/focus_cursor, component/gallery, component/homescreen (+19 more)
VerticalAnimated
static MenuOption VerticalAnimated();Standard options for an animated vertical menu. This can be useful to implement a list of selectable items.
Toggle
static MenuOption Toggle();Standard options for a horizontal menu with some separator. This can be useful to implement a tab bar.
Examples: component/gallery, component/menu_style, component/tab_horizontal, component/toggle