Changeset 92 for trunk/Forms/UFormTargets.pas
- Timestamp:
- Jul 20, 2018, 9:48:47 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormTargets.pas
r51 r92 10 10 type 11 11 12 { TForm Compilers }12 { TFormTargets } 13 13 14 TForm Compilers = class(TForm)14 TFormTargets = class(TForm) 15 15 ListView1: TListView; 16 16 procedure FormShow(Sender: TObject); 17 17 procedure ListView1Data(Sender: TObject; Item: TListItem); 18 18 procedure ListView1DblClick(Sender: TObject); 19 procedure ListView1KeyPress(Sender: TObject; var Key: char); 19 20 private 20 21 { private declarations } … … 24 25 25 26 var 26 Form Compilers: TFormCompilers;27 FormTargets: TFormTargets; 27 28 28 29 implementation … … 33 34 UCore, UTarget, UFormTargetOptions; 34 35 35 { TForm Compilers }36 { TFormTargets } 36 37 37 procedure TForm Compilers.FormShow(Sender: TObject);38 procedure TFormTargets.FormShow(Sender: TObject); 38 39 begin 39 40 ReloadList; 40 41 end; 41 42 42 procedure TForm Compilers.ListView1Data(Sender: TObject; Item: TListItem);43 procedure TFormTargets.ListView1Data(Sender: TObject; Item: TListItem); 43 44 begin 44 45 if (Item.Index >= 0) and (Item.Index < Core.Targets.Count) then … … 51 52 end; 52 53 53 procedure TForm Compilers.ListView1DblClick(Sender: TObject);54 procedure TFormTargets.ListView1DblClick(Sender: TObject); 54 55 begin 55 FormTargetOptions.LoadControls(TTarget(ListView1.Selected.Data)); 56 if FormTargetOptions.ShowModal = mrOk then begin 57 FormTargetOptions.SaveControls(TTarget(ListView1.Selected.Data)); 58 ReloadList; 56 FormTargetOptions := TFormTargetOptions.Create(nil); 57 try 58 FormTargetOptions.LoadControls(TTarget(ListView1.Selected.Data)); 59 if FormTargetOptions.ShowModal = mrOk then begin 60 FormTargetOptions.SaveControls(TTarget(ListView1.Selected.Data)); 61 ReloadList; 62 end; 63 finally 64 FormTargetOptions.Free; 59 65 end; 60 66 end; 61 67 62 procedure TFormCompilers.ReloadList; 68 procedure TFormTargets.ListView1KeyPress(Sender: TObject; var Key: char); 69 begin 70 if Key = #13 then ListView1DblClick(nil); 71 end; 72 73 procedure TFormTargets.ReloadList; 63 74 begin 64 75 ListView1.Items.Count := Core.Targets.Count;
Note:
See TracChangeset
for help on using the changeset viewer.