#include <string>
int main() {
int value = 0;
auto action = [&] { value++; };
auto action_renderer =
auto buttons =
action_renderer,
Button(
"Ascii 1", action, ButtonOption::Ascii()),
Button(
"Ascii 2", action, ButtonOption::Ascii()),
Button(
"Ascii 3", action, ButtonOption::Ascii()),
}),
Button(
"Simple 1", action, ButtonOption::Simple()),
Button(
"Simple 2", action, ButtonOption::Simple()),
Button(
"Simple 3", action, ButtonOption::Simple()),
}),
Button(
"Animated 1", action, ButtonOption::Animated()),
Button(
"Animated 2", action, ButtonOption::Animated()),
Button(
"Animated 3", action, ButtonOption::Animated()),
}),
ButtonOption::Animated(Color::Red)),
ButtonOption::Animated(Color::Green)),
ButtonOption::Animated(Color::Blue)),
}),
}),
}) |
auto screen = ScreenInteractive::FitComponent();
screen.Loop(buttons);
return 0;
}
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
std::string to_string(const std::wstring &s)
Convert a UTF8 std::string into a std::wstring.
Element text(std::wstring text)
Display a piece of unicode text.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element border(Element)
Draw a border around the element.