AUI Framework
develop
Cross-platform base for C++ UI apps
|
Multiline text input area. More...
#include <AUI/View/ATextArea.h>
Public Types | |
using | Iterator = Entries::iterator |
Public Member Functions | |
ATextArea (const AString &text) | |
bool | capturesFocus () override |
AString | toString () const override |
const AString & | getText () const override |
unsigned int | cursorIndexByPos (glm::ivec2 pos) override |
glm::ivec2 | getPosByIndex (size_t index) override |
void | setText (const AString &t) override |
void | render (ARenderContext context) override |
void | onCharEntered (char16_t c) override |
glm::ivec2 | getCursorPosition () override |
void | setSize (glm::ivec2 size) override |
bool | isPasswordField () const noexcept override |
ATextInputType | textInputType () const noexcept override |
Public Member Functions inherited from AAbstractTypeable | |
void | clear () |
void | setMaxTextLength (size_t newTextLength) |
void | trimText () |
void | setCopyable (bool isCopyable) |
void | setTextInputActionIcon (ATextInputActionIcon textInputActionIcon) noexcept |
ATextInputActionIcon | textInputActionIcon () const noexcept |
void | copyToClipboard () const |
Performs copy operation (CTRL+C) to system clipboard. | |
void | cutToClipboard () |
Performs cut operation (CTRL+X) to system clipboard. | |
void | pasteFromClipboard () |
Performs paste operation (CTRL+V) from system clipboard. | |
void | paste (AString content) |
Performs paste operation (CTRL+V). | |
void | moveCursorLeft () |
Performs move left operation (like AInput::LEFT) | |
void | moveCursorRight () |
Performs move right operation (like AInput::RIGHT) | |
virtual void | emitTextChanged (const AString &text)=0 |
virtual void | emitTextChanging (const AString &text)=0 |
virtual void | emitActionButtonPressed ()=0 |
Public Member Functions inherited from ACursorSelectable | |
AString | selectedText () const |
Selection | selection () const |
bool | hasSelection () const |
void | selectAll () |
Select whole text in the text field. | |
void | clearSelection () |
Remove selection from the text field. | |
void | setSelection (int cursorIndex) |
void | setSelection (Selection selection) |
Protected Member Functions | |
void | typeableErase (size_t begin, size_t end) override |
bool | typeableInsert (size_t at, const AString &toInsert) override |
bool | typeableInsert (size_t at, char16_t toInsert) override |
size_t | typeableFind (char16_t c, size_t startPos) override |
size_t | typeableReverseFind (char16_t c, size_t startPos) override |
size_t | length () const override |
void | fillStringCanvas (const _< IRenderer::IMultiStringCanvas > &canvas) override |
Protected Member Functions inherited from AAbstractTypeable | |
bool | isCursorBlinkVisible () const |
void | updateCursorBlinking () |
virtual void | updateSelectionOnTextSet (const AString &t) |
void | enterChar (char16_t c) |
AString | getDisplayText () override |
AMenuModel | composeContextMenuImpl () |
void | handleKey (AInput::Key key) |
Protected Member Functions inherited from ACursorSelectable | |
virtual bool | isLButtonPressed ()=0 |
virtual void | cursorSelectableRedraw ()=0 |
virtual void | onSelectionChanged ()=0 |
void | handleMouseDoubleClicked (const APointerPressedEvent &event) |
void | handleMousePressed (const APointerPressedEvent &event) |
void | handleMouseReleased (const APointerReleasedEvent &event) |
void | handleMouseMove (const glm::ivec2 &pos) |
template<aui::invocable Callback> | |
void | drawSelectionBeforeAndAfter (IRenderer &render, std::span< ARect< int > > rects, Callback &&drawText) |
Additional Inherited Members | |
Static Public Member Functions inherited from IStringable | |
template<typename T> | |
static AString | toString (const T *t) |
template<typename T> | |
static AString | toString (const _< T > &t) |
Signals and public fields inherited from AAbstractTypeable | |
emits< AString > | textChanged |
The user changed text and focused another view or AAbstractTextField::updateText is called. | |
emits< AString > | textChanging |
When the user changed one or more symbols. | |
emits< Selection > | selectionChanged |
Selection is changed due to user's action or code operation. | |
emits | actionButtonPressed |
When action button of touchscreen keyboard or AInput::RETURN is pressed. | |
Protected Attributes inherited from AAbstractTypeable | |
size_t | mMaxTextLength = 0x200 |
bool | mIsMultiline = false |
Protected Attributes inherited from ACursorSelectable | |
unsigned | mCursorIndex = 0 |
AOptional< unsigned > | mCursorSelection |
Multiline text input area.
Word breaking text area.
In contrast to ATextField, ATextArea is not scrollable. It is often preferable to use a dedicated scroll area to make the entire application pages scrollable with other content rather than using nested scrolls just for text area.
If you want to make AScrollArea scrollable, it can be placed inside a AScrollArea:
This is why it does not offer default styling - you would probably want to style AScrollArea as if it were text input.
ATextArea offers integrations and optimizations for AScrollArea specifically.
|
overridevirtual |
Implements ACursorSelectable.
|
overridevirtual |
Returns position relative to top left corner of the view. That is, if implementation supports scrolling (i.e., ATextField) the returned position does not include overflowed contents.
Implements ACursorSelectable.
|
overridevirtual |
Implements ACursorSelectable.
|
overridevirtual |
Implements ACursorSelectable.
|
overridevirtualnoexcept |
Implements AAbstractTypeable.
|
overrideprotectedvirtual |
Implements ACursorSelectable.
|
overridevirtual |
Reimplemented from AAbstractTypeable.
|
overridevirtualnoexcept |
|
overridevirtual |
Implements IStringable.
|
overrideprotectedvirtual |
Implements AAbstractTypeable.
|
overrideprotectedvirtual |
Implements AAbstractTypeable.
|
overrideprotectedvirtual |
Inserts string.
typeableInsert
have not been called. Implements AAbstractTypeable.
|
overrideprotectedvirtual |
Inserts string.
typeableInsert
have not been called. Implements AAbstractTypeable.
|
overrideprotectedvirtual |
Implements AAbstractTypeable.