Changeset 75 for trunk/IDE/Forms/FormSourceCode.pas
- Timestamp:
- Jun 4, 2024, 12:22:49 AM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Forms/FormSourceCode.pas
r74 r75 1 unit UFormSourceCode; 2 3 {$mode objfpc}{$H+} 1 unit FormSourceCode; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, 9 SynEdit, SynHighlighterPas, UProject;7 SynEdit, SynHighlighterPas, Project; 10 8 11 9 type … … 24 22 procedure Save; 25 23 procedure UpdateInterface; 24 procedure SelectFile(FileName: string; Position: TPoint); 26 25 end; 27 26 28 var29 FormSourceCode: TFormSourceCode;30 27 31 28 implementation 32 29 33 30 uses 34 UFormMain, UCore;31 FormMain, Core; 35 32 36 33 {$R *.lfm} … … 41 38 begin 42 39 Save; 43 if Assigned(Core. Project) and Assigned(ProjectFile) then40 if Assigned(Core.Core.Project) and Assigned(ProjectFile) then 44 41 ProjectFile.Modified := True; 45 42 end; … … 62 59 procedure TFormSourceCode.UpdateInterface; 63 60 begin 64 SynEditSource.Enabled := Assigned(Core.Project); 65 if not Assigned(Core.Project) then SynEditSource.ClearAll; 61 SynEditSource.Enabled := Assigned(Core.Core.Project); 62 if not Assigned(Core.Core.Project) then SynEditSource.ClearAll; 63 end; 64 65 procedure TFormSourceCode.SelectFile(FileName: string; Position: TPoint); 66 var 67 ProjectFile: TProjectFile; 68 begin 69 with Core.Core do begin 70 ProjectFile := Project.Files.SearchFile(FileName); 71 if Assigned(ProjectFile) then 72 SynEditSource.Lines.Assign(ProjectFile.Source) 73 else if FileExists(FileName) then 74 SynEditSource.Lines.LoadFromFile(FileName); 75 SynEditSource.CaretXY := Position; 76 TForm(SynEditSource.Owner).Show; 77 SynEditSource.SetFocus; 78 end; 66 79 end; 67 80
Note:
See TracChangeset
for help on using the changeset viewer.