1 #include "scrollpanel.qh"
3 METHOD(XonoticScrollPanel, drawListBoxItem, void(XonoticScrollPanel this, int i, vector absSize, bool isSelected, bool isFocused))
5 XonoticTab p = this.currentPanel;
9 METHOD(XonoticScrollPanel, resizeNotify, void(XonoticScrollPanel this, vector relOrigin, vector relSize, vector absOrigin, vector absSize))
11 SUPER(XonoticScrollPanel).resizeNotify(this, relOrigin, relSize, absOrigin, absSize);
12 this.scrollToItem(this, 0);
13 XonoticTab p = this.currentPanel;
14 float m = p.firstChild.rows / this.viewportHeight;
18 p.resizeNotify(p, relOrigin, relSize, absOrigin, absSize);
21 #define X(mouseFunc) \
22 METHOD(XonoticScrollPanel, mouseFunc, bool(XonoticScrollPanel this, vector pos)) \
24 SUPER(XonoticScrollPanel).mouseFunc(this, pos); \
25 XonoticTab p = this.currentPanel; \
26 this.setFocus(this, p); \
28 vector o = -eY * this.scrollPos; \
29 vector s = eX * (1 - this.controlWidth) + eY * this.itemHeight; \
30 return p.mouseFunc(p, globalToBox(pos, o, s)); \
39 METHOD(XonoticScrollPanel, keyFunc, bool(XonoticScrollPanel this, int key, int ascii, bool shift)) \
41 XonoticTab p = this.currentPanel; \
42 return p.keyFunc(p, key, ascii, shift) || SUPER(XonoticScrollPanel).keyFunc(this, key, ascii, shift); \