NexusForce
1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
menu.hpp
浏览该文件的文档.
1
#ifndef NEFORCE_TUI_COMPONENT_MENU_HPP__
2
#define NEFORCE_TUI_COMPONENT_MENU_HPP__
3
10
11
#include "
NeForce/tui/component/component.hpp
"
12
#include "
NeForce/tui/dom/ref.hpp
"
13
NEFORCE_BEGIN_NAMESPACE__
14
NEFORCE_BEGIN_TUI__
15
NEFORCE_BEGIN_COMPONENTS__
16
21
26
30
struct
menu_option
{
31
vector<string>
entries
;
32
int
*
selected
=
nullptr
;
33
bool
horizontal
=
false
;
34
function
<void()>
on_change
;
35
function
<void()>
on_enter
;
36
style
normal_style
;
37
style
focused_style
;
38
};
39
45
unique_ptr<component_base>
NEFORCE_API
menu
(
menu_option
option);
46
// Components
48
// TUI
50
51
NEFORCE_END_COMPONENTS__
52
NEFORCE_END_TUI__
53
NEFORCE_END_NAMESPACE__
54
#endif
// NEFORCE_TUI_COMPONENT_MENU_HPP__
neforce::function
函数包装器主模板声明
定义
functional/function.hpp:30
neforce::unique_ptr
独占智能指针
定义
unique_ptr.hpp:206
neforce::vector
动态大小数组容器
定义
vector.hpp:167
component.hpp
TUI组件基类
neforce::tui::components::menu
unique_ptr< component_base > menu(menu_option option)
创建菜单组件
ref.hpp
状态绑定适配器
neforce::tui::components::menu_option
菜单选项配置
定义
menu.hpp:30
neforce::tui::components::menu_option::focused_style
style focused_style
已选中条目的样式
定义
menu.hpp:37
neforce::tui::components::menu_option::normal_style
style normal_style
未选中条目的样式
定义
menu.hpp:36
neforce::tui::components::menu_option::on_change
function< void()> on_change
选择变更回调
定义
menu.hpp:34
neforce::tui::components::menu_option::entries
vector< string > entries
菜单条目文本列表
定义
menu.hpp:31
neforce::tui::components::menu_option::selected
int * selected
选中索引
定义
menu.hpp:32
neforce::tui::components::menu_option::on_enter
function< void()> on_enter
回车确认回调
定义
menu.hpp:35
neforce::tui::components::menu_option::horizontal
bool horizontal
是否水平排列
定义
menu.hpp:33
neforce::tui::style
样式
定义
style.hpp:25
include
NeForce
tui
component
menu.hpp
制作者
1.16.0