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

CUI_ListItem Class Reference

A simple class for keeping track of properties of items in a list. More...

#include <CUI_ListItem.h>

Inheritance diagram for CUI_ListItem:

CUI_MenuItem CUI_RadioItem List of all members.

Public Member Functions

 CUI_ListItem (const char *text=NULL, unsigned int itemID=0, IUI_Shader *icon=NULL, unsigned short flags=UI_ITEM_BUTTON)
 constructor

virtual ~CUI_ListItem ()
 destructor

virtual bool CreateElements (CUI_UI *ui, CUI_Frame *parent, IUI_Shader *itemShader, IUI_Shader *hoverShader, IUI_Border *itemBorder, IUI_Font *font)
 Create the elements and add them to the ui and the parent.

virtual bool SetText (char *text)
 set/change the text

virtual char * GetText ()
 get the text

virtual bool SetItemID (unsigned int itemID)
 set the ID

virtual unsigned int GetItemID ()
 get the ID

virtual bool SetIcon (IUI_Shader *icon)
 set the icon shader

virtual bool SetTextFrame (CUI_Widget *frame)
 set the widget that this item is linked to for diplaying text

virtual CUI_WidgetGetTextFrame ()
virtual bool SetIconFrame (CUI_Frame *frame)
 set the frame that this item is linked to for displaying the icon

virtual CUI_FrameGetIconFrame ()
virtual bool SetFlag (unsigned long flag, bool set)
 set a flag

virtual bool GetFlag (unsigned long flag)
 get the status of a specific flag

virtual bool IsSelectable ()
 is this item selectable?

virtual CUI_ButtonGetButton ()
 get the button which represents this list item

virtual IUI_ShaderGetIconShader ()
 get the icon shader for this item

virtual bool SetOwned (bool owned)
 set owned flag

virtual bool ToggleState ()
 toggle the state


Protected Attributes

char * m_text
 the text to be displayed

unsigned int m_itemID
 the id for this item

IUI_Shaderm_icon
 shader for the icon

unsigned short m_flags
 flags (enable/disable/type)

CUI_Buttonm_button
 pointer to the button for this item

CUI_Widgetm_textFrame
 pointer to the textframe for this item

CUI_Framem_iconFrame
 pointer to the icon frame for this item

bool m_state
 state for toggle items


Private Attributes

bool m_owned
 Was this item created inside the UI?


Detailed Description

A simple class for keeping track of properties of items in a list.

Uses a CUI_Button to handle mouse interface and some functionality. The Button is set to use the CUI_ListBox's callback function.

This class can be inherited to produce custom items in a listbox. Just be sure that you make the same calls to add the frame to the ui and as children to the parent frame.

Recognized Flags:
UI_ITEM_INACTIVE
UI_ITEM_DISABLED
UI_ITEM_BUTTON
UI_ITEM_TOGGLE


Member Function Documentation

bool CUI_ListItem::IsSelectable  )  [virtual]
 

is this item selectable?

Returns:
true if this object is active and enabled

bool CUI_ListItem::ToggleState  )  [virtual]
 

toggle the state

Returns:
new state


Member Data Documentation

unsigned int CUI_ListItem::m_itemID [protected]
 

the id for this item

returned to callback when clicked


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