ftxui::Selection
cpp
#include <ftxui/dom/selection.hpp>Represent a selection in the terminal.
Summary
| Symbol | Description |
|---|---|
Selection | Create an empty selection. |
GetBox | Get the box of the selection. |
SaturateHorizontal | Saturate the selection to be inside the box. This is called by hbox to propagate the selection to its children. |
SaturateVertical | Saturate the selection to be inside the box. This is called by vbox to propagate the selection to its children. |
IsEmpty | |
AddPart | |
GetParts |
Public Member Functions
Selection
cpp
Selection();Create an empty selection.
Selection
cpp
Selection(int start_x, int start_y, int end_x, int end_y);Create a selection.
Parameters:
start_x: The x coordinate of the start of the selection.start_y: The y coordinate of the start of the selection.end_x: The x coordinate of the end of the selection.end_y: The y coordinate of the end of the selection.
GetBox
Get the box of the selection.
Returns: The box of the selection.
SaturateHorizontal
cpp
Selection SaturateHorizontal(Box box);Saturate the selection to be inside the box. This is called by hbox to propagate the selection to its children.
Parameters:
box: The box to saturate the selection in.
Returns: The saturated selection.
SaturateVertical
cpp
Selection SaturateVertical(Box box);Saturate the selection to be inside the box. This is called by vbox to propagate the selection to its children.
Parameters:
box: The box to saturate the selection in.
Returns: The saturated selection.
IsEmpty
cpp
bool IsEmpty() const;AddPart
cpp
void AddPart(const std::string & part, int y, int left, int right);GetParts
cpp
std::string GetParts();