GuiGameListOptionsCtrl Class Reference

#include <guiGameListOptionsCtrl.h>

Inheritance diagram for GuiGameListOptionsCtrl:

Inheritance graph
[legend]
List of all members.

Detailed Description

A control for showing pages of options that are gamepad friendly.


Public Member Functions

StringTableEntry getCurrentOption (S32 rowIndex) const
 Gets the text for the currently selected option of the given row.
bool selectOption (S32 rowIndex, StringTableEntry option)
 Attempts to set the given row to the specified selected option.
void setOptions (S32 rowIndex, const char *optionsList)
 Sets the list of options on the given row.
void addRow (const char *label, const char *optionsList, bool wrapOptions, const char *callback, S32 icon=-1, S32 yPad=0, bool enabled=true)
 Adds a row to the control.
void onRender (Point2I offset, const RectI &updateRect)
 Called when this control is to render itself.
void onMouseUp (const GuiEvent &event)
 Callback when the mouse button is released.
bool onKeyDown (const GuiEvent &event)
 Callback when a key is pressed.
bool onKeyRepeat (const GuiEvent &event)
 Callback when a key is repeating.
virtual bool onGamepadAxisLeft (const GuiEvent &event)
 Callback when the gamepad axis is activated.
virtual bool onGamepadAxisRight (const GuiEvent &event)
 Callback when the gamepad axis is activated.
 GuiGameListOptionsCtrl ()
 ~GuiGameListOptionsCtrl ()
 DECLARE_CONOBJECT (GuiGameListOptionsCtrl)

Static Public Member Functions

static void initPersistFields ()
 Initializes fields accessible through the console.

Static Public Attributes

static const S32 NO_OPTION = -1
 Indicates there is no option.

Protected Member Functions

bool hasValidProfile () const
 Checks to make sure our control has a profile of the correct type.
void enforceConstraints ()
 Enforces the validity of the fields on this control and its profile (if the profile is valid, see: hasValidProfile).
void onDebugRender (Point2I offset)
 Adds lines around the column divisions to the feedback already provided in the Parent.

Private Types

typedef GuiGameListMenuCtrl Parent

Private Member Functions

void clickOption (Row *row, S32 xPos)
 Performs a click on the current option row.
void changeOption (S32 delta)
 Changes the option on the currently selected row.
void changeOption (Row *row, S32 delta)
 Changes the option on the given row.

Classes

struct  Row
 An extension to the parent's row, adding the ability to keep a collection of options and track status related to them. More...


Member Typedef Documentation


Constructor & Destructor Documentation

GuiGameListOptionsCtrl::GuiGameListOptionsCtrl (  ) 

GuiGameListOptionsCtrl::~GuiGameListOptionsCtrl (  ) 


Member Function Documentation

StringTableEntry GuiGameListOptionsCtrl::getCurrentOption ( S32  rowIndex  )  const

Gets the text for the currently selected option of the given row.

Parameters:
rowIndex Index of the row to get the option from.
Returns:
A string representing the text currently displayed as the selected option on the given row. If there is no such displayed text then the empty string is returned.

bool GuiGameListOptionsCtrl::selectOption ( S32  rowIndex,
StringTableEntry  option 
)

Attempts to set the given row to the specified selected option.

The option will only be set if the option exists in the control.

Parameters:
rowIndex Index of the row to set an option on.
option The option to be made active.
Returns:
True if the row contained the option and was set, false otherwise.

void GuiGameListOptionsCtrl::setOptions ( S32  rowIndex,
const char *  optionsList 
)

Sets the list of options on the given row.

Parameters:
rowIndex Index of the row to set options on.
optionsList A tab separated list of options for the control.

void GuiGameListOptionsCtrl::addRow ( const char *  label,
const char *  optionsList,
bool  wrapOptions,
const char *  callback,
S32  icon = -1,
S32  yPad = 0,
bool  enabled = true 
)

Adds a row to the control.

Parameters:
label The text to display on the row as a label.
optionsList A tab separated list of options for the control.
wrapOptions Specify true to allow options to wrap at the ends or false to prevent wrapping.
callback [optional] Name of a script function to use as a callback when this row is activated. Default NULL means no callback.
icon [optional] Index of the icon to use as a marker. Default -1 means no icon will be shown on this row.
yPad [optional] An extra amount of height padding before the row.
enabled [optional] If this row is initially enabled. Default true.

void GuiGameListOptionsCtrl::onRender ( Point2I  offset,
const RectI updateRect 
) [virtual]

Called when this control is to render itself.

Parameters:
offset The location this control is to begin rendering
updateRect The screen area this control has drawing access to

Reimplemented from GuiGameListMenuCtrl.

void GuiGameListOptionsCtrl::onMouseUp ( const GuiEvent event  )  [virtual]

Callback when the mouse button is released.

Parameters:
event A reference to the event that triggered the callback.

Reimplemented from GuiGameListMenuCtrl.

bool GuiGameListOptionsCtrl::onKeyDown ( const GuiEvent event  )  [virtual]

Callback when a key is pressed.

Parameters:
event The event that triggered this callback.

Reimplemented from GuiGameListMenuCtrl.

bool GuiGameListOptionsCtrl::onKeyRepeat ( const GuiEvent event  )  [inline, virtual]

Callback when a key is repeating.

Parameters:
event The event that triggered this callback.

Reimplemented from GuiGameListMenuCtrl.

virtual bool GuiGameListOptionsCtrl::onGamepadAxisLeft ( const GuiEvent event  )  [virtual]

Callback when the gamepad axis is activated.

Parameters:
event A reference to the event that triggered the callback.

Reimplemented from GuiControl.

virtual bool GuiGameListOptionsCtrl::onGamepadAxisRight ( const GuiEvent event  )  [virtual]

Callback when the gamepad axis is activated.

Parameters:
event A reference to the event that triggered the callback.

Reimplemented from GuiControl.

GuiGameListOptionsCtrl::DECLARE_CONOBJECT ( GuiGameListOptionsCtrl   ) 

static void GuiGameListOptionsCtrl::initPersistFields (  )  [static]

Initializes fields accessible through the console.

Reimplemented from GuiGameListMenuCtrl.

bool GuiGameListOptionsCtrl::hasValidProfile (  )  const [protected, virtual]

Checks to make sure our control has a profile of the correct type.

Returns:
True if the profile is of type GuiGameListOptionsProfile or false if the profile is of any other type.

Reimplemented from GuiGameListMenuCtrl.

void GuiGameListOptionsCtrl::enforceConstraints (  )  [protected, virtual]

Enforces the validity of the fields on this control and its profile (if the profile is valid, see: hasValidProfile).

Reimplemented from GuiGameListMenuCtrl.

void GuiGameListOptionsCtrl::onDebugRender ( Point2I  offset  )  [protected, virtual]

Adds lines around the column divisions to the feedback already provided in the Parent.

Reimplemented from GuiGameListMenuCtrl.

void GuiGameListOptionsCtrl::clickOption ( Row row,
S32  xPos 
) [private]

Performs a click on the current option row.

The x position is used to determine if the left or right arrow were clicked. If one was clicked, the option will be changed. If neither was clicked, the option is unaffected. This method should only be called when there is an actively selected row.

Parameters:
row The row to perform the click on.
xPos The x position of the the click, relative to the control.

void GuiGameListOptionsCtrl::changeOption ( S32  delta  )  [private]

Changes the option on the currently selected row.

If there is no row selected, this method does nothing.

Parameters:
delta The amount to change the option selection by. Typically this will be 1 or -1.

void GuiGameListOptionsCtrl::changeOption ( Row row,
S32  delta 
) [private]

Changes the option on the given row.

Parameters:
row The row to change the option on.
delta The amount to change the option selection by. Typically this will be 1 or -1.


Member Data Documentation

Indicates there is no option.