1 | unit FormMain;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
|
---|
7 | ExtCtrls, Menus, Cpu, Machine, Assembler, FormMessages, FormAssembler;
|
---|
8 |
|
---|
9 | type
|
---|
10 |
|
---|
11 | { TFormMain }
|
---|
12 |
|
---|
13 | TFormMain = class(TForm)
|
---|
14 | ButtonLoad: TButton;
|
---|
15 | ButtonStart: TButton;
|
---|
16 | ButtonStop: TButton;
|
---|
17 | MainMenu1: TMainMenu;
|
---|
18 | MenuItem1: TMenuItem;
|
---|
19 | MenuItem10: TMenuItem;
|
---|
20 | MenuItem11: TMenuItem;
|
---|
21 | MenuItem12: TMenuItem;
|
---|
22 | MenuItem14: TMenuItem;
|
---|
23 | MenuItem15: TMenuItem;
|
---|
24 | MenuItem16: TMenuItem;
|
---|
25 | MenuItem17: TMenuItem;
|
---|
26 | MenuItem19: TMenuItem;
|
---|
27 | MenuItem2: TMenuItem;
|
---|
28 | MenuItem3: TMenuItem;
|
---|
29 | MenuItem4: TMenuItem;
|
---|
30 | MenuItem5: TMenuItem;
|
---|
31 | MenuItem6: TMenuItem;
|
---|
32 | MenuItem7: TMenuItem;
|
---|
33 | MenuItem8: TMenuItem;
|
---|
34 | MenuItem9: TMenuItem;
|
---|
35 | PanelCenter: TPanel;
|
---|
36 | PanelBottom: TPanel;
|
---|
37 | Splitter1: TSplitter;
|
---|
38 | procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
---|
39 | procedure FormCreate(Sender: TObject);
|
---|
40 | procedure FormDestroy(Sender: TObject);
|
---|
41 | procedure FormShow(Sender: TObject);
|
---|
42 | private
|
---|
43 | public
|
---|
44 | FormMessages: TFormMessages;
|
---|
45 | FormAssembler: TFormAssembler;
|
---|
46 | procedure DockForm(Form: TForm; DockSite: TWinControl);
|
---|
47 | procedure DockInit;
|
---|
48 | end;
|
---|
49 |
|
---|
50 |
|
---|
51 | implementation
|
---|
52 |
|
---|
53 | {$R *.lfm}
|
---|
54 |
|
---|
55 | { TFormMain }
|
---|
56 |
|
---|
57 | procedure TFormMain.FormCreate(Sender: TObject);
|
---|
58 | begin
|
---|
59 | FormMessages := TFormMessages.Create(nil);
|
---|
60 | FormAssembler := TFormAssembler.Create(nil);
|
---|
61 | FormMessages.OnSelect := FormAssembler.Select;
|
---|
62 | end;
|
---|
63 |
|
---|
64 | procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
---|
65 | begin
|
---|
66 | Application.Terminate;
|
---|
67 | end;
|
---|
68 |
|
---|
69 | procedure TFormMain.FormDestroy(Sender: TObject);
|
---|
70 | begin
|
---|
71 | FreeAndNil(FormAssembler);
|
---|
72 | FreeAndNil(FormMessages);
|
---|
73 | end;
|
---|
74 |
|
---|
75 | procedure TFormMain.FormShow(Sender: TObject);
|
---|
76 | begin
|
---|
77 | DockInit;
|
---|
78 | FormAssembler.SynEdit1.Lines.LoadFromFile('Sample.asm');
|
---|
79 | end;
|
---|
80 |
|
---|
81 | procedure TFormMain.DockForm(Form: TForm; DockSite: TWinControl);
|
---|
82 | begin
|
---|
83 | Form.ManualDock(DockSite, nil, alClient);
|
---|
84 | Form.Align := alClient;
|
---|
85 | Form.Show;
|
---|
86 | end;
|
---|
87 |
|
---|
88 | procedure TFormMain.DockInit;
|
---|
89 | begin
|
---|
90 | DockForm(FormAssembler, PanelCenter);
|
---|
91 | DockForm(FormMessages, PanelBottom);
|
---|
92 | PanelBottom.Height := Height div 5;
|
---|
93 | end;
|
---|
94 |
|
---|
95 | end.
|
---|
96 |
|
---|