#include // for max, min #include // for make_shared, shared_ptr, __shared_ptr_access #include // for move #include // for vector, __alloc_traits<>::value_type #include "ftxui/dom/elements.hpp" // for Element, unpack, focus, frame, select, xframe, yframe #include "ftxui/dom/node.hpp" // for Node #include "ftxui/dom/requirement.hpp" // for Requirement, Requirement::FOCUSED, Requirement::SELECTED #include "ftxui/screen/box.hpp" // for Box #include "ftxui/screen/screen.hpp" // for Screen, Screen::Cursor #include "ftxui/util/autoreset.hpp" // for AutoReset namespace ftxui { // ----------------------------------------------------------------------------- class Select : public Node { public: Select(Elements children) : Node(std::move(children)) {} void ComputeRequirement() override { Node::ComputeRequirement(); requirement_ = children_[0]->requirement(); auto& selected_box = requirement_.selected_box; selected_box.x_min = 0; selected_box.y_min = 0; selected_box.x_max = requirement_.min_x; selected_box.y_max = requirement_.min_y; requirement_.selection = Requirement::SELECTED; }; void SetBox(Box box) override { Node::SetBox(box); children_[0]->SetBox(box); } }; Element select(Element child) { return std::make_shared