source: trunk/Packages/Common/Forms/FormTest.pas

Last change on this file was 219, checked in by chronos, 5 days ago
  • Modified: Updated Common package.
  • Modified: Remove U prefix from unit names.
  • Modified: Use Gneeric.Collections instead of fgl.
  • Modified: Do not use global form variables.
File size: 950 bytes
Line 
1unit FormTest;
2
3interface
4
5uses
6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, FormEx,
7 TestCase;
8
9type
10
11 { TFormTest }
12
13 TFormTest = class(TFormEx)
14 ButtonRun: TButton;
15 ButtonClose: TButton;
16 MemoLog: TMemo;
17 procedure FormShow(Sender: TObject);
18 procedure ButtonRunClick(Sender: TObject);
19 private
20 FTestCase: TTestCase;
21 procedure SetTestCase(AValue: TTestCase);
22 public
23 property TestCase: TTestCase read FTestCase write SetTestCase;
24 end;
25
26
27implementation
28
29{$R *.lfm}
30
31{ TFormTest }
32
33procedure TFormTest.FormShow(Sender: TObject);
34begin
35 if Assigned(FTestCase) then MemoLog.Text := FTestCase.Log;
36end;
37
38procedure TFormTest.SetTestCase(AValue: TTestCase);
39begin
40 if FTestCase = AValue then Exit;
41 FTestCase := AValue;
42end;
43
44procedure TFormTest.ButtonRunClick(Sender: TObject);
45begin
46 if Assigned(FTestCase) then begin
47 FTestCase.Run;
48 MemoLog.Text := FTestCase.Log;
49 end;
50end;
51
52end.
53
Note: See TracBrowser for help on using the repository browser.