cleaned all trailing white space from source files.
[sdk] / samples / guiAndGfx / clock / clock.ec
1 import "ecere"
2
3 class Form1 : Window
4 {
5    background = 0;
6    opacity = 0;
7    font = { "Arial", 40 };
8    size = { 320, 60 };
9    //displayDriver = "OpenGL";
10    moveable = true;
11    alphaBlend = true;
12    stayOnTop = true;
13    showInTaskBar = false;
14
15    Timer timer
16    {
17       userData = this, started = true, delay = 0.2;
18
19       bool DelayExpired()
20       {
21          Update(null);
22          return true;
23       }
24    };
25
26    bool OnLeftButtonDown(int x, int y, Modifiers mods)
27    {
28       MenuWindowMove(null, mods);
29       return true;
30    }
31    bool OnKeyDown(Key key, unichar ch)
32    {
33       if(key == escape) Destroy(0);
34       return true;
35    }
36
37    void OnRedraw(Surface surface)
38    {
39       DateTime time;
40       surface.Clear(colorBuffer);
41       time.GetLocalTime();
42       surface.SetForeground({ 128, darkGray });
43       surface.WriteTextf(0,0, "%02d:%02d:%02d",
44          time.hour, time.minute, time.second);
45       surface.SetForeground({ 192, teal });
46       surface.WriteTextf(2, 2, "%02d:%02d:%02d",
47          time.hour, time.minute, time.second);
48
49    }
50 }
51
52 Form1 form1 { };