]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu-div0test/nexuiz/mainwindow.c
adding qcsrc/menu-div0test with a test menu.dat source... may or may not replace...
[divverent/nexuiz.git] / data / qcsrc / menu-div0test / nexuiz / mainwindow.c
1 #ifdef INTERFACE
2 CLASS(MainWindow) EXTENDS(ModalController)
3         METHOD(MainWindow, configureMainWindow, void(entity))
4 ENDCLASS(MainWindow)
5 #endif
6
7 #ifdef IMPLEMENTATION
8
9 void DemoButton_Click(entity me, entity other)
10 {
11         if(me.text == "Do not press this button again!")
12                 DialogOpenButton_Click(me, other);
13         else
14                 me.setText(me, "Do not press this button again!");
15 }
16
17 void configureMainWindowMainWindow(entity me)
18 {
19         entity dlg, n, i, b, c, mc, t1, t2, t3;
20
21         n = spawnNexposee();
22         me.addItem(me, n, '0 0 0', '1 1 0', 1);
23
24         dlg = spawnInputContainer();
25                 i = spawnImage();
26                 i.configureImage(i, "gfx/4.tga");
27                 dlg.addItem(dlg, i, '0 0 0', '1 1 0', 1);
28
29                 i = spawnLabel();
30                 i.configureLabel(i, "I told you...", 24, 0.5);
31                 dlg.addItem(dlg, i, '0 0 0', '1 0.2 0', 1);
32
33                 i = spawnLabel();
34                 i.configureLabel(i, "Swim swim hungry, swim swim hungry...", 12, 0.5);
35                 dlg.addItem(dlg, i, '0 0.3 0', '1 0.2 0', 1);
36
37                 i = spawnButton();
38                 i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton");
39                 i.onClick = DialogCloseButton_Click; i.onClickEntity = dlg;
40                 dlg.addItem(dlg, i, '0.3 0.6 0', '0.4 0.3 0', 1);
41         me.addItem(me, dlg, '0.2 0.3 0', '0.6 0.4 0', 1);
42         
43         i = spawnImage();
44         i.configureImage(i, "gfx/0.tga");
45         n.addItem(n, i, '0.4 0.45 0', '0.2 0.1 0', 1);
46         n.setNexposee(n, i, '0.5 0.5 0', 0.2, 0.5);
47         
48         c = spawnInputContainer();
49
50                 i = spawnImage();
51                 i.configureImage(i, "gfx/0.tga");
52                 c.addItem(c, i, '0 0 0', '1 1 0', 1);
53
54                 mc = spawnModalController();
55                         b = spawnButton();
56                         b.configureButton(b, "1!", 12, "qcsrc/menu-div0test/basebutton");
57                         c.addItem(c, b, '0 0 0', '0.2 0.2 0', 1);
58                         i = spawnButton();
59                         i.configureButton(i, "Do not press this button!", 12, "qcsrc/menu-div0test/basebutton"); // click n gently with a chainsaw
60                                 i.onClick = DemoButton_Click; i.onClickEntity = dlg;
61                         mc.addTab(mc, i, b);
62                         t1 = i;
63
64                         b = spawnButton();
65                         b.configureButton(b, "2!", 12, "qcsrc/menu-div0test/basebutton");
66                         c.addItem(c, b, '0.2 0 0', '0.2 0.2 0', 1);
67                         i = spawnButton();
68                         i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton"); // click n plenty
69                                 i.onClick = ExposeeCloseButton_Click; i.onClickEntity = n;
70                         mc.addTab(mc, i, b);
71                         t2 = i;
72
73                         b = spawnButton();
74                         b.configureButton(b, "3!", 12, "qcsrc/menu-div0test/basebutton");
75                         c.addItem(c, b, '0.4 0 0', '0.2 0.2 0', 1);
76                         i = spawnButton();
77                         i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton"); // click n plenty
78                                 i.onClick = ExposeeCloseButton_Click; i.onClickEntity = n;
79                         mc.addTab(mc, i, b);
80                         t3 = i;
81                 c.addItem(c, mc, '0 0.2 0', '1 0.8 0', 1);
82
83         n.addItem(n, c, '0.03 0.06 0', '0.9 0.9 0', 0.5);
84         n.setNexposee(n, c, '0.1 0.2 0', 0.2, 0.5);
85         
86         i = spawnImage();
87         i.configureImage(i, "gfx/2.tga");
88         n.addItem(n, i, '0.04 0.01 0', '0.9 0.9 0', 1);
89         n.setNexposee(n, i, '0.95 0.8 0', 0.2, 0.5);
90         
91         i = spawnImage();
92         i.configureImage(i, "gfx/3.tga");
93         n.addItem(n, i, '0.02 0.03 0', '0.9 0.9 0', 1);
94         n.setNexposee(n, i, '0.99 0.1 0', 0.2, 0.5);
95         
96         i = spawnImage();
97         i.configureImage(i, "gfx/4.tga");
98         n.addItem(n, i, '0.01 0.09 0', '0.9 0.9 0', 1);
99         n.setNexposee(n, i, '0.1 0.9 0', 0.2, 0.5);
100
101         me.initializeDialog(me, n);
102 }
103 #endif
104
105 // click. The C-word so you can grep for it.