]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu/nexuiz/tabcontroller.c
menu-div0test -> menu
[divverent/nexuiz.git] / data / qcsrc / menu / nexuiz / tabcontroller.c
1 #ifdef INTERFACE
2 CLASS(NexuizTabController) EXTENDS(ModalController)
3         METHOD(NexuizTabController, configureNexuizTabController, void(entity, float))
4         METHOD(NexuizTabController, makeTabButton, entity(entity, string, entity))
5         ATTRIB(NexuizTabController, rows, float, 0)
6         ATTRIB(NexuizTabController, fontSize, float, SKINFONTSIZE_NORMAL)
7         ATTRIB(NexuizTabController, image, string, SKINGFX_BUTTON)
8 ENDCLASS(NexuizTabController)
9 entity makeNexuizTabController(float theRows);
10 #endif
11
12 #ifdef IMPLEMENTATION
13 entity makeNexuizTabController(float theRows)
14 {
15         entity me;
16         me = spawnNexuizTabController();
17         me.configureNexuizTabController(me, theRows);
18         return me;
19 }
20 void configureNexuizTabControllerNexuizTabController(entity me, float theRows)
21 {
22         me.rows = theRows;
23 }
24 entity makeTabButtonNexuizTabController(entity me, string theTitle, entity tab)
25 {
26         entity b;
27         if(me.rows != tab.rows)
28                 error("Tab dialog height mismatch!");
29         b = spawnButton();
30         b.configureButton(b, theTitle, me.fontSize, me.image);
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