4 entity Menu_ActiveWindow;
6 // points to the lowest selected menu item (that has no child item selected)
7 entity Menu_ActiveItem;
13 // help if you need to iterate through embedded items, too
14 entity( entity pItem ) _Menu_GetParent;
15 entity( entity pItem ) _Menu_GetFirst;
16 entity( entity pItem ) _Menu_GetLast;
17 entity( entity pItem ) _Menu_GetNext;
18 entity( entity pItem ) _Menu_GetPrev;
19 bool( entity pItem, entity pParent ) _Menu_IsEmbeddedParentOf;
21 // INFO: SelectUp/Down rules:
23 // INFO: 1. try to select a selectable item
24 // INFO: 2. try to select a subwindow
26 // INFO: 1. try to select the parent
27 // INFO: 2. select down the parent
28 // INFO: 3. select up the parent
31 void() _Menu_SelectNext;
32 void() _Menu_SelectPrev;
33 bool() _Menu_SelectUp;
34 bool() _Menu_SelectDown;
35 void() _Menu_Reselect;
37 void( bool pUser ) Menu_SelectNext;
38 void( bool pUser ) Menu_SelectPrev;
39 bool( bool pUser ) Menu_SelectUp;
40 bool( bool pUser ) Menu_SelectDown;
41 void( bool pUser ) Menu_Reselect;
43 void( entity pItem, bool pUser ) Menu_Select;
44 void( entity pMenu, bool pMakeActive, bool pUser ) Menu_JumpToWindow;
46 bool( entity pEntity ) Menu_HasEvents;
49 bool( entity pEntity ) Menu_IsVisible;
50 bool( entity pEntity ) Menu_IsSelectable;
51 bool( entity pEntity ) Menu_IsTemplate;
52 bool( entity pEntity ) Menu_IsEmbedded;
54 bool( entity pEntity, float pFlag ) Menu_HasFlag;
55 bool( entity pEntity, float pRunFlag ) Menu_HasRunFlag;
57 #define Menu_IsVisible(pEntity) (!((pEntity)._runFlag & (RUNFLAG_HIDDEN | RUNFLAG_CLIPPED)))
58 #define Menu_IsSelectable(pEntity) (!((pEntity)._runFlag & RUNFLAG_NOSELECT))
59 #define Menu_IsTemplate(pEntity) ((pEntity)._runFlag & RUNFLAG_TEMPLATE)
60 #define Menu_IsEmbedded(pEntity) ((pEntity).flag & FLAG_EMBEDDED)
62 #define Menu_HasFlag(pEntity,pFlag) ((pEntity).flag & (pFlag))
63 #define Menu_HasRunFlag(pEntity,pRunFlag) ((pEntity)._runFlag & (pRunFlag))
66 void( entity pEntity ) Menu_SetRunFlag;
67 void( entity pParent, entity pEntity ) Menu_InheritRunFlag;
69 void() Menu_UpdateRunFlags;
71 void( entity pWindow ) Menu_EmptyWindow;
72 void( entity pEntity ) Menu_RemoveItem;
74 entity( entity pOrigin, string pName, bool pThrow ) Menu_GetItemEx;
75 entity( entity pOrigin, string pName, bool pThrow ) Menu_GetChildEx;
77 entity( string pName ) Menu_GetItem; // pOrigin = self
78 entity( string pName ) Menu_GetChild;
81 string( entity pItem ) Menu_GetName; // gets the name without the parent namespace
83 #define Menu_GetName(pItem) (substring( (pItem) .name, strlen( (pItem) .parent ) + 2, 100000 ))