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

touchgfx::ButtonWithLabel class

@class ButtonWithLabel ButtonWithLabel.hpp touchgfx/widgets/ButtonWithLabel.hpp A Button specialization that also displays a text on top of the button bitmap. A Button specialization that also displays a text on top of the button bitmap. @see Button

Syntax

class ButtonWithLabel : public Button { public:     ButtonWithLabel();     void setLabelText(TypedText t)     {         typedText = t;         updateTextPosition();     }     TypedText getLabelText() const     {         return typedText;     }     void setLabelColor(colortype col, bool performInvalidate = false)     {         color = col;         if (performInvalidate)         {             invalidate();         }     }     void setLabelColorPressed(colortype col, bool performInvalidate = false)     {         colorPressed = col;         if (performInvalidate)         {             invalidate();         }     }     void setLabelRotation(TextRotation rotation)     {         this->rotation = rotation;     }     TextRotation getLabelRotation()     {         return rotation;     }     void updateTextPosition()     {         const Font* f = typedText.getFont();         const Unicode::UnicodeChar* s = typedText.getText();         textHeightIncludingSpacing = f->getMaxTextHeight(s) * f->getNumberOfLines(s) + f->getSpacingAbove(s);     }     virtual Rect getSolidRect() const     {         return Button::getSolidRect();     };     virtual void draw(const Rect& area) const;     virtual uint16_t getType() const     {         return (uint16_t)TYPE_BUTTONWITHLABEL;     } protected:     TypedText    typedText;                       colortype    color;                           colortype    colorPressed;                    TextRotation rotation;                        uint8_t      textHeightIncludingSpacing;  };

Fields

typedText

No summary provided. Read more...

color

No summary provided. Read more...

colorPressed

No summary provided. Read more...

rotation

No summary provided. Read more...

textHeightIncludingSpacing

No summary provided. Read more...

Methods

setLabelText()

@fn void ButtonWithLabel::setLabelText(TypedText t) Sets the text to display on the button. Sets the text to display on the button. Texts with wildcards are not supported. Read more...

getLabelText() const

@fn TypedText ButtonWithLabel::getLabelText() const Gets the text used for the label. Gets the text used for the label. Read more...

setLabelColor()

@fn void ButtonWithLabel::setLabelColor(colortype col, bool performInvalidate = false) Sets label color. Sets label color. Read more...

setLabelColorPressed()

@fn void ButtonWithLabel::setLabelColorPressed(colortype col, bool performInvalidate = false) Sets label color when the button is pressed. Sets label color when the button is pressed. Read more...

setLabelRotation()

@fn void ButtonWithLabel::setLabelRotation(TextRotation rotation) Sets the rotation of the text on the label. Sets the rotation of the text on the label. Please note that this will not rotate the bitmap of the label, only the text. Read more...

getLabelRotation()

@fn TextRotation ButtonWithLabel::getLabelRotation() Gets the current rotation of the text on the label. Gets the current rotation of the text on the label. Read more...

updateTextPosition()

@fn void ButtonWithLabel::updateTextPosition() Positions the label text as horizontally centered. If the text changes due to a language change you may need to reposition the label text to stay horizontally centered. Read more...

getSolidRect() const

No summary provided. Read more...

draw() const

No summary provided. Read more...

getType() const

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

Examples

touchgfx::ButtonWithLabel is referenced by 3 libraries and example projects.

References

LocationText
ButtonWithLabel.hpp:33
class ButtonWithLabel : public Button

Class Tree

Child classes
touchgfx::ButtonWithLabel
all items filtered out