#include "ftxui/dom/elements.hpp" #include "ftxui/dom/node.hpp" #include "ftxui/util/autoreset.hpp" namespace ftxui { using namespace ftxui; // ----------------------------------------------------------------------------- class Select : public Node { public: Select(std::vector> 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 { box_ = box; children[0]->SetBox(box); } }; std::unique_ptr select(Element child) { return std::make_unique