18 std::string title =
"(" + std::to_string(x) +
", " + std::to_string(y) +
")";
25 std::vector<Elements> rows;
26 for (
int i = 0; i < 15; i++) {
27 std::vector<Element> cols;
28 for (
int j = 0; j < 15; j++) {
41 auto slider_x =
Slider(
"x", &focus_x, 0.f, 1.f, 0.01f);
42 auto slider_y =
Slider(
"y", &focus_y, 0.f, 1.f, 0.01f);
50 auto title =
"focusPositionRelative(" +
51 std::to_string(focus_x) +
", " +
52 std::to_string(focus_y) +
")";
66 screen.Loop(renderer);
Element make_box(int x, int y)
static ScreenInteractive Fullscreen()
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Decorator bgcolor(Color)
Decorate using a background color.
Decorator focusPositionRelative(float x, float y)
Used inside a frame, this force the view to be scrolled toward a a given position....
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
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 vbox(Elements)
A container displaying elements vertically one by one.
static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value)
Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
The FTXUI ftxui:: namespace.
std::shared_ptr< Node > Element
Component Slider(SliderOption< T > options)
A slider in any direction.
Element gridbox(std::vector< Elements > lines)
A container displaying a grid of elements.