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

    r74 r75  
    1 unit UFormTargetProject;
    2 
    3 {$mode delphi}
     1unit FormTargetProject;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   UProject;
     6  Classes, SysUtils, LazFileUtils, Forms, Controls, Graphics, Dialogs, ComCtrls,
     7  Project;
    108
    119type
     10  TShowTargetCodeEvent = procedure(ProjectFile: TProjectFile) of object;
    1211
    1312  { TFormTargetProject }
     
    1716    procedure TreeViewProjectChange(Sender: TObject; Node: TTreeNode);
    1817  private
    19     procedure UpdateProjectFiles(Node: TTreeNode; Files: TProjectFileList);
     18    FOnShowTargetCode: TShowTargetCodeEvent;
     19    procedure UpdateProjectFiles(Node: TTreeNode; Files: TProjectFiles);
    2020    procedure UpdateProjectTree;
    2121  public
    2222    procedure UpdateInterface;
     23    property OnShowTargetCode: TShowTargetCodeEvent read FOnShowTargetCode
     24      write FOnShowTargetCode;
    2325  end;
    24 
    25 var
    26   FormTargetProject: TFormTargetProject;
    2726
    2827
     
    3231
    3332uses
    34   UCore, UFormMain, UFormTargetCode;
     33  Core, FormMain, FormTargetCode;
    3534
    3635procedure TFormTargetProject.UpdateProjectTree;
     
    3837  NewNode: TTreeNode;
    3938begin
    40   with Core, FormMain, TreeViewProject, Items do begin
     39  with Core.Core, FormMain.FormMain, TreeViewProject, Items do begin
    4140    BeginUpdate;
    4241    Clear;
     
    5049      (TreeViewProject.TopItem.Count > 0) then
    5150      TreeViewProject.TopItem.Items[0].Selected := True
    52       else FormTargetCode.ProjectFile := nil;
     51      else begin
     52        if Assigned(FOnShowTargetCode) then
     53          FOnShowTargetCode(nil);
     54      end;
    5355  end;
    5456end;
     
    6264  Node: TTreeNode);
    6365begin
    64   with FormMain, FormTargetCode do
     66  with FormMain.FormMain do
    6567  if Assigned(Node) then begin
    6668    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))
    7071    end;
    7172  end;
    7273end;
    7374
    74 procedure TFormTargetProject.UpdateProjectFiles(Node: TTreeNode; Files: TProjectFileList);
     75procedure TFormTargetProject.UpdateProjectFiles(Node: TTreeNode; Files: TProjectFiles);
    7576var
    7677  I: Integer;
Note: See TracChangeset for help on using the changeset viewer.