Changeset 75 for trunk/IDE/Forms/FormTargetProject.pas
- Timestamp:
- Jun 4, 2024, 12:22:49 AM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Forms/FormTargetProject.pas
r74 r75 1 unit UFormTargetProject; 2 3 {$mode delphi} 1 unit FormTargetProject; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,9 UProject;6 Classes, SysUtils, LazFileUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, 7 Project; 10 8 11 9 type 10 TShowTargetCodeEvent = procedure(ProjectFile: TProjectFile) of object; 12 11 13 12 { TFormTargetProject } … … 17 16 procedure TreeViewProjectChange(Sender: TObject; Node: TTreeNode); 18 17 private 19 procedure UpdateProjectFiles(Node: TTreeNode; Files: TProjectFileList); 18 FOnShowTargetCode: TShowTargetCodeEvent; 19 procedure UpdateProjectFiles(Node: TTreeNode; Files: TProjectFiles); 20 20 procedure UpdateProjectTree; 21 21 public 22 22 procedure UpdateInterface; 23 property OnShowTargetCode: TShowTargetCodeEvent read FOnShowTargetCode 24 write FOnShowTargetCode; 23 25 end; 24 25 var26 FormTargetProject: TFormTargetProject;27 26 28 27 … … 32 31 33 32 uses 34 UCore, UFormMain, UFormTargetCode;33 Core, FormMain, FormTargetCode; 35 34 36 35 procedure TFormTargetProject.UpdateProjectTree; … … 38 37 NewNode: TTreeNode; 39 38 begin 40 with Core ,FormMain, TreeViewProject, Items do begin39 with Core.Core, FormMain.FormMain, TreeViewProject, Items do begin 41 40 BeginUpdate; 42 41 Clear; … … 50 49 (TreeViewProject.TopItem.Count > 0) then 51 50 TreeViewProject.TopItem.Items[0].Selected := True 52 else FormTargetCode.ProjectFile := nil; 51 else begin 52 if Assigned(FOnShowTargetCode) then 53 FOnShowTargetCode(nil); 54 end; 53 55 end; 54 56 end; … … 62 64 Node: TTreeNode); 63 65 begin 64 with FormMain , FormTargetCodedo66 with FormMain.FormMain do 65 67 if Assigned(Node) then begin 66 68 if TProjectFile(Node.Data) is TProjectFile then begin 67 ProjectFile := TProjectFile(Node.Data); 68 FormMain.TabSheetTarget.Show; 69 SynEdit1.Lines.Assign(TProjectFile(Node.Data).Source); 69 if Assigned(FOnShowTargetCode) then 70 FOnShowTargetCode(TProjectFile(Node.Data)) 70 71 end; 71 72 end; 72 73 end; 73 74 74 procedure TFormTargetProject.UpdateProjectFiles(Node: TTreeNode; Files: TProjectFile List);75 procedure TFormTargetProject.UpdateProjectFiles(Node: TTreeNode; Files: TProjectFiles); 75 76 var 76 77 I: Integer;
Note:
See TracChangeset
for help on using the changeset viewer.