wip II
[sdk] / samples / guiAndGfx / childWindows / ex1.ec
1 import "ecere"
2
3 class Child : Window
4 {
5    background = Color { 200,150,0 };
6    size = Size { 300, 200 };
7    borderStyle = sizable;
8    text = "Sizable";
9    
10    Button
11    {
12       this, text = "Push Me", position = { 100, 20 }, size = { 80, 30 };
13       bool NotifyClicked(Button button, int x, int y, Modifiers mods) { Destroy(0); return true; }
14    };
15    ScrollBar { this, direction = vertical, anchor = { left = 0, top = 0, bottom = 0 }, size = Size { 48 } };
16    EditBox { this, position = { 50, 80 }, size = { 200, 50 }, foreground = red };
17 }
18
19 class Parent : Window
20 {
21    borderStyle = sizable;
22    hasMaximize = true, hasMinimize = true, hasClose = true;
23    text = "Hello, Ex1!";
24    position = { 10, 10 };
25    size = { 1000, 600 };
26    hasMenuBar = true;
27
28    BitmapResource bubbles { ":SoapBubbles.bmp", window = this, transparent = false };
29
30    void OnRedraw(Surface surface)
31    {
32       int c;
33       for(c = 0; c < 4; c ++)
34          printf("hey");
35       surface.Tile(bubbles.bitmap, 0,0,clientSize.w,clientSize.h);
36    }
37
38    Child { this, position = { 100, 100 }, size.h = 150 };
39    Child { this, borderStyle = contour, text = "Contour", position = { 200, 300 }, size.w = 500 };
40    Child { this, borderStyle = fixed, text = "Fixed", position = { 500, 60 }; };
41 }
42
43 Parent parent { };