]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/scrollpanel.qh
Merge branch 'master' into DefaultUser/func_button_relay
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / scrollpanel.qh
1 #pragma once
2
3 #include "listbox.qh"
4 #include "tab.qh"
5 CLASS(XonoticScrollPanel, XonoticListBox)
6         /** container for single child panel */
7         ATTRIB(XonoticScrollPanel, currentPanel, entity, NEW(XonoticTab));
8         ATTRIB(XonoticScrollPanel, nItems, int, 1);
9         ATTRIB(XonoticScrollPanel, selectionDoesntMatter, bool, true);
10         ATTRIB(XonoticScrollPanel, itemHeight, float, 1);
11         /** number of rows to show at once */
12         ATTRIB(XonoticScrollPanel, viewportHeight, float, 12);
13         ATTRIB(XonoticScrollPanel, alphaBG, float, 0);
14
15         METHOD(XonoticScrollPanel, getItemAtPos, float(XonoticScrollPanel this, float pos)) { return 0; }
16         METHOD(XonoticScrollPanel, getItemHeight, float(XonoticScrollPanel this, int i)) { return this.itemHeight; }
17         METHOD(XonoticScrollPanel, getItemStart, float(XonoticScrollPanel this, int i)) { return 0; }
18         METHOD(XonoticScrollPanel, getTotalHeight, float(XonoticScrollPanel this)) { return this.itemHeight; }
19         METHOD(XonoticScrollPanel, setFocus, void(XonoticScrollPanel this, entity other)) { Container_setFocus(this, other); }
20         METHOD(XonoticScrollPanel, setSelected, void(XonoticScrollPanel this, int i)) { }
21
22         METHOD(XonoticScrollPanel, drawListBoxItem, void(XonoticScrollPanel this, int i, vector absSize, bool isSelected, bool isFocused));
23         METHOD(XonoticScrollPanel, resizeNotify, void(XonoticScrollPanel this, vector relOrigin, vector relSize, vector absOrigin, vector absSize));
24 ENDCLASS(XonoticScrollPanel)