19class CheckboxBase :
public ComponentBase,
public CheckboxOption {
21 explicit CheckboxBase(CheckboxOption
option)
38 bool OnEvent(Event
event)
override {
39 if (!CaptureMouse(
event)) {
43 if (
event.is_mouse()) {
44 return OnMouseEvent(
event);
57 bool OnMouseEvent(Event
event) {
58 hovered_ = box_.Contain(
event.mouse().x,
event.mouse().y);
60 if (!CaptureMouse(
event)) {
81 bool hovered_ =
false;
136 option.label = std::move(label);
An adapter. Own or reference a constant string. For convenience, this class convert multiple immutabl...
Element nothing(Element element)
A decoration doing absolutely nothing.
std::shared_ptr< Node > Element
std::shared_ptr< T > Make(Args &&... args)
std::shared_ptr< ComponentBase > Component
Element select(Element)
Set the child to be the one selected among its siblings.
Element focus(Element)
Set the child to be the one in focus globally.
Decorator reflect(Box &box)
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Component Checkbox(CheckboxOption options)
Draw checkable element.
Option for the Checkbox component.
static CheckboxOption Simple()
Option for standard Checkbox.
std::function< Element(const EntryState &)> transform
static const Event Return