Last change
on this file was 5, checked in by chronos, 12 months ago |
- Added: Show source tab with source text which is automatically loaded on start and saved on close.
|
File size:
1.4 KB
|
Line | |
---|
1 | unit FormMain;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
|
---|
7 | Car;
|
---|
8 |
|
---|
9 | type
|
---|
10 |
|
---|
11 | { TFormMain }
|
---|
12 |
|
---|
13 | TFormMain = class(TForm)
|
---|
14 | EditSource: TEdit;
|
---|
15 | LabelSource: TLabel;
|
---|
16 | LabelSummary: TLabel;
|
---|
17 | MemoSummary: TMemo;
|
---|
18 | MemoLog: TMemo;
|
---|
19 | MemoSource: TMemo;
|
---|
20 | PageControlSummary: TPageControl;
|
---|
21 | TabSheetSummary: TTabSheet;
|
---|
22 | TabSheetSource: TTabSheet;
|
---|
23 | TabSheetLog: TTabSheet;
|
---|
24 | procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
---|
25 | procedure FormCreate(Sender: TObject);
|
---|
26 | procedure FormDestroy(Sender: TObject);
|
---|
27 | procedure FormShow(Sender: TObject);
|
---|
28 | private
|
---|
29 | procedure Log(Text: string);
|
---|
30 | public
|
---|
31 | Summary: TSummary;
|
---|
32 | end;
|
---|
33 |
|
---|
34 | var
|
---|
35 | FormMain: TFormMain;
|
---|
36 |
|
---|
37 | implementation
|
---|
38 |
|
---|
39 | {$R *.lfm}
|
---|
40 |
|
---|
41 | { TFormMain }
|
---|
42 |
|
---|
43 | procedure TFormMain.FormShow(Sender: TObject);
|
---|
44 | begin
|
---|
45 | if FileExists(EditSource.Text) then
|
---|
46 | MemoSource.Lines.LoadFromFile(EditSource.Text);
|
---|
47 | Summary.OnLog := Log;
|
---|
48 | Summary.LoadFromStrings(MemoSource.Lines);
|
---|
49 | MemoSummary.Text := Summary.Print;
|
---|
50 | //PageControlSummary.TabIndex := 1;
|
---|
51 | end;
|
---|
52 |
|
---|
53 | procedure TFormMain.Log(Text: string);
|
---|
54 | begin
|
---|
55 | MemoLog.Lines.Add(Text);
|
---|
56 | end;
|
---|
57 |
|
---|
58 | procedure TFormMain.FormCreate(Sender: TObject);
|
---|
59 | begin
|
---|
60 | Summary := TSummary.Create;
|
---|
61 | end;
|
---|
62 |
|
---|
63 | procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
---|
64 | begin
|
---|
65 | MemoSource.Lines.SaveToFile(EditSource.Text);
|
---|
66 | end;
|
---|
67 |
|
---|
68 | procedure TFormMain.FormDestroy(Sender: TObject);
|
---|
69 | begin
|
---|
70 | FreeAndNil(Summary);
|
---|
71 | end;
|
---|
72 |
|
---|
73 | end.
|
---|
74 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.