5 METHOD(Item, draw, void(Item));
6 METHOD(Item, keyDown, float(Item, float, float, float));
7 METHOD(Item, keyUp, float(Item, float, float, float));
8 METHOD(Item, mouseMove, float(Item, vector));
9 METHOD(Item, mousePress, float(Item, vector));
10 METHOD(Item, mouseDrag, float(Item, vector));
11 METHOD(Item, mouseRelease, float(Item, vector));
12 METHOD(Item, focusEnter, void(Item));
13 METHOD(Item, focusLeave, void(Item));
14 METHOD(Item, resizeNotify, void(Item, vector, vector, vector, vector));
15 METHOD(Item, relinquishFocus, void(Item));
16 METHOD(Item, showNotify, void(Item));
17 METHOD(Item, hideNotify, void(Item));
18 METHOD(Item, toString, string(Item));
19 METHOD(Item, destroy, void(Item));
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 METHOD(Item, destroy, void(Item this))
34 // free memory associated with this
37 METHOD(Item, relinquishFocus, void(Item this))
39 entity par = this.parent;
41 if (par.instanceOfContainer) par.setFocus(par, NULL);
44 METHOD(Item, resizeNotify, void(Item this, vector relOrigin, vector relSize, vector absOrigin, vector absSize))
46 this.origin = absOrigin;
50 int autocvar_menu_showboxes;
51 METHOD(Item, draw, void(Item this))
53 if (!autocvar_menu_showboxes) return;
55 float a = fabs(autocvar_menu_showboxes);
57 // don't draw containers and border images
58 if (this.instanceOfContainer || this.instanceOfBorderImage)
65 // hack to detect multi drawing
66 float r = random() * 3;
67 if (r >= 2) rgb = '1 0 0';
68 else if (r >= 1) rgb = '0 1 0';
71 if (autocvar_menu_showboxes < 0)
73 draw_Fill('0 0 0', '0.5 0.5 0', rgb, a);
74 draw_Fill('0.5 0.5 0', '0.5 0.5 0', rgb, a);
76 else if (autocvar_menu_showboxes > 0)
78 draw_Fill('0 0 0', '1 1 0', rgb, a);
82 METHOD(Item, showNotify, void(Item this))
85 METHOD(Item, hideNotify, void(Item this))
88 METHOD(Item, keyDown, float(Item this, float scan, float ascii, float shift))
90 return 0; // unhandled
93 METHOD(Item, keyUp, float(Item this, float scan, float ascii, float shift))
95 return 0; // unhandled
98 METHOD(Item, mouseMove, float(Item this, vector pos))
100 return 0; // unhandled
103 METHOD(Item, mousePress, float(Item this, vector pos))
105 return 0; // unhandled
108 METHOD(Item, mouseDrag, float(Item this, vector pos))
110 return 0; // unhandled
113 METHOD(Item, mouseRelease, float(Item this, vector pos))
115 return 0; // unhandled
118 METHOD(Item, focusEnter, void(Item this))
120 if (this.allowFocusSound) m_play_focus_sound();
123 METHOD(Item, focusLeave, void(Item this))
126 METHOD(Item, toString, string(Item this))