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/FormMessages.pas

    r74 r75  
    1 unit UFormMessages;
    2 
    3 {$mode objfpc}{$H+}
     1unit FormMessages;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, UProject, UCompiler;
     7  ComCtrls, Project, Compiler;
    108
    119type
     10  TSelectFileEvent = procedure(FileName: string; Position: TPoint);
    1211
    1312  { TFormMessages }
     
    1514  TFormMessages = class(TForm)
    1615    ListView1: TListView;
    17     procedure ListBoxMessagesSelectionChange(Sender: TObject; User: boolean);
     16    procedure ListBoxMessagesSelectionChange(Sender: TObject; User: Boolean);
    1817    procedure ListView1Click(Sender: TObject);
    1918    procedure ListView1Data(Sender: TObject; Item: TListItem);
     
    2120      Selected: Boolean);
    2221  private
    23     { private declarations }
     22    FOnSelectFile: TSelectFileEvent;
    2423  public
    2524    procedure Reload;
     25    property OnSelectFile: TSelectFileEvent read FOnSelectFile write FOnSelectFile;
    2626  end;
    2727
    28 var
    29   FormMessages: TFormMessages;
    3028
    3129implementation
     
    3432
    3533uses
    36   UCore, UFormMain, UFormSourceCode;
     34  Core, FormMain, FormSourceCode;
    3735
    3836{ TFormMessages }
    3937
    4038procedure TFormMessages.ListBoxMessagesSelectionChange(Sender: TObject;
    41   User: boolean);
     39  User: Boolean);
    4240begin
    43 
    4441end;
    4542
     
    5249procedure TFormMessages.ListView1Data(Sender: TObject; Item: TListItem);
    5350begin
    54   with Core, FormMain, FormSourceCode do
     51  with Core.Core, FormMain.FormMain do
    5552  with TErrorMessage(Compiler.ErrorMessages[Item.Index]) do begin
    5653    if FileName = '' then Item.Caption := ' '
     
    6865  P: TPoint;
    6966begin
    70   with Core, FormSourceCode do
     67  with Core.Core do
    7168  if Assigned(ListView1.Selected) then
    7269  with TErrorMessage(ListView1.Selected.Data) do
    7370  if FileName <> '' then begin
    74     ProjectFile := Project.Files.SearchFile(FileName);
    75     if Assigned(ProjectFile) then
    76       SynEditSource.Lines.Assign(ProjectFile.Source)
    77       else if FileExists(FileName) then
    78         SynEditSource.Lines.LoadFromFile(FileName);
    79     SynEditSource.CaretXY := Position;
    80     TForm(SynEditSource.Owner).Show;
    81     SynEditSource.SetFocus;
     71    if Assigned(FOnSelectFile) then
     72      FOnSelectFile(FileName, Position);
    8273  end;
    8374end;
     
    8576procedure TFormMessages.Reload;
    8677begin
    87   ListView1.Items.Count := Core.Compiler.ErrorMessages.Count;
     78  ListView1.Items.Count := Core.Core.Compiler.ErrorMessages.Count;
    8879  ListView1.Refresh;
    8980end;
Note: See TracChangeset for help on using the changeset viewer.