5 METHOD(Item, draw, void(entity));
6 METHOD(Item, keyDown, float(entity, float, float, float));
7 METHOD(Item, keyUp, float(entity, float, float, float));
8 METHOD(Item, mouseMove, float(entity, vector));
9 METHOD(Item, mousePress, float(entity, vector));
10 METHOD(Item, mouseDrag, float(entity, vector));
11 METHOD(Item, mouseRelease, float(entity, vector));
12 METHOD(Item, focusEnter, void(entity));
13 METHOD(Item, focusLeave, void(entity));
14 METHOD(Item, resizeNotify, void(entity, vector, vector, vector, vector));
15 METHOD(Item, relinquishFocus, void(entity));
16 METHOD(Item, showNotify, void(entity));
17 METHOD(Item, hideNotify, void(entity));
18 METHOD(Item, toString, string(entity));
19 METHOD(Item, destroy, void(entity));
20 ATTRIB(Item, focused, float, 0)
21 ATTRIB(Item, focusable, float, 0)
22 ATTRIB(Item, allowFocusSound, float, 0)
23 ATTRIB(Item, parent, entity, NULL)
24 ATTRIB(Item, preferredFocusPriority, float, 0)
25 ATTRIB(Item, origin, vector, '0 0 0')
26 ATTRIB(Item, size, vector, '0 0 0')
27 ATTRIB(Item, tooltip, string, string_null)
32 void Item_destroy(entity me)
34 // free memory associated with me
37 void Item_relinquishFocus(entity me)
40 if(me.parent.instanceOfContainer)
41 me.parent.setFocus(me.parent, NULL);
44 void Item_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
46 me.origin = absOrigin;
50 float autocvar_menu_showboxes;
51 void Item_draw(entity me)
53 if(autocvar_menu_showboxes)
56 float a = fabs(autocvar_menu_showboxes);
58 // don't draw containers and border images
59 if(me.instanceOfContainer || me.instanceOfBorderImage)
66 // hack to detect multi drawing
67 float r = random() * 3;
75 if(autocvar_menu_showboxes < 0)
77 draw_Fill('0 0 0', '0.5 0.5 0', rgb, a);
78 draw_Fill('0.5 0.5 0', '0.5 0.5 0', rgb, a);
80 if(autocvar_menu_showboxes > 0)
82 draw_Fill('0 0 0', '1 1 0', rgb, a);
87 void Item_showNotify(entity me)
91 void Item_hideNotify(entity me)
95 float Item_keyDown(entity me, float scan, float ascii, float shift)
97 return 0; // unhandled
100 float Item_keyUp(entity me, float scan, float ascii, float shift)
102 return 0; // unhandled
105 float Item_mouseMove(entity me, vector pos)
107 return 0; // unhandled
110 float Item_mousePress(entity me, vector pos)
112 return 0; // unhandled
115 float Item_mouseDrag(entity me, vector pos)
117 return 0; // unhandled
120 float Item_mouseRelease(entity me, vector pos)
122 return 0; // unhandled
125 void Item_focusEnter(entity me)
127 if(me.allowFocusSound)
128 m_play_focus_sound();
131 void Item_focusLeave(entity me)
135 string Item_toString(entity me)