Skip to content

ATextArea#

Multiline text input area.

Header:#include <AUI/View/ATextArea.h>
CMake:aui_link(my_target PUBLIC aui::views)

Detailed Description#

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:

AScrollArea::Builder().withContents(_new<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.

Examples#

examples/ui/contacts/src/view/ContactDetailsView.cpp

AUI Contacts - Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.

              Horizontal::Expanding {
                Vertical {
                  Label { "Note" } AUI_WITH_STYLE { FixedSize { 100_dp, {} }, Opacity { 0.5f }, ATextAlign::RIGHT },
                },
                _new<ATextArea>() && mContact->note,
              } AUI_WITH_STYLE {
                    MinSize { {}, 100_dp },
                  },
            } AUI_WITH_STYLE { MaxSize(EDITOR_CONTENT_MAX_WIDTH, {}), Padding(8_dp) },
          }),