]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/tabcontroller.qc
Sort menu classes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / tabcontroller.qc
1 #ifndef TABCONTROLLER_H
2 #define TABCONTROLLER_H
3 CLASS(XonoticTabController, ModalController)
4         METHOD(XonoticTabController, configureXonoticTabController, void(entity, float))
5         METHOD(XonoticTabController, makeTabButton, entity(entity, string, entity))
6         ATTRIB(XonoticTabController, rows, float, 0)
7         ATTRIB(XonoticTabController, fontSize, float, SKINFONTSIZE_NORMAL)
8         ATTRIB(XonoticTabController, image, string, SKINGFX_BUTTON)
9 ENDCLASS(XonoticTabController)
10 entity makeXonoticTabController(float theRows);
11 #endif
12
13 #ifdef IMPLEMENTATION
14 entity makeXonoticTabController(float theRows)
15 {
16         entity me;
17         me = NEW(XonoticTabController);
18         me.configureXonoticTabController(me, theRows);
19         return me;
20 }
21 void XonoticTabController_configureXonoticTabController(entity me, float theRows)
22 {
23         me.rows = theRows;
24 }
25 entity XonoticTabController_makeTabButton(entity me, string theTitle, entity tab)
26 {
27         entity b;
28         if(me.rows != tab.rows)
29                 error("Tab dialog height mismatch!");
30         b = makeXonoticButton(theTitle, '0 0 0');
31                 me.addTab(me, tab, b);
32         // TODO make this real tab buttons (with color parameters, and different gfx)
33         return b;
34 }
35 #endif