#include <CUI_ListBox.h>
Inheritance diagram for CUI_ListBox:
Public Member Functions | |
CUI_ListBox (CUI_UI *ui=NULL, float x=0, float y=0, float x2=1, float y2=1, CUI_Frame *parent=NULL, IUI_Shader *shader=NULL, IUI_Shader *cursor=NULL, CUI_CoordSys *coordsys=NULL, IUI_Shader *itemshader=NULL, IUI_Shader *hovershader=NULL, IUI_Shader *selectedshader=NULL, IUI_Border *itemborder=NULL, IUI_Font *font=NULL) | |
constructor | |
virtual | ~CUI_ListBox () |
destructor | |
virtual bool | AddItem (char *text=NULL, unsigned int itemID=0, IUI_Shader *icon=NULL, unsigned short flags=UI_ITEM_BUTTON) |
add an item to the list | |
virtual bool | AddItem (CUI_ListItem *item) |
add a pre-created item (probably an app-specific inherited class) | |
virtual bool | RemoveItem (unsigned int itemID) |
remove an item - flags it as inactive | |
virtual bool | EnableItem (unsigned int itemID, bool enable=true) |
enable/disable an item | |
virtual bool | ProcessKey (unsigned long key) |
Process a incoming key. | |
virtual bool | Render (double dtime, IUI_Renderer *renderer) |
overloaded render - update selected item's shader | |
bool | CallbackFunc (int id, int numparam, void *param) |
Callback function to handle updating the selection. | |
virtual bool | Select (CUI_Frame *frame) |
select a child frame | |
virtual bool | Select (unsigned int id) |
select a child frame with this id | |
virtual bool | SetItemSize (float size) |
set the size of each item (in the control's parent's coordinate system) | |
virtual bool | SetItemFlag (unsigned int itemID, unsigned short flag, bool enable=true) |
general flag flipping | |
virtual bool | SetItemIcon (unsigned int itemID, IUI_Shader *icon) |
set the icon for an item | |
virtual bool | SetHoverShader (IUI_Shader *shader) |
set the hover shader for each item | |
virtual bool | SetSelectedShader (IUI_Shader *shader) |
set the shader for the selected item | |
virtual bool | SetItemShader (IUI_Shader *shader) |
set the shader for each item | |
virtual bool | SetItemBorder (IUI_Border *border) |
Set the border for each item. | |
virtual bool | UpdateView () |
update view | |
virtual int | GetActiveItems () |
Get the number of active items in the list. | |
virtual char * | GetSelectedText () |
Get the text label of the selected item. | |
virtual int | GetSelectedID () |
Get the ID of the selected item. | |
virtual IUI_Shader * | GetSelectedIconShader () |
Get the icon for the selected item. | |
virtual bool | SetToggleIcons (IUI_Shader *off, IUI_Shader *on) |
set toggle Icon shaders | |
Protected Types | |
typedef std::list< CUI_ListItem * > | LISTITEMLIST |
type for the listitem list | |
Protected Member Functions | |
CUI_ListItem * | FindItem (unsigned int itemID) |
Find the first item with this ID. | |
bool | SelectNext () |
Select Next item. | |
bool | SelectPrevious () |
Select Previous item. | |
Protected Attributes | |
float | m_itemSize |
The size of each item (in the control's parent's coordinate system). | |
CUI_ListItem * | m_selected |
pointer to the currently selected listitem | |
IUI_Shader * | m_itemShader |
default shader for each item | |
IUI_Border * | m_itemBorder |
default border for each item | |
IUI_Shader * | m_selectedShader |
shader for the selected item | |
LISTITEMLIST | m_itemList |
a list of the items in this list | |
int | m_activeItems |
number of active items in the list | |
IUI_Shader * | m_hoverShader |
shader for the item being hovered over | |
IUI_Shader * | m_toggleOnIcon |
Toggle on icon shader. | |
IUI_Shader * | m_toggleOffIcon |
Toggle off icon shader. |
The list box is responsible for creating and deleting list items.
The list box itself is not clickable or draggable. That functionality is handled by the CUI_Buttons that are its children.
Recognized flags:
[system]
UI_CLICKED
UI_HOVER
UI_SELECTED
UI_DISABLED
UI_INACTIVE
UI_SQUEEZE
UI_VERTICAL
|
Callback function to handle updating the selection.
Reimplemented from CUI_Frame. Reimplemented in CUI_Menu. |
|
update view update the placement of items and the overall view of the control Reimplemented in CUI_Menu. |
|
The size of each item (in the control's parent's coordinate system). If UI_SQUEEZE is set, this is ignored |