WildcardTextButtonStyle
touchgfx/containers/buttons/WildcardTextButtonStyle.hpp
A wildcard text button style. An wildcard text button style. This class is supposed to be used with one of the ButtonTrigger classes to create a functional button. This class will show a text with a wildcard in one of two colors depending on the state of the button (pressed or released).
The WildcardTextButtonStyle does not set the size of the enclosing container (normally AbstractButtonContainer). The size must be set manually.
To get a background behind the text, use WildcardTextButtonStyle together with e.g. ImageButtonStyle:
WildcardTextButtonStyle<ImageButtonStyle<ClickButtonTrigger> > myButton;
The position of the text can be adjusted with setTextXY (default is centered).
Template Parameters:
- T Generic type parameter. Typically a AbstractButtonContainer subclass.
Inherits from: T
Public Functions
void | setWildcardText(TypedText t) |
Sets wildcard text. | |
void | setWildcardTextBuffer(const Unicode::UnicodeChar * buffer) |
Sets wildcard text buffer. | |
void | setWildcardTextColors(colortype newColorReleased, colortype newColorPressed) |
Sets wild card text colors. | |
void | setWildcardTextPosition(int16_t x, int16_t y, int16_t width, int16_t height) |
Sets text position and dimensions. | |
void | setWildcardTextRotation(TextRotation rotation) |
Sets wildcard text rotation. | |
void | setWildcardTextX(int16_t x) |
Sets wildcard text x coordinate. | |
void | setWildcardTextXY(int16_t x, int16_t y) |
Sets wildcard text position. | |
void | setWildcardTextY(int16_t y) |
Sets wildcard text y coordinate. | |
WildcardTextButtonStyle() | |
Protected Functions
virtual void | handleAlphaUpdated() |
Handles what should happen when the alpha is updated. | |
virtual void | handlePressedUpdated() |
Handles what should happen when the pressed state is updated. | |
Protected Attributes
colortype | colorPressed |
The color pressed. | |
colortype | colorReleased |
The color released. | |
TextAreaWithOneWildcard | wildcardText |
The wildcard text. | |
Public Functions Documentation
setWildcardText
void setWildcardText | ( | TypedText | t | ) | |
setWildcardTextBuffer
void setWildcardTextBuffer | ( | const Unicode::UnicodeChar * | buffer | ) | |
Sets wildcard text buffer.
buffer | If non-null, the buffer. |
setWildcardTextColors
void setWildcardTextColors | ( | colortype | newColorReleased , | ||
colortype | newColorPressed | ||||
) |
Sets wild card text colors.
newColorReleased | The new color released. |
newColorPressed | The new color pressed. |
setWildcardTextPosition
void setWildcardTextPosition | ( | int16_t | x , | ||
int16_t | y , | ||||
int16_t | width , | ||||
int16_t | height | ||||
) |
Sets text position and dimensions.
x | The x coordinate. |
y | The y coordinate. |
width | The width of the text. |
height | The height of the text. |
setWildcardTextRotation
void setWildcardTextRotation | ( | TextRotation | rotation | ) | |
Sets wildcard text rotation.
rotation | The rotation. |
setWildcardTextX
void setWildcardTextX | ( | int16_t | x | ) | |
Sets wildcard text x coordinate.
x | The x coordinate. |
setWildcardTextXY
void setWildcardTextXY | ( | int16_t | x , | ||
int16_t | y | ||||
) |
Sets wildcard text position.
x | The x coordinate. |
y | The y coordinate. |
setWildcardTextY
void setWildcardTextY | ( | int16_t | y | ) | |
Sets wildcard text y coordinate.
y | The y coordinate. |
WildcardTextButtonStyle
Protected Functions Documentation
handleAlphaUpdated
virtual void handleAlphaUpdated | ( | ) |
Handles what should happen when the alpha is updated.
handlePressedUpdated
virtual void handlePressedUpdated | ( | ) |
Handles what should happen when the pressed state is updated.
Protected Attributes Documentation
colorPressed
colortype colorPressed
The color pressed.
colorReleased
colortype colorReleased
The color released.
wildcardText
TextAreaWithOneWildcard wildcardText
The wildcard text.