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 | |
---|
1 | unit AppTest;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Api, DateUtils;
|
---|
7 |
|
---|
8 | type
|
---|
9 |
|
---|
10 | { TAppTest }
|
---|
11 |
|
---|
12 | TAppTest = class(TApp)
|
---|
13 | procedure Run(Context: TAppContext); override;
|
---|
14 | constructor Create; override;
|
---|
15 | end;
|
---|
16 |
|
---|
17 |
|
---|
18 | implementation
|
---|
19 |
|
---|
20 | { TAppTest }
|
---|
21 |
|
---|
22 | procedure TAppTest.Run(Context: TAppContext);
|
---|
23 | var
|
---|
24 | Handle: THandle;
|
---|
25 | begin
|
---|
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;
|
---|
40 | end;
|
---|
41 |
|
---|
42 | constructor TAppTest.Create;
|
---|
43 | begin
|
---|
44 | Name := 'Test';
|
---|
45 | end;
|
---|
46 |
|
---|
47 | end.
|
---|
48 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.