-#ifndef ITEM_H
-#define ITEM_H
-#include "skin.qh"
-#include "oo/base.qh"
-CLASS(Item, Object)
- METHOD(Item, draw, void(entity));
- METHOD(Item, keyDown, float(entity, float, float, float));
- METHOD(Item, keyUp, float(entity, float, float, float));
- METHOD(Item, mouseMove, float(entity, vector));
- METHOD(Item, mousePress, float(entity, vector));
- METHOD(Item, mouseDrag, float(entity, vector));
- METHOD(Item, mouseRelease, float(entity, vector));
- METHOD(Item, focusEnter, void(entity));
- METHOD(Item, focusLeave, void(entity));
- METHOD(Item, resizeNotify, void(entity, vector, vector, vector, vector));
- METHOD(Item, relinquishFocus, void(entity));
- METHOD(Item, showNotify, void(entity));
- METHOD(Item, hideNotify, void(entity));
- METHOD(Item, toString, string(entity));
- METHOD(Item, destroy, void(entity));
- ATTRIB(Item, focused, float, 0)
- ATTRIB(Item, focusable, float, 0)
- ATTRIB(Item, allowFocusSound, float, 0)
- ATTRIB(Item, parent, entity, NULL)
- ATTRIB(Item, preferredFocusPriority, float, 0)
- ATTRIB(Item, origin, vector, '0 0 0')
- ATTRIB(Item, size, vector, '0 0 0')
- ATTRIB(Item, tooltip, string, string_null)
-ENDCLASS(Item)
-#endif
-
-#ifdef IMPLEMENTATION
-void Item_destroy(entity me)
-{
- // free memory associated with me
-}
-
-void Item_relinquishFocus(entity me)
-{
- if(me.parent)
- if(me.parent.instanceOfContainer)
- me.parent.setFocus(me.parent, NULL);
-}
-
-void Item_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
-{
- me.origin = absOrigin;
- me.size = absSize;
-}
-
-float autocvar_menu_showboxes;
-void Item_draw(entity me)
-{
- if(autocvar_menu_showboxes)
+#include "item.qh"
+
+#include "item/container.qh"
+#include "item/borderimage.qh"
+
+ METHOD(MenuItem, destroy, void(MenuItem this))
+ {
+ // free memory associated with this
+ }
+
+ METHOD(MenuItem, relinquishFocus, void(MenuItem this))
+ {
+ entity par = this.parent;
+ if (!par) return;
+ if (par.instanceOfContainer) par.setFocus(par, NULL);
+ }
+
+ METHOD(MenuItem, resizeNotify, void(MenuItem this, vector relOrigin, vector relSize, vector absOrigin, vector absSize))
+ {
+ this.origin = absOrigin;
+ this.size = absSize;
+ }
+
+ int autocvar_menu_showboxes;
+ METHOD(MenuItem, draw, void(MenuItem this))