ecere/gui/Window: Prevent uninitialized values if base Window methods not overridden...
[sdk] / samples / games / chess / src / connect.ec
1 import "chess.ec"
2
3 #ifndef CHESS_NONET
4 class ConnectDialog : Window
5 {
6    minClientSize = Size { 300, 100 };
7    tabCycle = true, background = activeBorder, hasClose = true, caption = "Connect to server";
8
9    Button ok
10    {
11       parent = this, bevel = true, isDefault = true, caption = "OK",
12       size = Size { w = 80 }, anchor = Anchor { horz = -48, bottom = 10 };
13
14       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
15       {
16          ((Chess)master).Connect(address.line.text);
17          Destroy(0);
18          return true;
19       }
20    };
21
22    Button cancel
23    {
24       parent = this, bevel = true, caption = "Cancel", size = Size { w = 80 }, hotKey = escape;
25       anchor = Anchor { horz = 48, bottom = 10 };
26
27       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
28       {
29          Destroy(0);
30          return false;
31       }
32    };
33
34    EditBox address
35    {
36       parent = this, textHorzScroll = true, size = Size { w = 200 }, anchor = Anchor { top = 10 },
37       line.text = "localhost"
38    };
39 }
40 #endif