NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
component/renderer.hpp
浏览该文件的文档.
1#ifndef NEFORCE_TUI_COMPONENT_RENDERER_HPP__
2#define NEFORCE_TUI_COMPONENT_RENDERER_HPP__
3
11
13NEFORCE_BEGIN_NAMESPACE__
14NEFORCE_BEGIN_TUI__
15NEFORCE_BEGIN_COMPONENTS__
16
21
26
34
42 function<element(bool focused)> render_fn);
43
50
58 function<bool(const key_event&)> on_event);
59
68unique_ptr<component_base> NEFORCE_API maybe(unique_ptr<component_base> child, const bool* show);
69 // Components
71 // TUI
73
74NEFORCE_END_COMPONENTS__
75NEFORCE_END_TUI__
76NEFORCE_END_NAMESPACE__
77#endif // NEFORCE_TUI_COMPONENT_RENDERER_HPP__
函数包装器主模板声明
独占智能指针
TUI组件基类
unique_ptr< component_base > catch_event(unique_ptr< component_base > child, function< bool(const key_event &)> on_event)
在事件传递到子组件前拦截处理
unique_ptr< component_base > renderer(unique_ptr< component_base > child, function< element()> render_fn)
使用渲染函数覆盖子组件的 render()
unique_ptr< component_base > maybe(unique_ptr< component_base > child, const bool *show)
条件渲染组件