WoopsiUI::RadioButtonGroup Class Reference
#include <radiobuttongroup.h>
List of all members.
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
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] |
WoopsiUI::RadioButtonGroup::RadioButtonGroup |
( |
const RadioButtonGroup & |
radioButtonGroup |
) |
[inline, protected] |
Copy constructor is protected to prevent usage.
Member Function Documentation
void 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.
void 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.
const RadioButton * RadioButtonGroup::getSelectedGadget |
( |
|
) |
const [virtual] |
Gets a pointer to the selected gadget.
- Returns:
- Pointer to the selected gadget.
const s32 RadioButtonGroup::getSelectedIndex |
( |
|
) |
const [virtual] |
Gets the index of the selected gadget.
- Returns:
- The index of the selected gadget.
RadioButton * 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. |
bool 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.
void RadioButtonGroup::setSelectedGadget |
( |
RadioButton * |
gadget |
) |
[virtual] |
Sets the selected radio button to the supplied gadget.
- Parameters:
-
| gadget | The radio button to select. |
void 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 files:
- C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/radiobuttongroup.h
- C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/radiobuttongroup.cpp