Torque3D Documentation / _generateds / GuiGameListOptionsCtrl

GuiGameListOptionsCtrl

Engine/source/gui/controls/guiGameListOptionsCtrl.h

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

More...

Classes:

class

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

Private Types

Public Static Attributes

Indicates there is no option.

Public Functions

addRow(const char * label, const char * optionsList, bool wrapOptions, const char * callback, S32 icon, S32 yPad, bool enabled)

Adds a row to the control.

DECLARE_DESCRIPTION("A <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> showing pages of options that are gamepad friendly." )

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

bool

Callback when the object is registered with the sim.

bool

Callback when the gamepad axis is activated.

bool

Callback when the gamepad axis is activated.

bool

Callback when a key is pressed.

bool

Callback when a key is repeating.

Callback when the mouse button is released.

onRender(Point2I offset, const RectI & updateRect)

Called when this control is to render itself.

bool
selectOption(S32 rowIndex, StringTableEntry option)

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

setOptions(S32 rowIndex, const char * optionsList)

Sets the list of options on the given row.

Public Static Functions

Initializes fields accessible through the console.

Protected Functions

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

bool

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

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

Private Functions

changeOption(Row * row, S32 delta)

Changes the option on the given row.

Changes the option on the currently selected row.

clickOption(Row * row, S32 xPos)

Performs a click on the current option row.

Detailed Description

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

Private Types

typedef GuiGameListMenuCtrl Parent 

Public Static Attributes

const S32 NO_OPTION 

Indicates there is no option.

Public Functions

GuiGameListOptionsCtrl()

~GuiGameListOptionsCtrl()

addRow(const char * label, const char * optionsList, bool wrapOptions, const char * callback, S32 icon, S32 yPad, bool enabled)

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.

clearRows()

DECLARE_CONOBJECT(GuiGameListOptionsCtrl )

DECLARE_DESCRIPTION("A <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> showing pages of options that are gamepad friendly." )

getCurrentOption(S32 rowIndex)

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

Parameters:

rowIndex

Index of the row to get the option from.

return:

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.

onAdd()

Reimplemented from: GuiGameListMenuCtrl

onGamepadAxisLeft(const GuiEvent & event)

Reimplemented from: GuiGameListMenuCtrl

onGamepadAxisRight(const GuiEvent & event)

Reimplemented from: GuiGameListMenuCtrl

onKeyDown(const GuiEvent & event)

Reimplemented from: GuiGameListMenuCtrl

onKeyRepeat(const GuiEvent & event)

Reimplemented from: GuiGameListMenuCtrl

onMouseUp(const GuiEvent & event)

Reimplemented from: GuiGameListMenuCtrl

onRender(Point2I offset, const RectI & updateRect)

Reimplemented from: GuiGameListMenuCtrl

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.

return:

True if the row contained the option and was set, false otherwise.

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.

Public Static Functions

initPersistFields()

Initializes fields accessible through the console.

Protected Functions

enforceConstraints()

Reimplemented from: GuiGameListMenuCtrl

hasValidProfile()

Reimplemented from: GuiGameListMenuCtrl

onDebugRender(Point2I offset)

Reimplemented from: GuiGameListMenuCtrl

Private Functions

changeOption(Row * row, S32 delta)

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.

changeOption(S32 delta)

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.

clickOption(Row * row, S32 xPos)

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.