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

#include <libwoopsi/include/radiobuttongroup.h>

Inheritance diagram for WoopsiUI::RadioButtonGroup:
WoopsiUI::Gadget WoopsiUI::GadgetEventHandler

List of all members.

Public Member Functions

 RadioButtonGroup (s16 x, s16 y, GadgetStyle *style=NULL)
RadioButtonnewRadioButton (s16 x, s16 y, u16 width, u16 height)
virtual const RadioButtongetSelectedGadget () const
virtual const s32 getSelectedIndex () const
virtual void setSelectedGadget (RadioButton *gadget)
virtual void setSelectedIndex (s32 index)
virtual void getPreferredDimensions (Rect &rect) const
virtual void handleClickEvent (const GadgetEventArgs &e)
virtual void handleDoubleClickEvent (const GadgetEventArgs &e)
virtual void handleReleaseEvent (const GadgetEventArgs &e)
virtual void handleReleaseOutsideEvent (const GadgetEventArgs &e)

Protected Member Functions

virtual void drawContents (GraphicsPort *port)
virtual ~RadioButtonGroup ()
 RadioButtonGroup (const RadioButtonGroup &radioButtonGroup)

Protected Attributes

RadioButton_selectedGadget

Detailed Description

Container class that holds radio button gadgets and tracks their status. The group provides an easy way to determine which radio button is selected. Note that, in order to set the "mu" state for a radio button, it is necessary to set the state via the radio button, not the group.


Constructor & Destructor Documentation

WoopsiUI::RadioButtonGroup::RadioButtonGroup ( s16  x,
s16  y,
GadgetStyle style = NULL 
)

Constructor. Note that the group determines its width and height from the position and dimensions of its children.

Parameters:
xThe x co-ordinate of the group.
yThe y co-ordinate of the group.
styleThe style that the gadget should use. If this is not specified, the gadget will use the values stored in the global defaultGadgetStyle object. The gadget will copy the properties of the style into its own internal style object.
virtual WoopsiUI::RadioButtonGroup::~RadioButtonGroup ( ) [inline, protected, virtual]

Destructor.

WoopsiUI::RadioButtonGroup::RadioButtonGroup ( const RadioButtonGroup radioButtonGroup) [inline, protected]

Copy constructor is protected to prevent usage.


Member Function Documentation

virtual void WoopsiUI::RadioButtonGroup::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::RadioButtonGroup::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. Value is based on the length of the largest string in the set of options.

Parameters:
rectReference to a rect to populate with data.

Reimplemented from WoopsiUI::Gadget.

virtual const RadioButton* WoopsiUI::RadioButtonGroup::getSelectedGadget ( ) const [virtual]

Gets a pointer to the selected gadget.

Returns:
Pointer to the selected gadget.
virtual const s32 WoopsiUI::RadioButtonGroup::getSelectedIndex ( ) const [virtual]

Gets the index of the selected gadget.

Returns:
The index of the selected gadget.
virtual void WoopsiUI::RadioButtonGroup::handleClickEvent ( const GadgetEventArgs e) [virtual]

Handle a stylus click event.

Parameters:
eThe event data.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::RadioButtonGroup::handleDoubleClickEvent ( const GadgetEventArgs e) [virtual]

Handle a gadget double-click event.

Parameters:
eThe event data.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::RadioButtonGroup::handleReleaseEvent ( const GadgetEventArgs e) [virtual]

Handle a stylus release event that occurred within the bounds of the source gadget.

Parameters:
eThe event data.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::RadioButtonGroup::handleReleaseOutsideEvent ( const GadgetEventArgs e) [virtual]

Handle a stylus release event that occurred outside the bounds of the source gadget.

Parameters:
eThe event data.

Reimplemented from WoopsiUI::GadgetEventHandler.

RadioButton* WoopsiUI::RadioButtonGroup::newRadioButton ( s16  x,
s16  y,
u16  width,
u16  height 
)

Simple method for adding a new radio button to the group. This should be used in preference to the usual addGadget() method, as this method automatically resizes the group.

Parameters:
xThe x co-ordinate of the new button, relative to this gadget.
yThe y co-ordinate of the new button, relative to this gadget.
widthThe width of the new button.
heightThe height of the new button.
virtual void WoopsiUI::RadioButtonGroup::setSelectedGadget ( RadioButton gadget) [virtual]

Sets the selected radio button to the supplied gadget.

Parameters:
gadgetThe radio button to select.
virtual void WoopsiUI::RadioButtonGroup::setSelectedIndex ( s32  index) [virtual]

Selects the gadget at the specified index.

Parameters:
indexThe index of the gadget to select.

Member Data Documentation

Pointer to the currently selected radio button


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