| 1 | unit FormTargets;
|
|---|
| 2 |
|
|---|
| 3 | interface
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 6 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
|
|---|
| 7 | Menus, ActnList;
|
|---|
| 8 |
|
|---|
| 9 | type
|
|---|
| 10 |
|
|---|
| 11 | { TFormTargets }
|
|---|
| 12 |
|
|---|
| 13 | TFormTargets = class(TForm)
|
|---|
| 14 | ATargetOptions: TAction;
|
|---|
| 15 | ActionList1: TActionList;
|
|---|
| 16 | ListView1: TListView;
|
|---|
| 17 | PopupMenu1: TPopupMenu;
|
|---|
| 18 | procedure ATargetOptionsExecute(Sender: TObject);
|
|---|
| 19 | procedure FormShow(Sender: TObject);
|
|---|
| 20 | procedure ListView1Data(Sender: TObject; Item: TListItem);
|
|---|
| 21 | private
|
|---|
| 22 | { private declarations }
|
|---|
| 23 | public
|
|---|
| 24 | procedure ReloadList;
|
|---|
| 25 | end;
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 | implementation
|
|---|
| 29 |
|
|---|
| 30 | {$R *.lfm}
|
|---|
| 31 |
|
|---|
| 32 | uses
|
|---|
| 33 | Core, FormMain, Compiler, Producer, Target, FormTargetOptions;
|
|---|
| 34 |
|
|---|
| 35 | resourcestring
|
|---|
| 36 | SCompilerOptions = 'Compiler options';
|
|---|
| 37 | SCompilerPath = 'Compiler path';
|
|---|
| 38 |
|
|---|
| 39 | { TFormTargets }
|
|---|
| 40 |
|
|---|
| 41 | procedure TFormTargets.FormShow(Sender: TObject);
|
|---|
| 42 | begin
|
|---|
| 43 | ReloadList;
|
|---|
| 44 | end;
|
|---|
| 45 |
|
|---|
| 46 | procedure TFormTargets.ATargetOptionsExecute(Sender: TObject);
|
|---|
| 47 | var
|
|---|
| 48 | FormTargetOptions: TFormTargetOptions;
|
|---|
| 49 | begin
|
|---|
| 50 | if Assigned(ListView1.Selected) then begin
|
|---|
| 51 | FormTargetOptions := TFormTargetOptions.Create(nil);
|
|---|
| 52 | FormTargetOptions.LoadControls(TTarget(ListView1.Selected.Data));
|
|---|
| 53 | if FormTargetOptions.ShowModal = mrOk then begin
|
|---|
| 54 | FormTargetOptions.SaveControls(TTarget(ListView1.Selected.Data));
|
|---|
| 55 | ReloadList;
|
|---|
| 56 | end;
|
|---|
| 57 | FormTargetOptions.Free;
|
|---|
| 58 | end;
|
|---|
| 59 | end;
|
|---|
| 60 |
|
|---|
| 61 | procedure TFormTargets.ListView1Data(Sender: TObject; Item: TListItem);
|
|---|
| 62 | begin
|
|---|
| 63 | if (Item.Index >= 0) and (Item.Index < Core.Core.Compiler.Targets.Count) then
|
|---|
| 64 | with TTarget(Core.Core.Compiler.Targets[Item.Index]) do begin
|
|---|
| 65 | Item.Caption := Name;
|
|---|
| 66 | Item.Data := Core.Core.Compiler.Targets[Item.Index];
|
|---|
| 67 | //Item.SubItems.Add(Producer.CompilerPath);
|
|---|
| 68 | end;
|
|---|
| 69 | end;
|
|---|
| 70 |
|
|---|
| 71 | procedure TFormTargets.ReloadList;
|
|---|
| 72 | begin
|
|---|
| 73 | ListView1.Items.Count := Core.Core.Compiler.Targets.Count;
|
|---|
| 74 | ListView1.Refresh;
|
|---|
| 75 | end;
|
|---|
| 76 |
|
|---|
| 77 | end.
|
|---|
| 78 |
|
|---|