FTXUI  5.0.0
C++ functional terminal UI.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InputOption Struct Reference

Option for the Input component. More...

Static Public Member Functions

static InputOption Default ()
 Create the default input style: More...
 
static InputOption Spacious ()
 A white on black style with high margins: More...
 

Data Fields

StringRef content = ""
 The content of the input. More...
 
StringRef placeholder = ""
 The content of the input when it's empty. More...
 
std::function< Element(InputState)> transform
 
Ref< bool > password = false
 Obscure the input content using '*'. More...
 
Ref< bool > multiline = true
 Whether the input can be multiline. More...
 
Ref< bool > insert = true
 Insert or overtype character mode. More...
 
std::function< void()> on_change = [] {}
 Called when the content changes. More...
 
std::function< void()> on_enter = [] {}
 Called when the user presses enter. More...
 
Ref< int > cursor_position = 0
 

Detailed Description

Option for the Input component.

Examples
examples/component/homescreen.cpp, examples/component/input.cpp, and examples/component/input_style.cpp.

Definition at line 162 of file component_options.hpp.

Member Function Documentation

◆ Default()

InputOption Default ( )
static

Create the default input style:

Standard options for the input component.

Definition at line 313 of file component_options.cpp.

◆ Spacious()

InputOption Spacious ( )
static

A white on black style with high margins:

Standard options for a more beautiful input component.

Definition at line 336 of file component_options.cpp.

Field Documentation

◆ content

StringRef content = ""

The content of the input.

Definition at line 171 of file component_options.hpp.

◆ placeholder

StringRef placeholder = ""

The content of the input when it's empty.

Definition at line 174 of file component_options.hpp.

◆ transform

std::function<Element(InputState)> transform
Examples
examples/component/input_style.cpp.

Definition at line 177 of file component_options.hpp.

◆ password

Ref<bool> password = false

Obscure the input content using '*'.

Examples
examples/component/input.cpp.

Definition at line 178 of file component_options.hpp.

◆ multiline

Ref<bool> multiline = true

Whether the input can be multiline.

Definition at line 179 of file component_options.hpp.

◆ insert

Ref<bool> insert = true

Insert or overtype character mode.

Definition at line 180 of file component_options.hpp.

◆ on_change

std::function<void()> on_change = [] {}

Called when the content changes.

Definition at line 183 of file component_options.hpp.

◆ on_enter

std::function<void()> on_enter = [] {}

Called when the user presses enter.

Definition at line 185 of file component_options.hpp.

◆ cursor_position

Ref<int> cursor_position = 0

Definition at line 188 of file component_options.hpp.


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