|
Last change
on this file was 16, checked in by george, 17 years ago |
- Přidáno: Další pokusný projekt překladače.
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | unit UMainForm;
|
|---|
| 2 |
|
|---|
| 3 | interface
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|---|
| 7 | Dialogs, StdCtrls, ComCtrls;
|
|---|
| 8 |
|
|---|
| 9 | type
|
|---|
| 10 | TForm1 = class(TForm)
|
|---|
| 11 | RichEdit1: TRichEdit;
|
|---|
| 12 | TreeView1: TTreeView;
|
|---|
| 13 | procedure FormShow(Sender: TObject);
|
|---|
| 14 | procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|---|
| 15 | procedure RichEdit1KeyUp(Sender: TObject; var Key: Word;
|
|---|
| 16 | Shift: TShiftState);
|
|---|
| 17 | private
|
|---|
| 18 | { Private declarations }
|
|---|
| 19 | public
|
|---|
| 20 | SourceCode: TStrings;
|
|---|
| 21 | end;
|
|---|
| 22 |
|
|---|
| 23 | var
|
|---|
| 24 | Form1: TForm1;
|
|---|
| 25 |
|
|---|
| 26 | implementation
|
|---|
| 27 |
|
|---|
| 28 | uses
|
|---|
| 29 | USyntaxHighLight;
|
|---|
| 30 |
|
|---|
| 31 | {$R *.dfm}
|
|---|
| 32 |
|
|---|
| 33 | procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
|
|---|
| 34 | var
|
|---|
| 35 | StringList: TStringList;
|
|---|
| 36 | begin
|
|---|
| 37 | with TStringList.Create do try
|
|---|
| 38 | Assign(RichEdit1.Lines);
|
|---|
| 39 | SaveToFile('Example.pas');
|
|---|
| 40 | finally
|
|---|
| 41 | Free;
|
|---|
| 42 | end;
|
|---|
| 43 | end;
|
|---|
| 44 |
|
|---|
| 45 | procedure TForm1.FormShow(Sender: TObject);
|
|---|
| 46 | begin
|
|---|
| 47 | try
|
|---|
| 48 | RichEdit1.Lines.LoadFromFile('Example.pas');
|
|---|
| 49 | ProcessHighlight(RichEdit1);
|
|---|
| 50 | except
|
|---|
| 51 | end;
|
|---|
| 52 | end;
|
|---|
| 53 |
|
|---|
| 54 | procedure TForm1.RichEdit1KeyUp(Sender: TObject; var Key: Word;
|
|---|
| 55 | Shift: TShiftState);
|
|---|
| 56 | begin
|
|---|
| 57 | ProcessHighlight(RichEdit1);
|
|---|
| 58 | end;
|
|---|
| 59 |
|
|---|
| 60 | end.
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.