WoopsiUI::BitmapButton Class Reference

#include <bitmapbutton.h>

Inheritance diagram for WoopsiUI::BitmapButton:
WoopsiUI::Gadget

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

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.

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


Member Function Documentation

bool BitmapButton::click ( s16  x,
s16  y 
) [virtual]

Click this gadget at the supplied co-ordinates.

Parameters:
x X co-ordinate of the click.
y Y co-ordinate of the click.
Returns:
True if the click was successful.

Reimplemented from WoopsiUI::Gadget.

void BitmapButton::draw ( Rect  clipRect  )  [virtual]

Draw the region of the button that falls within the clipRect.

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

Parameters:
x X co-ordinate of the release.
y Y co-ordinate of the release.
Returns:
True if the release was successful.

Reimplemented from WoopsiUI::Gadget.


Member Data Documentation

Bitmap to display when button is clicked

Height of the bitmaps

const u16* WoopsiUI::BitmapButton::_bitmapNormal [protected]

Bitmap to display when button is not clicked

Width of the bitmaps

X co-ordinate of the bitmaps

Y co-ordinate of the bitmaps


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Enumerator

Generated on Sat Oct 24 14:33:10 2009 for Woopsi by  doxygen 1.6.1