TiledImageButtonStyle
touchgfx/containers/buttons/TiledImageButtonStyle.hpp
A tiled image button style. An tiled image button style. This class is supposed to be used with one of the ButtonTrigger classes to create a functional button. This class will show one of two tiled images depending on the state of the button (pressed or released).
The TiledImageButtonStyle does not set the size of the enclosing container (normally AbstractButtonContainer) to the size of the pressed Bitmap. This can be overridden by calling setWidth/setHeight after setting the bitmaps.
Template Parameters:
- T Generic type parameter. Typically a AbstractButtonContainer subclass.
Inherits from: T
Public Functions
virtual void | setHeight(int16_t height) |
Sets height. | |
virtual void | setTileBitmaps(const Bitmap & bmpReleased, const Bitmap & bmpPressed) |
Sets tile bitmaps. | |
virtual void | setTileOffset(int16_t x, int16_t y) |
Sets an offset into the bitmap where the tile drawing should start. | |
virtual void | setWidth(int16_t width) |
Sets width. | |
TiledImageButtonStyle() | |
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
Bitmap | downTile |
The image to display when button is pressed. | |
TiledImage | tiledImage |
The tiled image. | |
Bitmap | upTile |
The image to display when button is released. | |
Public Functions Documentation
setHeight
virtual void setHeight | ( | int16_t | height | ) | |
Sets height.
height | The height. |
setTileBitmaps
virtual void setTileBitmaps | ( | const Bitmap & | bmpReleased , | ||
const Bitmap & | bmpPressed | ||||
) |
Sets tile bitmaps.
bmpReleased | The bitmap released. |
bmpPressed | The bitmap pressed. |
setTileOffset
virtual void setTileOffset | ( | int16_t | x , | ||
int16_t | y | ||||
) |
Sets an offset into the bitmap where the tile drawing should start.
x | The x coordinate offset. |
y | The y coordinate offset. |
setWidth
virtual void setWidth | ( | int16_t | width | ) | |
Sets width.
width | The width. |
TiledImageButtonStyle
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
downTile
Bitmap downTile
The image to display when button is pressed.
tiledImage
TiledImage tiledImage
The tiled image.
upTile
Bitmap upTile
The image to display when button is released.