#include <functional>
#include <string>
#include <utility>
int main() {
style_3.transform = [](InputState state) {
if (state.is_placeholder) {
}
if (state.focused) {
} else if (state.hovered) {
} else {
}
return state.element;
};
style_4.transform = [](InputState state) {
std::move(state.element),
});
if (state.is_placeholder) {
}
if (state.focused) {
} else {
}
if (state.hovered) {
}
};
auto generateUiFromStyle = [&](InputOption style) {
auto first_name = new std::string();
auto middle_name = new std::string();
auto last_name = new std::string();
Input(first_name,
"first name", style),
Input(middle_name,
"middle name", style),
Input(last_name,
"last name", style),
}) |
};
generateUiFromStyle(style_1),
generateUiFromStyle(style_2),
generateUiFromStyle(style_3),
generateUiFromStyle(style_4),
});
screen.Loop(ui);
}
static ScreenInteractive TerminalOutput()
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...
Decorator bgcolor(Color)
Decorate using a background color.
Element borderDouble(Element)
Draw a double border around the element.
Element separatorEmpty()
Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
Element borderRounded(Element)
Draw a rounded border around the element.
Element hbox(Elements)
A container displaying elements horizontally one by one.
Element center(Element)
Center an element horizontally and vertically.
Element text(std::wstring text)
Display a piece of unicode text.
Component Input(InputOption options={})
An input box for editing text.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element dim(Element)
Use a light font, for elements with less emphasis.
Element border(Element)
Draw a border around the element.
Element borderEmpty(Element)
Draw an empty border around the element.
Decorator color(Color)
Decorate using a foreground color.
Element vbox(Elements)
A container displaying elements vertically one by one.