#include <bitmapbutton.h>
Public Member Functions | |
BitmapButton (s16 x, s16 y, u16 width, u16 height, u16 bitmapX, u16 bitmapY, u16 bitmapWidth, u16 bitmapHeight, const u16 *bitmapNormal, const u16 *bitmapClicked) | |
virtual void | draw (Rect clipRect) |
virtual bool | click (s16 x, s16 y) |
virtual bool | release (s16 x, s16 y) |
Protected Member Functions | |
virtual | ~BitmapButton () |
BitmapButton (const BitmapButton &bitmapButton) | |
Protected Attributes | |
const u16 * | _bitmapNormal |
const u16 * | _bitmapClicked |
u16 | _bitmapWidth |
u16 | _bitmapHeight |
u16 | _bitmapX |
u16 | _bitmapY |
Class representing a clickable button that contains a bitmap image instead of text. Displays two bitmaps, one when the button is clicked, and one when it isn't. The bitmaps should be the same size.
BitmapButton::BitmapButton | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height, | |||
u16 | bitmapX, | |||
u16 | bitmapY, | |||
u16 | bitmapWidth, | |||
u16 | bitmapHeight, | |||
const u16 * | bitmapNormal, | |||
const u16 * | bitmapClicked | |||
) |
Constructor.
x | The x co-ordinate of the button. | |
y | The y co-ordinate of the button. | |
width | The width of the button. | |
height | The height of the button. | |
bitmapX | The x co-ordinate at which the bitmaps will be drawn. | |
bitmapY | The y co-ordinate at which the bitmaps will be drawn. | |
bitmapWidth | The width of the bitmaps. | |
bitmapHeight | The height of the bitmaps. | |
bitmapNormal | Pointer to the unclicked bitmap. | |
bitmapClicked | Pointer to the clicked bitmap. |
virtual WoopsiUI::BitmapButton::~BitmapButton | ( | ) | [inline, protected, virtual] |
Destructor.
WoopsiUI::BitmapButton::BitmapButton | ( | const BitmapButton & | bitmapButton | ) | [inline, protected] |
Copy constructor is protected to prevent usage.
bool BitmapButton::click | ( | s16 | x, | |
s16 | y | |||
) | [virtual] |
Click this gadget at the supplied co-ordinates.
x | X co-ordinate of the click. | |
y | Y co-ordinate of the click. |
Reimplemented from WoopsiUI::Gadget.
void BitmapButton::draw | ( | Rect | clipRect | ) | [virtual] |
Draw the region of the button that falls within the clipRect.
clipRect | The clipping region to draw within. |
Reimplemented from WoopsiUI::Gadget.
bool BitmapButton::release | ( | s16 | x, | |
s16 | y | |||
) | [virtual] |
Release this gadget at the supplied co-ordinates
x | X co-ordinate of the release. | |
y | Y co-ordinate of the release. |
Reimplemented from WoopsiUI::Gadget.
const u16* WoopsiUI::BitmapButton::_bitmapClicked [protected] |
Bitmap to display when button is clicked
u16 WoopsiUI::BitmapButton::_bitmapHeight [protected] |
Height of the bitmaps
const u16* WoopsiUI::BitmapButton::_bitmapNormal [protected] |
Bitmap to display when button is not clicked
u16 WoopsiUI::BitmapButton::_bitmapWidth [protected] |
Width of the bitmaps
u16 WoopsiUI::BitmapButton::_bitmapX [protected] |
X co-ordinate of the bitmaps
u16 WoopsiUI::BitmapButton::_bitmapY [protected] |
Y co-ordinate of the bitmaps