FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
Selection Class Reference

Represent a selection in the terminal. More...

#include <selection.hpp>

Public Member Functions

 Selection ()
 Create an empty selection.
 
 Selection (int start_x, int start_y, int end_x, int end_y)
 Create a selection.
 
const BoxGetBox () const
 Get the box of the selection.
 
Selection SaturateHorizontal (Box box)
 Saturate the selection to be inside the box. This is called by hbox to propagate the selection to its children.
 
Selection SaturateVertical (Box box)
 Saturate the selection to be inside the box. This is called by vbox to propagate the selection to its children.
 
bool IsEmpty () const
 
void AddPart (const std::string &part, int y, int left, int right)
 
std::string GetParts ()
 

Detailed Description

Represent a selection in the terminal.

Definition at line 17 of file selection.hpp.

Constructor & Destructor Documentation

◆ Selection() [1/2]

Selection ( )
default

Create an empty selection.

◆ Selection() [2/2]

Selection ( int start_x,
int start_y,
int end_x,
int end_y )

Create a selection.

Parameters
start_xThe x coordinate of the start of the selection.
start_yThe y coordinate of the start of the selection.
end_xThe x coordinate of the end of the selection.
end_yThe y coordinate of the end of the selection.

Definition at line 34 of file src/ftxui/dom/selection.cpp.

Member Function Documentation

◆ GetBox()

const Box & GetBox ( ) const

Get the box of the selection.

Returns
The box of the selection.

Definition at line 67 of file src/ftxui/dom/selection.cpp.

◆ SaturateHorizontal()

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
boxThe box to saturate the selection in.
Returns
The saturated selection.

Definition at line 75 of file src/ftxui/dom/selection.cpp.

◆ SaturateVertical()

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
boxThe box to saturate the selection in.
Returns
The saturated selection.

Definition at line 113 of file src/ftxui/dom/selection.cpp.

◆ IsEmpty()

bool IsEmpty ( ) const
inline

Definition at line 26 of file selection.hpp.

◆ AddPart()

void AddPart ( const std::string & part,
int y,
int left,
int right )

Definition at line 146 of file src/ftxui/dom/selection.cpp.

◆ GetParts()

std::string GetParts ( )
inline

Definition at line 29 of file selection.hpp.


The documentation for this class was generated from the following files: