#include <CUI_Menu.h>
Inheritance diagram for CUI_Menu:
Public Member Functions | |
CUI_Menu (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, IUI_Shader *submenuicon=NULL) | |
virtual | ~CUI_Menu () |
destructor | |
virtual bool | AddItem (char *text=NULL, unsigned int itemID=0, IUI_Shader *icon=NULL, unsigned short flags=UI_ITEM_BUTTON, void *sublist=NULL) |
add an item to the list | |
virtual bool | AddItem (CUI_MenuItem *item) |
add a pre-created item to the list | |
virtual bool | RemoveItem (unsigned int itemID) |
remove an item - flags it as inactive | |
virtual bool | ProcessKey (unsigned long key) |
Process a incoming key. | |
virtual bool | Render (double dtime, IUI_Renderer *renderer) |
overloaded render | |
virtual 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 | ActivateSubMenu (bool select) |
Activate the sublist (if any) of currently selected item. | |
virtual bool | DeactivateSubMenu (bool updateselect) |
Deactivate the sublist (if any) of currently selected item. | |
virtual bool | GetSubMenuPosition (float &x, float &y) |
get the position that the sublist for the selected item should open at | |
virtual bool | UpdateView () |
update view | |
virtual bool | SetSubMenuIcon (IUI_Shader *icon) |
set the icon to use for a submenu item | |
virtual bool | SetParentMenu (CUI_Menu *parent) |
set parent menu pointer | |
virtual CUI_Menu * | GetParentMenu () |
get parent menu pointer | |
virtual bool | SetFlag (unsigned long flag, bool set) |
Intercept flag handling to detect de-selection. | |
Protected Types | |
typedef std::list< CUI_MenuItem * > | MENUITEMLIST |
type for the listitem list | |
Protected Member Functions | |
virtual CUI_MenuItem * | FindItem (unsigned int itemID) |
Find the first item with this ID. | |
virtual bool | SelectNext (bool open) |
Select Next item. | |
virtual bool | SelectPrevious (bool open) |
Select Previous item. | |
Protected Attributes | |
CUI_MenuItem * | m_selected |
pointer to the currently selected listitem | |
MENUITEMLIST | m_itemList |
a list of the items in this list | |
IUI_Shader * | m_subMenuIcon |
the submenu icon | |
CUI_Menu * | m_parentMenu |
Parent menu (if this is a submenu). | |
CUI_Menu * | m_subMenu |
open submenu |
Adds submenu functionality to CUI_ListBox
Circular connections in the menu tree are evil. It will not work. Don't do it. There must be some sort of checking we can do to prevent this.
Recognized flags:
[system]
UI_CLICKED
UI_HOVER
UI_SELECTED
UI_DISABLED
UI_INACTIVE
UI_SQUEEZE
UI_VERTICAL
|
Activate the sublist (if any) of currently selected item.
|
|
Callback function to handle updating the selection.
Reimplemented from CUI_ListBox. |
|
overloaded render overloaded from CUI_ListBox because it has to deal with items, which are of a different type in CUI_Menu Reimplemented from CUI_ListBox. |
|
Select Next item.
|
|
Select Previous item.
|
|
Intercept flag handling to detect de-selection. deactive any submenus when this menu is deselected Reimplemented from CUI_Frame. |
|
update view update the placement of items and the overall view of the control Reimplemented from CUI_ListBox. |