Cafu Engine
ComponentListBoxT Class Reference

This components turns its window into a list-box control. More...

Inheritance diagram for ComponentListBoxT:

Public Member Functions

string GetSelItem ()
 Returns the currently selected item (or nil if no item is selected). More...
 
- Public Member Functions inherited from ComponentBaseT
any get (string var_name)
 Returns the value of an attribute (a member variable) of this class. More...
 
 set (string var_name, any new_value)
 Sets an attribute (a member variable) of this class to a new value. More...
 
string GetExtraMessage (string var_name)
 Returns the result of VarBaseT::GetExtraMessage() for the given member variable. More...
 
 interpolate (string var_name, number start_value, number end_value, number time)
 Schedules a value for interpolation between a start and end value over a given period of time. More...
 

Public Attributes

table Items
 The list of available items. More...
 
number Selection
 The index number of the currently selected item, where 1 corresponds to the first item (as per Lua convention). More...
 
tuple BgColorOdd
 The background color for odd rows. More...
 
number BgAlphaOdd
 The background alpha for odd rows. More...
 
tuple BgColorEven
 The background color for even rows. More...
 
number BgAlphaEven
 The background alpha for even rows. More...
 
tuple BgColorSel
 The background color for selected rows. More...
 
number BgAlphaSel
 The background alpha for selected rows. More...
 
tuple TextColorSel
 The foreground color for selected rows. More...
 
number TextAlphaSel
 The foreground alpha for selected rows. More...
 

Event Handlers (Callbacks)

See the Event Handlers (Callbacks) overview page for additional information about the methods in this group.

 OnSelectionChanged ()
 This method is called when the list box's selection has changed. More...
 

Detailed Description

This components turns its window into a list-box control.

It requires that in the same window a text component is available where the aspects of text rendering are configured (but that has empty text contents itself).

Note that the variables of this class (also referred to as "Public Attributes" or "Member Data") must be used with the get() and set() methods at this time – see get() and set() for details.

If you would like to create a new component of this type explicitly (those defined in the CaWE GUI Editor are instantiated automatically), use GuiT::new():

local comp = gui:new("ComponentListBoxT")
Implementing C++ Class:
cf::GuiSys::ComponentListBoxT

Member Function Documentation

string GetSelItem ( )

Returns the currently selected item (or nil if no item is selected).

OnSelectionChanged ( )

This method is called when the list box's selection has changed.

The selection may have changed as the result of a mouse click or a key press, whereas calling self:set("Selection", ...) does not trigger this event.

Use self:GetSelItem() or self:get("Selection") in order to learn which item has recently been selected.

Member Data Documentation

number BgAlphaEven

The background alpha for even rows.

Related C++ type:
float
number BgAlphaOdd

The background alpha for odd rows.

Related C++ type:
float
number BgAlphaSel

The background alpha for selected rows.

Related C++ type:
float
tuple BgColorEven

The background color for even rows.

Related C++ type:
Vector3fT
tuple BgColorOdd

The background color for odd rows.

Related C++ type:
Vector3fT
tuple BgColorSel

The background color for selected rows.

Related C++ type:
Vector3fT
table Items

The list of available items.

Related C++ type:
ArrayT<std::string>
number Selection

The index number of the currently selected item, where 1 corresponds to the first item (as per Lua convention).

Use 0 for "no selection".

Related C++ type:
unsigned int
number TextAlphaSel

The foreground alpha for selected rows.

Related C++ type:
float
tuple TextColorSel

The foreground color for selected rows.

Related C++ type:
Vector3fT