TouchGFX + 0/4 examples
CodeScope will show references to touchgfx::TextArea from the following samples and libraries:
Examples
STM32469I-Discovery
Demonstrations
STM32469I_EVAL
Demonstrations
STM324x9I_EVAL
Demonstrations
STM32F429I-Discovery
Demonstrations
 
Symbols
loading...
Files
loading...

touchgfx::TextArea class

@class TextArea TextArea.hpp touchgfx/widgets/TextArea.hpp This widget is capable of showing a text area on the screen. This widget is capable of showing a text area on the screen. A TextArea can display a TypedText. Optional configuration include text color. Example text_example shows how to use a TextArea. @see TypedText for information about text @see TextAreaWithOneWildcard, @see TextAreaWithTwoWildcards for displaying texts containing wildcards.

Syntax

class TextArea : public Widget { public:     TextArea() : Widget(), typedText(TYPED_TEXT_INVALID), color(0), linespace(0), alpha(255), indentation(0), rotation(TEXT_ROTATE_0), wideTextAction(WIDE_TEXT_NONE)     { }     virtual Rect getSolidRect() const     {         return Rect(0, 0, 0, 0);     }     inline void setColor(colortype color)     {         this->color = color;     }     inline colortype getColor() const     {         return color;     }     void setAlpha(uint8_t alpha)     {         this->alpha = alpha;     }     uint8_t getAlpha() const     {         return alpha;     }     virtual void setBaselineY(int16_t baselineY)     {         setY(baselineY - getTypedText().getFont()->getFontHeight());     }     virtual void setXBaselineY(int16_t x, int16_t baselineY)     {         setX(x);         setBaselineY(baselineY);     }     inline void setLinespacing(uint16_t space)     {         linespace = space;     }     inline uint16_t getLinespacing() const     {         return linespace;     }     inline void setIndentation(uint8_t indent)     {         indentation = indent;     }     inline uint8_t getIndentation()     {         return indentation;     }     virtual int16_t getTextHeight();     virtual uint16_t getTextWidth() const;     virtual void draw(const Rect& area) const;     void setTypedText(TypedText t);     TypedText getTypedText() const     {         return typedText;     }     void setRotation(const TextRotation rotation = TEXT_ROTATE_0)     {         this->rotation = rotation;     }     TextRotation getRotation() const     {         return rotation;     }     void resizeToCurrentText();     void resizeHeightToCurrentText();     void setWideTextAction(WideTextAction action)     {         wideTextAction = action;     }     WideTextAction getWideTextAction() const     {         return wideTextAction;     }     virtual uint16_t getType() const     {         return (uint16_t)TYPE_TEXTAREA;     } protected:     TypedText      typedText;           colortype      color;               uint16_t       linespace;           uint8_t        alpha;               uint8_t        indentation;         TextRotation   rotation;            WideTextAction wideTextAction;  private:     int16_t getTextHeightInternal(const Unicode::UnicodeChar* format, ...) const; };

Fields

typedText

No summary provided. Read more...

color

No summary provided. Read more...

linespace

No summary provided. Read more...

alpha

No summary provided. Read more...

indentation

No summary provided. Read more...

rotation

No summary provided. Read more...

wideTextAction

No summary provided. Read more...

Methods

getSolidRect() const

@fn virtual Rect TextArea::getSolidRect() const Gets solid rectangle. Gets solid rectangle. Read more...

setColor()

@fn inline void TextArea::setColor(colortype color) Sets the color of the text. Sets the color of the text. Read more...

getColor() const

@fn inline colortype TextArea::getColor() const Gets the color of the text. Gets the color of the text. Read more...

setAlpha()

@fn void TextArea::setAlpha(uint8_t alpha) Sets the alpha value of the text. Sets the alpha value of the text. Read more...

getAlpha() const

@fn uint8_t TextArea::getAlpha() const Gets the alpha value of the text. Gets the alpha value of the text. Read more...

setBaselineY()

@fn virtual void TextArea::setBaselineY(int16_t baselineY) Adjusts the TextArea y coordinate to place the text at the specified baseline. Adjusts the text areas y coordinate so the text will have its baseline at the specified value. The placements is relative to the specified TypedText so if this changes you have to set the baseline again. Note that setTypedText must be called prior to setting the baseline. Read more...

setXBaselineY()

@fn virtual void TextArea::setXBaselineY(int16_t x, int16_t baselineY) Adjusts the TextArea y coordinate to place the text at the specified baseline. Adjusts the text areas y coordinate so the text will have its baseline at the specified value. The placements is relative to the specified TypedText so if this changes you have to set the baseline again. Note that setTypedText must be called prior to setting the baseline. The specified x coordinate will be used as the x coordinate of the TextArea. Read more...

setLinespacing()

@fn inline void TextArea::setLinespacing(uint16_t space) Sets the line spacing of the TextArea. Sets the line spacing of the TextArea. Read more...

getLinespacing() const

@fn inline uint16_t TextArea::getLinespacing() const Gets the line spacing of the TextArea. Gets the line spacing of the TextArea. Read more...

setIndentation()

@fn inline void TextArea::setIndentation(uint8_t indent) Sets the indentation for the text. Sets the indentation for the text. This is very useful when a font is an italic font where letters such as "j" and "g" extend a lot to the left under the previous characters. if a line starts with a "j" or "g" this letter would either have to be pushed to the right to be able to see all of it, e.g. using spaces which would ruin a multi line text which is left aligned. This could be solved by changing a textarea.setPosition(50,50,100,100) to textarea.setPosition(45,50,110, 100) followed by a textarea.setIndentation(5). Characters that do not extend to the left under the previous characters will be drawn in the same position in either case, but "j" and "g" will be aligned with other lines. The function getMaxPixelsLeft() will give you the maximum number of pixels any glyph in the font extends to the left. @see getMaxPixelsLeft. Read more...

getIndentation()

@fn inline uint8_t TextArea::getIndentation() Gets the indentation. Gets the indentation. @see setIndetation. Read more...

getTextHeight()

@fn virtual int16_t TextArea::getTextHeight(); Gets the total height needed by the text. Gets the total height needed by the text, taking number of lines and line spacing into consideration. Read more...

getTextWidth() const

@fn virtual uint16_t TextArea::getTextWidth() const; Gets the width in pixels of the current associated text in the current selected language. Gets the width in pixels of the current associated text in the current selected language. In case of multi-lined text the width of the widest line is returned. Read more...

draw() const

@fn virtual void TextArea::draw(const Rect& area) const; Draws the text. Draws the text. Called automatically. Read more...

setTypedText()

@fn void TextArea::setTypedText(TypedText t); Sets the TypedText of the text area. Sets the TypedText of the text area. If no prior size has been set the TextArea will be resized to fit the new TypedText. Read more...

getTypedText() const

@fn TypedText TextArea::getTypedText() const Gets the TypedText of the text area Gets the TypedText of the text area. Read more...

setRotation()

@fn void TextArea::setRotation(const TextRotation rotation = TEXT_ROTATE_0) Sets rotation of the text in the TextArea. Sets rotation of the text in the TextArea. The value TEXT_ROTATE_0 is the default for normal text. The value TEXT_ROTATE_90 will rotate the text clockwise, thus writing from the top of the display and down. Similarly TEXT_ROTATE_180 and TEXT_ROTATE_270 is further rotate 90 degrees clockwise. Read more...

getRotation() const

@fn TextRotation TextArea::getRotation() const Gets rotation of the text in the TextArea. Gets rotation of the text in the TextArea. Read more...

resizeToCurrentText()

@fn void TextArea::resizeToCurrentText(); Sets the dimensions of the TextArea. Sets the dimensions of the TextArea to match the width and height of the current associated text for the current selected language. Please note that if the current text rotation is either 90 or 270 degrees, the width of the text area will be set to the height of the text and vice versa, as the text is rotated. @see setRotation @see resizeHeightToCurrentText. Read more...

resizeHeightToCurrentText()

@fn void TextArea::resizeHeightToCurrentText(); Sets the hight of the TextArea. Sets the height of the TextArea to match the height of the current associated text for the current selected language. This is espicially useful for texts with WordWrap enabled. Please note that if the current text rotation is either 90 or 270 degrees, the width of the text area will be set and not the height, as the text is rotated. @see resizeToCurrentText @see setWordWrap @see setRotation. Read more...

setWideTextAction()

@fn void TextArea::setWideTextAction(WideTextAction action) Sets wide text action. Sets wide text action. Defines what to do if a line of text is wider than the text area. Default action is WIDE_TEXT_NONE which means that text lines are only broken if there is a newline in the text. If wrapping is enabled and the text would occupy more lines than the size of the TextArea, the last line will get an ellipsis to signal that some text is missing. The character used for ellipsis is taken from the text spreadsheet. @see WideTextAction @see getWideTextAction @see resizeHeightToCurrentText. Read more...

getWideTextAction() const

@fn WideTextAction TextArea::getWideTextAction() const Gets wide text action. Gets wide text action preciously set using setWideTextAction. @see setWideTextAction. Read more...

getType() const

@fn virtual uint16_t TextArea::getType() const For GUI testing only. For GUI testing only. Returns type of this drawable. Read more...

getTextHeightInternal() const

No summary provided. Read more...

Examples

touchgfx::TextArea is referenced by 4 libraries and example projects.

Class Tree

Parent classes
Child classes
touchgfx::TextArea
all items filtered out