#pragma once #include // for Render #include #include #include #include #include #include #include #include #include #include "color.hpp" const int UI_PANEL_BORDER_PX=5; using ftxui::Renderer, ftxui::Component, ftxui::Element, ftxui::Screen; struct Panel { int x; int y; int width; int height; bool has_border = false; bool must_clear = true; bool grid = false; sf::Color default_bg = color::BLACK; sf::Color border_color = color::MID; int border_px = UI_PANEL_BORDER_PX; bool $dirty = true; Component $component; Screen $screen; std::wstring_convert> $converter; std::wstring $screenout; Panel(int width, int height, int x, int y, bool is_grid=false) : x(x), y(y), width(width), height(height), grid(is_grid), $screen(Screen(width, height)) { must_clear = !is_grid; }; void resize(int width, int height); void set_renderer(Component renderer); void add(Component child); void render(); const std::wstring &to_string(); const Screen &screen(); };