10 RUNFLAG_CHILDDRAWONLY,
11 RUNFLAG_CHILDDRAWUPDATEONLY,
14 RUNFLAG_CLIPPED, // used to distinguish between intentionally hidden and casaully hidden
22 RUNFLAG_SPAWNED // set after the spawn function has been called
26 typedef bool(float,float) keyEvent;
27 typedef void(bool,bool) selectEvent;
42 //.entity _history; // used to set up the history -> selectdown prefers _history over _parent
46 .entity _next, _prev; // point to the next, respectively, the previous item
48 .entity _child; // points to the first child
51 .float orderPos; // if FLAG_NOSELECT or FLAG_HIDDEN is set, it cant be selected
52 // has to be set always to a correct value or to 0 then it is set
63 .vector _cache_origin;
64 .vector _cache_clip_pos;
65 .vector _cache_clip_size;
68 .event init; // called once at object creation
77 .keyEvent key; // if it returns TRUE, the key was processed by the function
79 // hidden function pointers - actually these are called by the manager
80 // and they call the normal ones (used to make controls more generic
81 .event _reinit; // called in performreinit
82 .event _destroy; // called when the item is removed -> menu_removeitem
94 // default control functions - assign only to the _* event functions
95 // (assigning to the 'normal' event functions will crash the vm !)
96 // are used by ITEM_CUSTOM and can be used to test new ITEMs easily
99 bool( float pKey, float pAscii ) DefCt_Key;
101 void() DefCt_MouseEnter;
102 void() DefCt_MouseLeave;
104 void( bool pSelect, bool pUser ) DefCt_Select;
106 // use this to raise an event from another item or function
107 void( entity pEntity ) Raise_Reinit;
108 void( entity pEntity ) Raise_Destroy;
109 bool( entity pEntity, float pKey, float pAscii) Raise_Key;
110 void( entity pEntity ) Raise_Draw;
111 void( entity pEntity ) Raise_MouseEnter;
112 void( entity pEntity ) Raise_MouseLeave;
113 void( entity pEntity ) Raise_Update;
114 void( entity pEntity, bool pSelect, bool pUser ) Raise_Select;
116 // safe call the event control functions (only used by the mcontrols function)
118 void() CtCall_Reinit;
119 void() CtCall_Destroy;
120 bool( float pKey, float pAscii) CtCall_Key;
122 void() CtCall_MouseEnter;
123 void() CtCall_MouseLeave;
124 void() CtCall_Action;
125 void() CtCall_Update;
126 void( bool pSelect, bool pUser ) CtCall_Select;