]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu/nexuiz/listbox.c
the usual (forgot two files)
[divverent/nexuiz.git] / data / qcsrc / menu / nexuiz / listbox.c
1 #ifdef INTERFACE
2 CLASS(NexuizListBox) EXTENDS(ListBox)
3         METHOD(NexuizListBox, configureNexuizListBox, void(entity))
4         ATTRIB(NexuizListBox, fontSize, float, SKINFONTSIZE_NORMAL)
5         ATTRIB(NexuizListBox, scrollbarWidth, float, SKINWIDTH_SCROLLBAR)
6         ATTRIB(NexuizListBox, src, string, SKINGFX_SCROLLBAR)
7         ATTRIB(NexuizListBox, tolerance, vector, SKINTOLERANCE_SLIDER)
8         ATTRIB(NexuizListBox, rowsPerItem, float, 1)
9         METHOD(NexuizListBox, resizeNotify, void(entity, vector, vector, vector, vector))
10         ATTRIB(NexuizListBox, color, vector, SKINCOLOR_SCROLLBAR_N)
11         ATTRIB(NexuizListBox, colorF, vector, SKINCOLOR_SCROLLBAR_F)
12         ATTRIB(NexuizListBox, color2, vector, SKINCOLOR_SCROLLBAR_S)
13         ATTRIB(NexuizListBox, colorC, vector, SKINCOLOR_SCROLLBAR_C)
14 ENDCLASS(NexuizListBox)
15 entity makeNexuizListBox();
16 #endif
17
18 #ifdef IMPLEMENTATION
19 entity makeNexuizListBox()
20 {
21         entity me;
22         me = spawnNexuizListBox();
23         me.configureNexuizListBox(me);
24         return me;
25 }
26 void configureNexuizListBoxNexuizListBox(entity me)
27 {
28         me.configureListBox(me, me.scrollbarWidth, 1); // item height gets set up later
29 }
30 void resizeNotifyNexuizListBox(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
31 {
32         me.itemHeight = me.rowsPerItem * me.fontSize / absSize_y;
33         resizeNotifyListBox(me, relOrigin, relSize, absOrigin, absSize);
34 }
35 #endif