Skip to content
You are viewing documentation for v6.1.0. Switch to latest (main).

ftxui::Selection ​

cpp
#include <ftxui/dom/selection.hpp>

Represent a selection in the terminal.

Summary ​

SymbolDescription
SelectionCreate an empty selection.
GetBoxGet the box of the selection.
SaturateHorizontalSaturate the selection to be inside the box. This is called by hbox to propagate the selection to its children.
SaturateVerticalSaturate 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 ​

cpp
const Box & GetBox() const;

Get the box of the selection.

Returns: 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.

Parameters:

  • box: The box to saturate the selection in.

Returns: The saturated selection.

SaturateVertical ​

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();