2 CLASS(MainWindow) EXTENDS(ModalController)
3 METHOD(MainWindow, configureMainWindow, void(entity))
9 void DemoButton_Click(entity me, entity other)
11 if(me.text == "Do not press this button again!")
12 DialogOpenButton_Click(me, other);
14 me.setText(me, "Do not press this button again!");
17 void configureMainWindowMainWindow(entity me)
19 entity dlg, n, i, b, c, mc, t1, t2, t3;
22 me.addItem(me, n, '0 0 0', '1 1 0', 1);
24 dlg = spawnInputContainer();
26 i.configureImage(i, "gfx/4.tga");
27 dlg.addItem(dlg, i, '0 0 0', '1 1 0', 1);
30 i.configureLabel(i, "I told you...", 24, 0.5);
31 dlg.addItem(dlg, i, '0 0 0', '1 0.2 0', 1);
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);
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);
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);
48 c = spawnInputContainer();
51 i.configureImage(i, "gfx/0.tga");
52 c.addItem(c, i, '0 0 0', '1 1 0', 1);
54 mc = spawnModalController();
56 b.configureButton(b, "1!", 12, "qcsrc/menu-div0test/basebutton");
57 c.addItem(c, b, '0 0 0', '0.2 0.2 0', 1);
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;
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);
68 i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton"); // click n plenty
69 i.onClick = ExposeeCloseButton_Click; i.onClickEntity = n;
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);
77 i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton"); // click n plenty
78 i.onClick = ExposeeCloseButton_Click; i.onClickEntity = n;
81 c.addItem(c, mc, '0 0.2 0', '1 0.8 0', 1);
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);
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);
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);
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);
101 me.initializeDialog(me, n);
105 // click. The C-word so you can grep for it.