|
Last change
on this file was 20, checked in by chronos, 14 years ago |
- Přidáno: Počáteční návrh editoru a kompilátoru pro i8051.
|
|
File size:
1.6 KB
|
| Line | |
|---|
| 1 | unit UFormMain;
|
|---|
| 2 |
|
|---|
| 3 | {$mode objfpc}{$H+}
|
|---|
| 4 |
|
|---|
| 5 | interface
|
|---|
| 6 |
|
|---|
| 7 | uses
|
|---|
| 8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
|
|---|
| 9 | ActnList, Menus, StdCtrls, USourceCode, UProducer, UParser;
|
|---|
| 10 |
|
|---|
| 11 | type
|
|---|
| 12 | { TFormMain }
|
|---|
| 13 |
|
|---|
| 14 | TFormMain = class(TForm)
|
|---|
| 15 | ABuild: TAction;
|
|---|
| 16 | AFileNew: TAction;
|
|---|
| 17 | AFileClose: TAction;
|
|---|
| 18 | AFileSaveAs: TAction;
|
|---|
| 19 | AFileSave: TAction;
|
|---|
| 20 | AFileOpen: TAction;
|
|---|
| 21 | AExit: TAction;
|
|---|
| 22 | ActionList1: TActionList;
|
|---|
| 23 | ImageList1: TImageList;
|
|---|
| 24 | MainMenu1: TMainMenu;
|
|---|
| 25 | Memo1: TMemo;
|
|---|
| 26 | MenuItem1: TMenuItem;
|
|---|
| 27 | MenuItem10: TMenuItem;
|
|---|
| 28 | MenuItem2: TMenuItem;
|
|---|
| 29 | MenuItem3: TMenuItem;
|
|---|
| 30 | MenuItem4: TMenuItem;
|
|---|
| 31 | MenuItem5: TMenuItem;
|
|---|
| 32 | MenuItem6: TMenuItem;
|
|---|
| 33 | MenuItem7: TMenuItem;
|
|---|
| 34 | MenuItem8: TMenuItem;
|
|---|
| 35 | MenuItem9: TMenuItem;
|
|---|
| 36 | StatusBar1: TStatusBar;
|
|---|
| 37 | ToolBar1: TToolBar;
|
|---|
| 38 | ToolButton1: TToolButton;
|
|---|
| 39 | procedure ABuildExecute(Sender: TObject);
|
|---|
| 40 | procedure AExitExecute(Sender: TObject);
|
|---|
| 41 | private
|
|---|
| 42 | SourceCode: TSourceCode;
|
|---|
| 43 | Parser: TParser;
|
|---|
| 44 | Producer: TProducer;
|
|---|
| 45 | public
|
|---|
| 46 | procedure UpdateInterface;
|
|---|
| 47 | end;
|
|---|
| 48 |
|
|---|
| 49 | var
|
|---|
| 50 | FormMain: TFormMain;
|
|---|
| 51 |
|
|---|
| 52 | implementation
|
|---|
| 53 |
|
|---|
| 54 | {$R *.lfm}
|
|---|
| 55 |
|
|---|
| 56 | { TFormMain }
|
|---|
| 57 |
|
|---|
| 58 | procedure TFormMain.ABuildExecute(Sender: TObject);
|
|---|
| 59 | begin
|
|---|
| 60 | Parser.Analyze;
|
|---|
| 61 | Producer.Generate;
|
|---|
| 62 | end;
|
|---|
| 63 |
|
|---|
| 64 | procedure TFormMain.AExitExecute(Sender: TObject);
|
|---|
| 65 | begin
|
|---|
| 66 | Close;
|
|---|
| 67 | end;
|
|---|
| 68 |
|
|---|
| 69 | procedure TFormMain.UpdateInterface;
|
|---|
| 70 | begin
|
|---|
| 71 | ABuild.Enabled := Assigned(Project);
|
|---|
| 72 | AFileClose.Enabled := Assigned(Project);
|
|---|
| 73 | AFileSave.Enabled := Assigned(Project);
|
|---|
| 74 | AFileSaveAs.Enabled := Assigned(Project);
|
|---|
| 75 | end;
|
|---|
| 76 |
|
|---|
| 77 | end.
|
|---|
| 78 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.