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

    r74 r75  
    1 unit UFormProject;
     1unit FormProject;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   Menus, ActnList, UProject;
     6  Classes, SysUtils, LazFileUtils, Forms, Controls, Graphics, Dialogs, ComCtrls,
     7  Menus, ActnList, Project;
    88
    99type
     10  TShowProjectEvent = procedure (ProjectFile: TProjectFile) of object;
    1011
    1112  { TFormProject }
     
    3132    procedure TreeViewProjectDblClick(Sender: TObject);
    3233  private
    33     procedure UpdateProjectFiles(Node: TTreeNode; Files: TProjectFileList);
     34    FOnShowProject: TShowProjectEvent;
     35    procedure UpdateProjectFiles(Node: TTreeNode; Files: TProjectFiles);
    3436  public
    3537    procedure UpdateProjectTree;
    3638    procedure UpdateInterface;
     39    property OnShowProject: TShowProjectEvent read FOnShowProject write FOnShowProject;
    3740  end;
    3841
    3942var
    4043  FormProject: TFormProject;
     44
    4145
    4246implementation
     
    4549
    4650uses
    47   UCore, UFormMain, UFormSourceCode, UFormTargetCode, UFormCodeTree;
     51  Core, FormMain, FormSourceCode, FormTargetCode, FormCodeTree;
    4852
    4953resourcestring
     
    5660  );
    5761begin
    58   with FormMain, FormSourceCode do
    5962  if Assigned(Node) then begin
    6063    if TProjectFile(Node.Data) is TProjectFile then begin
     
    107110begin
    108111  if Assigned(TreeViewProject.Selected) then
    109     Core.Project.Files.Remove(TreeViewProject.Selected.Data);
     112    Core.Core.Project.Files.Remove(TreeViewProject.Selected.Data);
    110113  UpdateProjectTree;
    111114end;
     
    126129begin
    127130  if Assigned(TreeViewProject.Selected) then begin
    128     FormMain.TabSheetSource.Show;
    129     FormSourceCode.ProjectFile := TProjectFile(TreeViewProject.Selected.Data);
     131    if Assigned(FOnShowProject) then
     132      FOnShowProject(TProjectFile(TreeViewProject.Selected.Data));
    130133  end;
    131134end;
     
    135138  NewNode: TTreeNode;
    136139begin
    137   with Core, TreeViewProject, Items do
     140  with Core.Core, TreeViewProject, Items do
    138141  try
    139142    BeginUpdate;
     
    147150      (TreeViewProject.TopItem.Count > 0) then
    148151      TreeViewProject.TopItem.Items[0].Selected := True
    149       else FormSourceCode.ProjectFile := nil;
     152      else begin
     153        if Assigned(FOnShowProject) then
     154          FOnShowProject(nil);
     155      end;
    150156  finally
    151157    EndUpdate;
     
    158164end;
    159165
    160 procedure TFormProject.UpdateProjectFiles(Node: TTreeNode; Files: TProjectFileList);
     166procedure TFormProject.UpdateProjectFiles(Node: TTreeNode; Files: TProjectFiles);
    161167var
    162168  I: Integer;
Note: See TracChangeset for help on using the changeset viewer.