Ignore:
Timestamp:
Jun 4, 2024, 12:22:49 AM (5 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from unit names.
  • Modified: Updated Common package.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/IDE/Forms/FormSourceCode.pas

    r74 r75  
    1 unit UFormSourceCode;
    2 
    3 {$mode objfpc}{$H+}
     1unit FormSourceCode;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
    9   SynEdit, SynHighlighterPas, UProject;
     7  SynEdit, SynHighlighterPas, Project;
    108
    119type
     
    2422    procedure Save;
    2523    procedure UpdateInterface;
     24    procedure SelectFile(FileName: string; Position: TPoint);
    2625  end;
    2726
    28 var
    29   FormSourceCode: TFormSourceCode;
    3027
    3128implementation
    3229
    3330uses
    34   UFormMain, UCore;
     31  FormMain, Core;
    3532
    3633{$R *.lfm}
     
    4138begin
    4239  Save;
    43   if Assigned(Core.Project) and Assigned(ProjectFile) then
     40  if Assigned(Core.Core.Project) and Assigned(ProjectFile) then
    4441    ProjectFile.Modified := True;
    4542end;
     
    6259procedure TFormSourceCode.UpdateInterface;
    6360begin
    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;
     63end;
     64
     65procedure TFormSourceCode.SelectFile(FileName: string; Position: TPoint);
     66var
     67  ProjectFile: TProjectFile;
     68begin
     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;
    6679end;
    6780
Note: See TracChangeset for help on using the changeset viewer.