4 #include "../item/listbox.qc"
5 CLASS(XonoticListBox, ListBox)
6 METHOD(XonoticListBox, configureXonoticListBox, void(entity));
7 ATTRIB(XonoticListBox, fontSize, float, SKINFONTSIZE_NORMAL)
8 ATTRIB(XonoticListBox, scrollbarWidth, float, SKINWIDTH_SCROLLBAR)
9 ATTRIB(XonoticListBox, src, string, SKINGFX_SCROLLBAR)
10 ATTRIB(XonoticListBox, tolerance, vector, SKINTOLERANCE_SLIDER)
11 ATTRIB(XonoticListBox, rowsPerItem, float, 1)
12 METHOD(XonoticListBox, resizeNotify, void(entity, vector, vector, vector, vector));
13 ATTRIB(XonoticListBox, color, vector, SKINCOLOR_SCROLLBAR_N)
14 ATTRIB(XonoticListBox, colorF, vector, SKINCOLOR_SCROLLBAR_F)
15 ATTRIB(XonoticListBox, color2, vector, SKINCOLOR_SCROLLBAR_S)
16 ATTRIB(XonoticListBox, colorC, vector, SKINCOLOR_SCROLLBAR_C)
17 ATTRIB(XonoticListBox, colorBG, vector, SKINCOLOR_LISTBOX_BACKGROUND)
18 ATTRIB(XonoticListBox, alphaBG, float, SKINALPHA_LISTBOX_BACKGROUND)
19 ENDCLASS(XonoticListBox)
20 entity makeXonoticListBox();
24 entity makeXonoticListBox()
27 me = NEW(XonoticListBox);
28 me.configureXonoticListBox(me);
31 void XonoticListBox_configureXonoticListBox(entity me)
33 me.configureListBox(me, me.scrollbarWidth, 1); // item height gets set up later
35 void XonoticListBox_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
37 me.itemHeight = me.rowsPerItem * me.fontSize / absSize.y;
38 SUPER(XonoticListBox).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);