WoopsiUI::RadioButtonGroup Class Reference

#include <radiobuttongroup.h>

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

List of all members.

Public Member Functions

 RadioButtonGroup (s16 x, s16 y, FontBase *font=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 bool resize (u16 width, u16 height)
virtual void draw (Rect clipRect)
virtual void getPreferredDimensions (Rect &rect) const

Protected Member Functions

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,
FontBase font = NULL 
)

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

Parameters:
x The x co-ordinate of the group.
y The y co-ordinate of the group.
font The font to use with the group.
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::draw ( Rect  clipRect  )  [virtual]

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

Parameters:
clipRect The clipping region to draw.
See also:
draw()

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:
rect Reference 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.
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:
x The x co-ordinate of the new button, relative to this gadget.
y The y co-ordinate of the new button, relative to this gadget.
width The width of the new button.
height The height of the new button.
virtual bool WoopsiUI::RadioButtonGroup::resize ( u16  width,
u16  height 
) [virtual]

Resize the gadget to the new dimensions.

Parameters:
width The new width.
height The new height.
Returns:
True if the resize was successful.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::RadioButtonGroup::setSelectedGadget ( RadioButton gadget  )  [virtual]

Sets the selected radio button to the supplied gadget.

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

Selects the gadget at the specified index.

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

Generated on Sun Nov 15 11:35:37 2009 for Woopsi by  doxygen 1.6.1