#include <button.h>
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) |
Clickable button gadget. Displays text within the button.
WoopsiUI::Button::Button | ( | s16 | x, | |
s16 | y, | |||
u16 | width, | |||
u16 | height, | |||
const WoopsiString & | text, | |||
GadgetStyle * | style = NULL | |||
) |
Constructor for buttons that display a string.
x | The x co-ordinate of the button, relative to its parent. | |
y | The y co-ordinate of the button, relative to its parent. | |
width | The width of the button. | |
height | The height of the button. | |
text | The text for the button to display. | |
style | The 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.
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.
port | The GraphicsPort to draw to. |
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.
port | The GraphicsPort to draw to. |
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.
port | Graphics port to draw to. |
Reimplemented in WoopsiUI::CycleButton, WoopsiUI::DecorationGlyphButton, and WoopsiUI::StickyButton.
virtual void WoopsiUI::Button::onClick | ( | s16 | x, | |
s16 | y | |||
) | [protected, virtual] |
Redraws the button.
x | The x co-ordinate of the click. | |
y | The 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 redraws the button.
x | The x co-ordinate of the stylus. | |
y | The 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] |
Redraws the button.
x | The x co-ordinate of the stylus. | |
y | The y co-ordinate of the stylus. |
Reimplemented from WoopsiUI::Gadget.
Reimplemented in WoopsiUI::CycleButton.