Torque3D Documentation / _generateds / GuiPopUpMenuCtrlEx

GuiPopUpMenuCtrlEx

consoledoc.h

A control that allows to select a value from a drop-down list.

More...

Public Attributes

filename

File name of bitmap to use.

Point2I

Boundaries of bitmap displayed.

bool

Whether to provide a 'onHotTrackItem' callback when a list item is hovered over.

int

Length of menu when it extends.

bool

Reverses text list if popup extends up, instead of down.

bool

Deprecated.

Public Functions

void
add(string name, S32 idNum, S32 scheme)

Adds an entry to the list.

void
add(string name, int idNum, uint scheme)
void
addCategory(string text)

Add a category to the list.

void
addScheme(int id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL)

Create a new scheme and add it to the list of choices for when a new text entry is added.

void

Clear the popup list.

void
clearEntry(int entry)
int
findText(string text)

Returns the id of the first entry containing the specified text or -1 if not found.

void

Manually force this control to collapse and close.

void

Manually for the onAction function, which updates everything in this control.

ColorI
getColorById(int id)

Get color of an entry's box.

int

Get the current selection of the menu.

string

Get the.

string
getTextById(int id)

Get the text of an entry based on an ID.

void
replaceText(int boolVal)

Flag that causes each new text addition to replace the current entry.

void
setEnumContent(string className, string enumName)

This fills the popup with a classrep's field enumeration type info.

void
setNoneSelected(int param)

Clears selection in the menu.

setSelected(bool scriptCallback)
setSelected(int id, bool scriptCallback)
void
setText(string text)

Set the current text to a specified value.

int
size()

Get the size of the menu.

void
sort()

Sort the list alphabetically.

void

Sort the list by ID.

Detailed Description

A control that allows to select a value from a drop-down list.

This is essentially a GuiPopUpMenuCtrl, but with quite a few more features.

new GuiPopUpMenuCtrlEx()
{
  maxPopupHeight = "200";
  sbUsesNAColor = "0";
  reverseTextList = "0";
  bitmapBounds = "16 16";
  hotTrackCallback = "0";
  extent = "64 64";
  profile = "GuiDefaultProfile";
  tooltipProfile = "GuiToolTipProfile";
};

Public Attributes

filename bitmap 

File name of bitmap to use.

Point2I bitmapBounds 

Boundaries of bitmap displayed.

bool hotTrackCallback 

Whether to provide a 'onHotTrackItem' callback when a list item is hovered over.

int maxPopupHeight 

Length of menu when it extends.

bool reverseTextList 

Reverses text list if popup extends up, instead of down.

bool sbUsesNAColor 

Deprecated.

Public Functions

add(string name, S32 idNum, S32 scheme)

Adds an entry to the list.

Parameters:

name

String containing the name of the entry

idNum

Numerical value assigned to the name

scheme

Optional ID associated with a scheme for font coloring, highlight coloring, and selection coloring

add(string name, int idNum, uint scheme)

addCategory(string text)

Add a category to the list.

Acts as a separator between entries, allowing for sub-lists

Parameters:

text

Name of the new category

addScheme(int id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL)

Create a new scheme and add it to the list of choices for when a new text entry is added.

Parameters:

id

Numerical id associated with this scheme

fontColor

The base text font color. Formatted as "Red Green Blue", each a numerical between 0 and 255.

fontColorHL

Color of text when being highlighted. Formatted as "Red Green Blue", each a numerical between 0 and 255.

fontColorSel

Color of text when being selected. Formatted as "Red Green Blue", each a numerical between 0 and 255.

clear()

Clear the popup list.

clearEntry(int entry)

findText(string text)

Returns the id of the first entry containing the specified text or -1 if not found.

Parameters:

text

String value used for the query

return:

Numerical ID of entry containing the text.

forceClose()

Manually force this control to collapse and close.

forceOnAction()

Manually for the onAction function, which updates everything in this control.

getColorById(int id)

Get color of an entry's box.

Parameters:

id

ID number of entry to query

return:

ColorI in the format of "Red Green Blue Alpha", each of with is a value between 0 - 255

getSelected()

Get the current selection of the menu.

return:

Returns the ID of the currently selected entry

getText()

Get the.

Detailed description

Parameters:

param

Description

// Comment
code();

return:

Returns current text in string format

getTextById(int id)

Get the text of an entry based on an ID.

Parameters:

id

The ID assigned to the entry being queried

return:

String contained by the specified entry, NULL if empty or bad ID

replaceText(int boolVal)

Flag that causes each new text addition to replace the current entry.

Parameters:

True

to turn on replacing, false to disable it

setEnumContent(string className, string enumName)

This fills the popup with a classrep's field enumeration type info.

More of a helper function than anything. If console access to the field list is added, at least for the enumerated types, then this should go away.

Parameters:

class

Name of the class containing the enum

enum

Name of the enum value to acces

setNoneSelected(int param)

Clears selection in the menu.

setSelected(bool scriptCallback)

brief Manually set the selection to the first entry

Parameters:

scripCallback

Optional boolean that forces the script callback if true

setSelected(int id, bool scriptCallback)

brief Manually set an entry as selected int his control

Parameters:

id

The ID of the entry to select

scripCallback

Optional boolean that forces the script callback if true

setText(string text)

Set the current text to a specified value.

Parameters:

text

String containing new text to set

size()

Get the size of the menu.

return:

Number of entries in the menu

sort()

Sort the list alphabetically.

sortID()

Sort the list by ID.