11 class Impl :
public ComponentBase {
13 bool checked[3] = {
false,
false,
false};
18 Add(Container::Vertical({
22 Slider(
"Slider", &slider, 0.f, 100.f),
30 int window_1_left = 20;
31 int window_1_top = 10;
32 int window_1_width = 40;
33 int window_1_height = 20;
37 .title =
"First window",
38 .left = &window_1_left,
40 .width = &window_1_width,
41 .height = &window_1_height,
62 auto window_5 =
Window({});
64 auto window_container = Container::Stacked({
73 return text(
"window_1: " +
74 std::to_string(window_1_width) +
"x" +
75 std::to_string(window_1_height) +
" + " +
76 std::to_string(window_1_left) +
"," +
77 std::to_string(window_1_top));
80 auto layout = Container::Vertical({
85 auto screen = App::Fullscreen();
Component DummyWindowContent()
Component Renderer(Component child, std::function< Element()>)
回傳一個新的 Component,類似 |child|,但使用 |render| 作為 Component::Render() 事件。
Component Checkbox(ConstStringRef label, bool *checked, CheckboxOption options=CheckboxOption::Simple())
繪製可勾選的元素。
Component Window(WindowOptions option)
一個可拖曳/可調整大小的視窗。要使用多個視窗,它們必須透過 Container::Stacked({...}) 元件堆疊。
Element text(std::string_view text)
顯示一段 UTF8 編碼的 Unicode 文字。
std::shared_ptr< T > Make(Args &&... args)
Component Slider(SliderOption< T > options)
任意方向的滑桿。
std::shared_ptr< ComponentBase > Component