1 | unit TestApplication;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Vcl.Graphics, Xvcl.Controls, Xvcl.Classes, Xvcl.Forms, LDOS.Kernel, SysUtils;
|
---|
7 |
|
---|
8 | type
|
---|
9 | TTestApplication = class(TApplication)
|
---|
10 | Form1: TForm;
|
---|
11 | Form2: TForm;
|
---|
12 | Button: TButton;
|
---|
13 | Label1: TLabel;
|
---|
14 | Edit1: TEdit;
|
---|
15 | Timer1: TTimer;
|
---|
16 | procedure Run; override;
|
---|
17 | procedure ButtonClick(Sender: TObject);
|
---|
18 | end;
|
---|
19 |
|
---|
20 |
|
---|
21 | implementation
|
---|
22 |
|
---|
23 | { TTestApplication }
|
---|
24 |
|
---|
25 | procedure TTestApplication.ButtonClick(Sender: TObject);
|
---|
26 | begin
|
---|
27 | Button.Caption := 'Clicked';
|
---|
28 | Label1.Caption := IntToStr(StrToInt(Label1.Caption) + 1);
|
---|
29 | end;
|
---|
30 |
|
---|
31 | procedure TTestApplication.Run;
|
---|
32 | begin
|
---|
33 | Caption := 'TestApp';
|
---|
34 | Form1 := TForm.Create;
|
---|
35 | Form1.Owner := Self;
|
---|
36 | Form1.Bounds := TRectangle.Create(50, 80, 200, 120);
|
---|
37 | Form1.Name := 'Form1';
|
---|
38 | Form1.Caption := 'Test application';
|
---|
39 | Form1.Screen := Screen;
|
---|
40 | Form1.Application := Self;
|
---|
41 | Form2 := TForm.Create;
|
---|
42 | Form2.Owner := Self;
|
---|
43 | Form2.Bounds := TRectangle.Create(350, 150, 200, 150);
|
---|
44 | Form2.Name := 'Form2';
|
---|
45 | Form2.Caption := 'Some form';
|
---|
46 | Form2.Screen := Screen;
|
---|
47 | Form2.Application := Self;
|
---|
48 | Timer1 := TTimer.Create;
|
---|
49 | Timer1.Interval := 1000;
|
---|
50 | Timer1.Enabled := True;
|
---|
51 | TScreen(Screen).Kernel.Timers.Add(Timer1);
|
---|
52 | Button := TButton.Create;
|
---|
53 | Button.Parent := Form1;
|
---|
54 | Button.Owner := Form1;
|
---|
55 | Button.Bounds := TRectangle.Create(50, 50, 60, 24);
|
---|
56 | Button.Visible := True;
|
---|
57 | Button.Caption := 'Start';
|
---|
58 | Button.OnClick := ButtonClick;
|
---|
59 | Label1 := TLabel.Create;
|
---|
60 | Label1.Parent := Form1;
|
---|
61 | Label1.Owner := Form1;
|
---|
62 | Label1.Bounds := TRectangle.Create(60, 80, 60, 24);
|
---|
63 | Label1.Visible := True;
|
---|
64 | Label1.Caption := '0';
|
---|
65 | Edit1 := TEdit.Create;
|
---|
66 | Edit1.Parent := Form2;
|
---|
67 | Edit1.Owner := Form2;
|
---|
68 | Edit1.Bounds := TRectangle.Create(60, 80, 60, 24);
|
---|
69 | Edit1.Visible := True;
|
---|
70 | Edit1.Text := 'Text';
|
---|
71 | MainForm := Form1;
|
---|
72 | TScreen(Screen).Forms.Add(Form1);
|
---|
73 | TScreen(Screen).Forms.Add(Form2);
|
---|
74 | TScreen(Screen).Paint;
|
---|
75 | end;
|
---|
76 |
|
---|
77 | end.
|
---|
78 |
|
---|