source: branches/Independent/Apps/Test/AppTest.pas

Last change on this file was 67, checked in by chronos, 3 weeks ago
  • Modified: Apps split into separate units.
  • Modified: SystemApi moved into separate unit.
File size: 818 bytes
Line 
1unit AppTest;
2
3interface
4
5uses
6 Classes, SysUtils, Api, DateUtils;
7
8type
9
10 { TAppTest }
11
12 TAppTest = class(TApp)
13 procedure Run(Context: TAppContext); override;
14 constructor Create; override;
15 end;
16
17
18implementation
19
20{ TAppTest }
21
22procedure TAppTest.Run(Context: TAppContext);
23var
24 Handle: THandle;
25begin
26 with Context.Api do begin
27 WriteLine('Hello World!');
28 Sleep(OneSecond);
29 RunApp('Code');
30 Handle := CreateWindow;
31 SetWindowName(Handle, 'New window');
32 SetWindowRect(Handle, Bounds(100, 100, 400, 200));
33 SetWindowVisible(Handle, True);
34
35 Handle := CreateWindow;
36 SetWindowName(Handle, 'Second window');
37 SetWindowRect(Handle, Bounds(350, 150, 500, 300));
38 SetWindowVisible(Handle, True);
39 end;
40end;
41
42constructor TAppTest.Create;
43begin
44 Name := 'Test';
45end;
46
47end.
48
Note: See TracBrowser for help on using the repository browser.