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, cb;
22 me.addItem(me, n, '0 0 0', '1 1 0', 1);
24 dlg = spawnInputContainer();
26 cb.configureButton(cb, "", 12, "qcsrc/menu-div0test/baseclosebutton");
27 cb.onClick = DialogCloseButton_Click; cb.onClickEntity = dlg;
30 i = spawnBorderImage();
31 i.configureBorderImage(i, "I told you...", 18, '0.5 0.5 1', "qcsrc/menu-div0test/baseborder", 1.5);
33 dlg.addItem(dlg, i, '0 0 0', '1 1 0', 1);
36 i.configureLabel(i, "Swim swim hungry, swim swim hungry...", 8, 0.5);
37 dlg.addItem(dlg, i, '0 0.3 0', '1 0.1 0', 1);
39 i = spawnRadioButton();
40 i.configureRadioButton(i, "RadioButton1", 12, "qcsrc/menu-div0test/baseradiobutton", 1, 0);
41 dlg.addItem(dlg, i, '0.1 0.4 0', '0.4 0.1 0', 1);
43 i = spawnRadioButton();
44 i.configureRadioButton(i, "RadioButton2", 12, "qcsrc/menu-div0test/baseradiobutton", 1, 1);
45 dlg.addItem(dlg, i, '0.5 0.4 0', '0.8 0.1 0', 1);
48 i.configureCheckBox(i, "Do not show this dialog again", 12, "qcsrc/menu-div0test/basecheckbox");
50 dlg.addItem(dlg, i, '0.1 0.5 0', '0.8 0.1 0', 1);
53 i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton");
54 i.onClick = DialogCloseButton_Click; i.onClickEntity = dlg;
55 dlg.addItem(dlg, i, '0.3 0.7 0', '0.4 0.2 0', 1);
57 dlg.addItem(dlg, cb, '0.3 0.7 0', '0.4 0.2 0', 1);
58 me.addItem(me, dlg, '0.2 0.3 0', '0.6 0.4 0', 1);
61 i.configureImage(i, "gfx/0.tga");
62 n.addItem(n, i, '0.4 0.45 0', '0.2 0.1 0', 1);
63 n.setNexposee(n, i, '0.5 0.5 0', 0.2, 0.5);
65 c = spawnInputContainer();
68 i.configureImage(i, "gfx/0.tga");
69 c.addItem(c, i, '0 0 0', '1 1 0', 1);
71 mc = spawnModalController();
73 b.configureButton(b, "1!", 12, "qcsrc/menu-div0test/basebutton");
74 c.addItem(c, b, '0 0 0', '0.2 0.2 0', 1);
76 i.configureButton(i, "Do not press this button!", 12, "qcsrc/menu-div0test/basebutton"); // click n gently with a chainsaw
77 i.onClick = DemoButton_Click; i.onClickEntity = dlg;
82 b.configureButton(b, "2!", 12, "qcsrc/menu-div0test/basebutton");
83 c.addItem(c, b, '0.2 0 0', '0.2 0.2 0', 1);
85 i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton"); // click n plenty
86 i.onClick = ExposeeCloseButton_Click; i.onClickEntity = n;
91 b.configureButton(b, "3!", 12, "qcsrc/menu-div0test/basebutton");
92 c.addItem(c, b, '0.4 0 0', '0.2 0.2 0', 1);
94 i.configureButton(i, "Close", 12, "qcsrc/menu-div0test/basebutton"); // click n plenty
95 i.onClick = ExposeeCloseButton_Click; i.onClickEntity = n;
98 c.addItem(c, mc, '0 0.2 0', '1 0.8 0', 1);
100 n.addItem(n, c, '0.03 0.06 0', '0.9 0.9 0', 0.5);
101 n.setNexposee(n, c, '0.1 0.2 0', 0.2, 0.5);
104 i.configureImage(i, "gfx/2.tga");
105 n.addItem(n, i, '0.04 0.01 0', '0.9 0.9 0', 1);
106 n.setNexposee(n, i, '0.95 0.8 0', 0.2, 0.5);
109 i.configureImage(i, "gfx/3.tga");
110 n.addItem(n, i, '0.02 0.03 0', '0.9 0.9 0', 1);
111 n.setNexposee(n, i, '0.99 0.1 0', 0.2, 0.5);
114 i.configureImage(i, "gfx/4.tga");
115 n.addItem(n, i, '0.01 0.09 0', '0.9 0.9 0', 1);
116 n.setNexposee(n, i, '0.1 0.9 0', 0.2, 0.5);
118 me.initializeDialog(me, n);
122 // click. The C-word so you can grep for it.