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...", 8, 0.5);
35 dlg.addItem(dlg, i, '0 0.3 0', '1 0.1 0', 1);
37 i = spawnRadioButton();
38 i.configureRadioButton(i, "RadioButton1", 12, "qcsrc/menu-div0test/baseradiobutton", 1, 0);
39 dlg.addItem(dlg, i, '0.1 0.4 0', '0.4 0.1 0', 1);
41 i = spawnRadioButton();
42 i.configureRadioButton(i, "RadioButton2", 12, "qcsrc/menu-div0test/baseradiobutton", 1, 1);
43 dlg.addItem(dlg, i, '0.5 0.4 0', '0.8 0.1 0', 1);
46 i.configureCheckBox(i, "Do not show this dialog again", 12, "qcsrc/menu-div0test/basecheckbox");
48 dlg.addItem(dlg, i, '0.1 0.5 0', '0.8 0.1 0', 1);
51 i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton");
52 i.onClick = DialogCloseButton_Click; i.onClickEntity = dlg;
53 dlg.addItem(dlg, i, '0.3 0.7 0', '0.4 0.2 0', 1);
54 me.addItem(me, dlg, '0.2 0.3 0', '0.6 0.4 0', 1);
57 i.configureImage(i, "gfx/0.tga");
58 n.addItem(n, i, '0.4 0.45 0', '0.2 0.1 0', 1);
59 n.setNexposee(n, i, '0.5 0.5 0', 0.2, 0.5);
61 c = spawnInputContainer();
64 i.configureImage(i, "gfx/0.tga");
65 c.addItem(c, i, '0 0 0', '1 1 0', 1);
67 mc = spawnModalController();
69 b.configureButton(b, "1!", 12, "qcsrc/menu-div0test/basebutton");
70 c.addItem(c, b, '0 0 0', '0.2 0.2 0', 1);
72 i.configureButton(i, "Do not press this button!", 12, "qcsrc/menu-div0test/basebutton"); // click n gently with a chainsaw
73 i.onClick = DemoButton_Click; i.onClickEntity = dlg;
78 b.configureButton(b, "2!", 12, "qcsrc/menu-div0test/basebutton");
79 c.addItem(c, b, '0.2 0 0', '0.2 0.2 0', 1);
81 i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton"); // click n plenty
82 i.onClick = ExposeeCloseButton_Click; i.onClickEntity = n;
87 b.configureButton(b, "3!", 12, "qcsrc/menu-div0test/basebutton");
88 c.addItem(c, b, '0.4 0 0', '0.2 0.2 0', 1);
90 i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton"); // click n plenty
91 i.onClick = ExposeeCloseButton_Click; i.onClickEntity = n;
94 c.addItem(c, mc, '0 0.2 0', '1 0.8 0', 1);
96 n.addItem(n, c, '0.03 0.06 0', '0.9 0.9 0', 0.5);
97 n.setNexposee(n, c, '0.1 0.2 0', 0.2, 0.5);
100 i.configureImage(i, "gfx/2.tga");
101 n.addItem(n, i, '0.04 0.01 0', '0.9 0.9 0', 1);
102 n.setNexposee(n, i, '0.95 0.8 0', 0.2, 0.5);
105 i.configureImage(i, "gfx/3.tga");
106 n.addItem(n, i, '0.02 0.03 0', '0.9 0.9 0', 1);
107 n.setNexposee(n, i, '0.99 0.1 0', 0.2, 0.5);
110 i.configureImage(i, "gfx/4.tga");
111 n.addItem(n, i, '0.01 0.09 0', '0.9 0.9 0', 1);
112 n.setNexposee(n, i, '0.1 0.9 0', 0.2, 0.5);
114 me.initializeDialog(me, n);
118 // click. The C-word so you can grep for it.