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

#include <libwoopsi/include/button.h>

Inheritance diagram for WoopsiUI::Button:
WoopsiUI::Label WoopsiUI::Gadget WoopsiUI::CheckBox WoopsiUI::CycleButton WoopsiUI::DecorationGlyphButton WoopsiUI::RadioButton WoopsiUI::StickyButton WoopsiUI::WindowBorderButton WoopsiUI::WoopsiKey

List of all members.

Public Member Functions

 Button (s16 x, s16 y, u16 width, u16 height, const WoopsiString &text, GadgetStyle *style=NULL)

Protected Member Functions

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

Detailed Description

Clickable button gadget. Displays text within the button.


Constructor & Destructor Documentation

WoopsiUI::Button::Button ( s16  x,
s16  y,
u16  width,
u16  height,
const WoopsiString text,
GadgetStyle style = NULL 
)

Constructor for buttons that display a string.

Parameters:
xThe x co-ordinate of the button, relative to its parent.
yThe y co-ordinate of the button, relative to its parent.
widthThe width of the button.
heightThe height of the button.
textThe text for the button to display.
styleThe style that the button should use. If this is not specified, the button will use the values stored in the global defaultGadgetStyle object. The button will copy the properties of the style into its own internal style object.
virtual WoopsiUI::Button::~Button ( ) [inline, protected, virtual]

Destructor.

WoopsiUI::Button::Button ( const Button button) [inline, protected]

Copy constructor is protected to prevent usage.


Member Function Documentation

virtual void WoopsiUI::Button::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::Label.

Reimplemented in WoopsiUI::CheckBox, WoopsiUI::CycleButton, WoopsiUI::DecorationGlyphButton, and WoopsiUI::WindowBorderButton.

virtual void WoopsiUI::Button::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::Label.

Reimplemented in WoopsiUI::CheckBox, WoopsiUI::CycleButton, WoopsiUI::DecorationGlyphButton, WoopsiUI::RadioButton, and WoopsiUI::WindowBorderButton.

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

Draws the outline of the button.

Parameters:
portGraphics port to draw to.

Reimplemented in WoopsiUI::CycleButton, WoopsiUI::DecorationGlyphButton, and WoopsiUI::StickyButton.

virtual void WoopsiUI::Button::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.

Reimplemented in WoopsiUI::CheckBox, and WoopsiUI::RadioButton.

virtual void WoopsiUI::Button::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.

Reimplemented in WoopsiUI::CycleButton.

virtual void WoopsiUI::Button::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.

Reimplemented in WoopsiUI::CycleButton.


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