FTXUI
5.0.0
C++ functional terminal UI.
|
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event. More...
Inherited by CatchEventBase, ContainerBase, and MenuBase.
Public Member Functions | |
ComponentBase (Components children) | |
virtual | ~ComponentBase () |
ComponentBase ()=default | |
ComponentBase (const ComponentBase &)=delete | |
ComponentBase (ComponentBase &&)=delete | |
ComponentBase & | operator= (const ComponentBase &)=delete |
ComponentBase & | operator= (ComponentBase &&)=delete |
ComponentBase * | Parent () const |
Return the parent ComponentBase, or nul if any. More... | |
Component & | ChildAt (size_t i) |
Access the child at index i . More... | |
size_t | ChildCount () const |
Returns the number of children. More... | |
int | Index () const |
Return index of the component in its parent. -1 if no parent. More... | |
void | Add (Component children) |
Add a child. @param child The child to be attached. More... | |
void | Detach () |
Detach this child from its parent. More... | |
void | DetachAllChildren () |
Remove all children. More... | |
virtual Element | Render () |
Draw the component. Build a ftxui::Element to be drawn on the ftxi::Screen representing this ftxui::ComponentBase. More... | |
virtual bool | OnEvent (Event) |
Called in response to an event. More... | |
virtual void | OnAnimation (animation::Params ¶ms) |
Called in response to an animation event. More... | |
virtual Component | ActiveChild () |
Return the currently Active child. More... | |
virtual bool | Focusable () const |
Return true when the component contains focusable elements. The non focusable Components will be skipped when navigating using the keyboard. More... | |
bool | Active () const |
Returns if the element if the currently active child of its parent. More... | |
bool | Focused () const |
Returns if the elements if focused by the user. True when the ComponentBase is focused by the user. An element is Focused when it is with all its ancestors the ActiveChild() of their parents, and it Focusable(). More... | |
virtual void | SetActiveChild (ComponentBase *child) |
void | SetActiveChild (Component child) |
Make the |child| to be the "active" one. More... | |
void | TakeFocus () |
Configure all the ancestors to give focus to this component. More... | |
Protected Member Functions | |
CapturedMouse | CaptureMouse (const Event &event) |
Take the CapturedMouse if available. There is only one component of them. It represents a component taking priority over others. More... | |
Protected Attributes | |
Components | children_ |
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event.
Definition at line 30 of file component_base.hpp.
|
inlineexplicit |
Definition at line 32 of file component_base.hpp.
|
virtual |
Definition at line 29 of file component.cpp.
|
default |
|
delete |
|
delete |
|
delete |
|
delete |
ComponentBase * Parent | ( | ) | const |
Return the parent ComponentBase, or nul if any.
Definition at line 37 of file component.cpp.
Component & ChildAt | ( | size_t | i | ) |
Access the child at index i
.
Definition at line 43 of file component.cpp.
size_t ChildCount | ( | ) | const |
Returns the number of children.
Definition at line 50 of file component.cpp.
int Index | ( | ) | const |
Return index of the component in its parent. -1 if no parent.
Definition at line 56 of file component.cpp.
void Add | ( | Component | children | ) |
Add a child. @param child The child to be attached.
Definition at line 73 of file component.cpp.
void Detach | ( | ) |
Detach this child from its parent.
Definition at line 83 of file component.cpp.
void DetachAllChildren | ( | ) |
Remove all children.
Definition at line 99 of file component.cpp.
|
virtual |
Draw the component. Build a ftxui::Element to be drawn on the ftxi::Screen representing this ftxui::ComponentBase.
Definition at line 109 of file component.cpp.
|
virtual |
Called in response to an event.
event | The event. |
Definition at line 123 of file component.cpp.
|
virtual |
Called in response to an animation event.
params | the parameters of the animation The default implementation dispatch the event to every child. |
Definition at line 136 of file component.cpp.
|
virtual |
Return the currently Active child.
Definition at line 145 of file component.cpp.
|
virtual |
Return true when the component contains focusable elements. The non focusable Components will be skipped when navigating using the keyboard.
Definition at line 158 of file component.cpp.
bool Active | ( | ) | const |
Returns if the element if the currently active child of its parent.
Definition at line 169 of file component.cpp.
bool Focused | ( | ) | const |
Returns if the elements if focused by the user. True when the ComponentBase is focused by the user. An element is Focused when it is with all its ancestors the ActiveChild() of their parents, and it Focusable().
Definition at line 178 of file component.cpp.
|
virtual |
void SetActiveChild | ( | Component | child | ) |
Make the |child| to be the "active" one.
child | the child to become active. |
Definition at line 194 of file component.cpp.
void TakeFocus | ( | ) |
Configure all the ancestors to give focus to this component.
Definition at line 200 of file component.cpp.
|
protected |
Take the CapturedMouse if available. There is only one component of them. It represents a component taking priority over others.
event | The event |
Definition at line 212 of file component.cpp.
|
protected |
Definition at line 93 of file component_base.hpp.