跳转到主要内容

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:

See: AbstractButtonContainer

Inherits from: T

Public Functions

virtual voidsetHeight(int16_t height)
Sets height.
virtual voidsetTileBitmaps(const Bitmap & bmpReleased, const Bitmap & bmpPressed)
Sets tile bitmaps.
virtual voidsetTileOffset(int16_t x, int16_t y)
Sets an offset into the bitmap where the tile drawing should start.
virtual voidsetWidth(int16_t width)
Sets width.
TiledImageButtonStyle()

Protected Functions

virtual voidhandleAlphaUpdated()
Handles what should happen when the alpha is updated.
virtual voidhandlePressedUpdated()
Handles what should happen when the pressed state is updated.

Protected Attributes

BitmapdownTile
The image to display when button is pressed.
TiledImagetiledImage
The tiled image.
BitmapupTile
The image to display when button is released.

Public Functions Documentation

setHeight

virtual void setHeight(int16_theight)

Sets height.

Parameters:
heightThe height.

setTileBitmaps

virtual void setTileBitmaps(const Bitmap &bmpReleased ,
const Bitmap &bmpPressed
)

Sets tile bitmaps.

Parameters:
bmpReleasedThe bitmap released.
bmpPressedThe bitmap pressed.

setTileOffset

virtual void setTileOffset(int16_tx ,
int16_ty
)

Sets an offset into the bitmap where the tile drawing should start.

Parameters:
xThe x coordinate offset.
yThe y coordinate offset.
See also:

setWidth

virtual void setWidth(int16_twidth)

Sets width.

Parameters:
widthThe 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.