FTXUI
0.8.1
C++ functional terminal UI.
|
Go to the documentation of this file. 1 #ifndef FTXUI_COMPONENT_BASE_HPP
2 #define FTXUI_COMPONENT_BASE_HPP
Component & ChildAt(size_t i)
Access the child at index i.
size_t ChildCount() const
Returns the number of children.
ComponentBase * Parent() const
Return the parent ComponentBase, or nul if any.
void Detach()
Detach this child from its parent.
std::shared_ptr< ComponentBase > Component
virtual Element Render()
Draw the component. Build a ftxui::Element to be drawn on the ftxi::Screen representing this ftxui::C...
void DetachAllChildren()
Remove all children.
virtual void SetActiveChild(ComponentBase *child)
Make the |child| to be the "active" one.
bool Focused() const
Returns if the elements if focused by the user. True when the ComponentBase is focused by the user....
CapturedMouse CaptureMouse(const Event &event)
Take the CapturedMouse if available. There is only one component of them. It represents a component t...
std::shared_ptr< Node > Element
std::vector< Component > Components
std::unique_ptr< CapturedMouseInterface > CapturedMouse
virtual Component ActiveChild()
Return the currently Active child.
void TakeFocus()
Configure all the ancestors to give focus to this component.
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
void Add(Component children)
Add a child. @param child The child to be attached.
bool Active() const
Returns if the element if the currently active child of its parent.
Represent an event. It can be key press event, a terminal resize, or more ...
virtual bool OnEvent(Event)
Called in response to an event.
virtual bool Focusable() const
Return true when the component contains focusable elements. The non focusable Components will be skip...