Woopsi 1.3
Nintendo DS Gui Framework
Public Member Functions | Protected Member Functions | Protected Attributes
WoopsiUI::BitmapButton Class Reference

#include <libwoopsi/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, const BitmapBase *bitmapNormal, const BitmapBase *bitmapClicked)
virtual void getPreferredDimensions (Rect &rect) const

Protected Member Functions

virtual void drawContents (GraphicsPort *port)
virtual void drawBorder (GraphicsPort *port)
virtual void drawOutline (GraphicsPort *port)
virtual void onClick (s16 x, s16 y)
virtual void onRelease (s16 x, s16 y)
virtual void onReleaseOutside (s16 x, s16 y)
virtual ~BitmapButton ()
 BitmapButton (const BitmapButton &bitmapButton)

Protected Attributes

const BitmapBase_bitmapNormal
const BitmapBase_bitmapClicked
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

WoopsiUI::BitmapButton::BitmapButton ( s16  x,
s16  y,
u16  width,
u16  height,
u16  bitmapX,
u16  bitmapY,
const BitmapBase bitmapNormal,
const BitmapBase bitmapClicked 
)

Constructor.

Parameters:
xThe x co-ordinate of the button.
yThe y co-ordinate of the button.
widthThe width of the button.
heightThe height of the button.
bitmapXThe x co-ordinate at which the bitmaps will be drawn.
bitmapYThe y co-ordinate at which the bitmaps will be drawn.
bitmapNormalPointer to the unclicked bitmap.
bitmapClickedPointer 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

virtual void WoopsiUI::BitmapButton::drawBorder ( GraphicsPort port) [protected, virtual]

Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters:
portThe GraphicsPort to draw to.
See also:
redraw()

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::BitmapButton::drawContents ( GraphicsPort port) [protected, virtual]

Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters:
portThe GraphicsPort to draw to.
See also:
redraw()

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::BitmapButton::drawOutline ( GraphicsPort port) [protected, virtual]

Draws the outline of the button.

Parameters:
portGraphics port to draw to.
virtual void WoopsiUI::BitmapButton::getPreferredDimensions ( Rect rect) const [virtual]

Insert the dimensions that this gadget wants to have into the rect passed in as a parameter. All co-ordinates are relative to the gadget's parent.

Parameters:
rectReference to a rect to populate with data.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::BitmapButton::onClick ( s16  x,
s16  y 
) [protected, virtual]

Marks the button for redraw.

Parameters:
xThe x co-ordinate of the click.
yThe y co-ordinate of the click.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::BitmapButton::onRelease ( s16  x,
s16  y 
) [protected, virtual]

Raises an action event and marks the button for redraw.

Parameters:
xThe x co-ordinate of the stylus.
yThe y co-ordinate of the stylus.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::BitmapButton::onReleaseOutside ( s16  x,
s16  y 
) [protected, virtual]

Marks the button for redraw.

Parameters:
xThe x co-ordinate of the stylus.
yThe y co-ordinate of the stylus.

Reimplemented from WoopsiUI::Gadget.


Member Data Documentation

Bitmap to display when button is clicked

Bitmap to display when button is not clicked

X co-ordinate of the bitmaps

Y co-ordinate of the bitmaps


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