Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CUI_ComboBox Class Reference

A combo box. More...

#include <CUI_ComboBox.h>

Inheritance diagram for CUI_ComboBox:

CUI_Control CUI_Frame List of all members.

Public Member Functions

 CUI_ComboBox (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 *dropIcon=NULL)
 constructor

virtual ~CUI_ComboBox ()
 destructor

virtual bool SetUI (CUI_UI *ui)
 Set UI - add the frames to the UI.

virtual int GetSelectedID ()
 get the id of the currently selected item

virtual bool Select (CUI_Frame *frame)
 select a child frame

virtual bool Select (unsigned int id)
 select a frame with this id

virtual bool SetFlag (unsigned long flag, bool set)
 flag handling - needs to update listbox as well

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 an item to the list

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 - pass to listbox.

bool CallbackFunc (int id, int numparam, void *param)
 Callback function to handle updating the selection.

virtual bool SetDropIconShader (IUI_Shader *dropIcon)
 Set the dropIcon shader.

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.


Protected Member Functions

virtual bool OpenListBox ()
virtual bool CloseListBox ()

Protected Attributes

CUI_ListBoxm_listBox
 the list box it uses

CUI_Buttonm_button
 the button it uses

CUI_Widgetm_widget
 the widget it uses to display text

CUI_Framem_icon
 The icon for the selected item.

CUI_Framem_dropIcon
 The icon that shows it's a dropdown.

int m_selectedID
 the id of the currently selected item

bool m_listBoxOpen
 true if the listbox is open


Detailed Description

A combo box.

Also known as a chooser, or dropdown box.

Uses a button and a listbox.

Recognized flags:
[system]
UI_CLICKED
UI_HOVER
UI_SELECTED

UI_DISABLED
UI_INACTIVE


Member Function Documentation

bool CUI_ComboBox::CallbackFunc int  id,
int  numparam,
void *  param
[virtual]
 

Callback function to handle updating the selection.

Returns:
true if the global callback does NOT need to be called

false if the global callback needs to be called

Reimplemented from CUI_Frame.

bool CUI_ComboBox::SetFlag unsigned long  flag,
bool  set
[virtual]
 

flag handling - needs to update listbox as well

Also if selection is lost, and listbox is not being selected, close the listbox

Reimplemented from CUI_Frame.


Member Data Documentation

CUI_Widget* CUI_ComboBox::m_widget [protected]
 

the widget it uses to display text

text


The documentation for this class was generated from the following files:
Generated on Mon Sep 29 23:07:03 2003 for glGUI by doxygen 1.3.4