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 // INFO:Should only be used inside of _select event functions and only (only!) when
44 // absolutely necessary since this is more or less a hack
45 void( entity pItem, bool pUser ) Menu_CorrectSelection;
47 void( entity pItem, bool pUser ) Menu_Select;
48 void( entity pMenu, bool pMakeActive, bool pUser ) Menu_JumpToWindow;
50 bool( entity pEntity ) Menu_HasEvents;
53 bool( entity pEntity ) Menu_IsVisible;
54 bool( entity pEntity ) Menu_IsSelectable;
55 bool( entity pEntity ) Menu_IsTemplate;
56 bool( entity pEntity ) Menu_IsEmbedded;
58 bool( entity pEntity, float pFlag ) Menu_HasFlag;
59 bool( entity pEntity, float pRunFlag ) Menu_HasRunFlag;
61 #define Menu_IsVisible(pEntity) (!((pEntity)._runFlag & (RUNFLAG_HIDDEN | RUNFLAG_CLIPPED)))
62 #define Menu_IsSelectable(pEntity) (!((pEntity)._runFlag & RUNFLAG_NOSELECT))
63 #define Menu_IsTemplate(pEntity) ((pEntity)._runFlag & RUNFLAG_TEMPLATE)
64 #define Menu_IsEmbedded(pEntity) ((pEntity).flag & FLAG_EMBEDDED)
66 #define Menu_HasFlag(pEntity,pFlag) ((pEntity).flag & (pFlag))
67 #define Menu_HasRunFlag(pEntity,pRunFlag) ((pEntity)._runFlag & (pRunFlag))
70 void( entity pEntity ) Menu_SetRunFlag;
71 void( entity pParent, entity pEntity ) Menu_InheritRunFlag;
73 void() Menu_UpdateRunFlags;
75 void( entity pWindow ) Menu_EmptyWindow;
76 void( entity pEntity ) Menu_RemoveItem;
78 entity( entity pOrigin, string pName, bool pThrow ) Menu_GetItemEx;
79 entity( entity pOrigin, string pName, bool pThrow ) Menu_GetChildEx;
81 entity( string pName ) Menu_GetItem; // pOrigin = self
82 entity( string pName ) Menu_GetChild;
85 string( entity pItem ) Menu_GetName; // gets the name without the parent namespace
87 #define Menu_GetName(pItem) (substring( (pItem) .name, strlen( (pItem) .parent ) + 2, 100000 ))