GuiPopUpMenuCtrlEx

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

Inherit:
GuiTextCtrl

Description

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

Example:

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

Methods

void GuiPopUpMenuCtrlEx::add(string name, int idNum, int scheme)
void GuiPopUpMenuCtrlEx::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
void GuiPopUpMenuCtrlEx::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
void GuiPopUpMenuCtrlEx::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.
void GuiPopUpMenuCtrlEx::clear()

Clear the popup list. Reimplemented from SimSet .

void GuiPopUpMenuCtrlEx::clearEntry(S32 entry)
int GuiPopUpMenuCtrlEx::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
Returns:Numerical ID of entry containing the text.
void GuiPopUpMenuCtrlEx::forceClose()

Manually force this control to collapse and close.

void GuiPopUpMenuCtrlEx::forceOnAction()

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

int GuiPopUpMenuCtrlEx::getSelected()

Get the current selection of the menu.

Returns:Returns the ID of the currently selected entry
string GuiPopUpMenuCtrlEx::getText()

Get the. Detailed description

Parameters:param – Description
Returns:Returns current text in string format

Example:

// Comment
code();
string GuiPopUpMenuCtrlEx::getTextById(int id)

Get the text of an entry based on an ID.

Parameters:id – The ID assigned to the entry being queried
Returns:String contained by the specified entry, NULL if empty or bad ID
void GuiPopUpMenuCtrlEx::setNoneSelected(int param)

Clears selection in the menu.

GuiPopUpMenuCtrlEx::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
GuiPopUpMenuCtrlEx::setSelected(bool scriptCallback)

brief Manually set the selection to the first entry

Parameters:scripCallback – Optional boolean that forces the script callback if true
void GuiPopUpMenuCtrlEx::setText(string text)

Set the current text to a specified value. Reimplemented from GuiTextCtrl .

Parameters:text – String containing new text to set
void GuiPopUpMenuCtrlEx::sort()

Sort the list alphabetically.

void GuiPopUpMenuCtrlEx::sortID()

Sort the list by ID.

Fields

filename GuiPopUpMenuCtrlEx::bitmap

File name of bitmap to use.

Point2I GuiPopUpMenuCtrlEx::bitmapBounds

Boundaries of bitmap displayed.

string GuiPopUpMenuCtrlEx::getColorById

Get color of an entry’s box.

Parameters:id – ID number of entry to query
Returns:ColorI in the format of “Red Green Blue Alpha”, each of with is a value between 0 - 255
bool GuiPopUpMenuCtrlEx::hotTrackCallback

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

int GuiPopUpMenuCtrlEx::maxPopupHeight

Length of menu when it extends.

void GuiPopUpMenuCtrlEx::replaceText

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

Parameters:True – to turn on replacing, false to disable it
bool GuiPopUpMenuCtrlEx::reverseTextList

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

bool GuiPopUpMenuCtrlEx::sbUsesNAColor

Deprecated.

void GuiPopUpMenuCtrlEx::setEnumContent

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
int GuiPopUpMenuCtrlEx::size

Get the size of the menu.

Returns:Number of entries in the menu