Ignore:
Timestamp:
Jul 13, 2012, 1:49:52 PM (12 years ago)
Author:
chronos
Message:
  • Updated: Common package now contain TApplicationInfo class which contain various application info.
File:
1 edited

Legend:

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

    r54 r55  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   UProject;
     7  Menus, ActnList, UProject;
    88
    99type
     
    1212
    1313  TFormProject = class(TForm)
     14    AAdd: TAction;
     15    AShow: TAction;
     16    ARename: TAction;
     17    ADelete: TAction;
     18    ActionList1: TActionList;
     19    MenuItem1: TMenuItem;
     20    MenuItem2: TMenuItem;
     21    MenuItem3: TMenuItem;
     22    MenuItem4: TMenuItem;
     23    OpenDialog1: TOpenDialog;
     24    PopupMenuFile: TPopupMenu;
    1425    TreeViewProject: TTreeView;
     26    procedure AAddExecute(Sender: TObject);
    1527    procedure TreeViewProjectChange(Sender: TObject; Node: TTreeNode);
    1628  private
     
    6779end;
    6880
     81procedure TFormProject.AAddExecute(Sender: TObject);
     82begin
     83  if Sender is TMenuItem then
     84  with TMenuItem(Sender) do begin
     85    if OpenDialog1.Execute then begin
     86
     87      UpdateProjectTree;
     88    end;
     89  end;
     90end;
     91
    6992procedure TFormProject.UpdateProjectTree;
    7093var
    7194  NewNode: TTreeNode;
    7295begin
    73   with Core, TreeViewProject, Items do begin
     96  with Core, TreeViewProject, Items do
     97  try
    7498    BeginUpdate;
    7599    Clear;
    76100    if Assigned(Project) then begin
    77       NewNode := AddChild(nil, ExtractFileNameOnly(Project.FileName));
     101      NewNode := AddChildObject(nil, ExtractFileNameOnly(Project.FileName), Project);
    78102      UpdateProjectFiles(NewNode, Project.Files);
    79103      NewNode.Expand(True);
    80104    end;
    81     EndUpdate;
    82105    if Assigned(TreeViewProject.TopItem) and
    83106      (TreeViewProject.TopItem.Count > 0) then
    84107      TreeViewProject.TopItem.Items[0].Selected := True
    85108      else FormSourceCode.ProjectFile := nil;
     109  finally
     110    EndUpdate;
    86111  end;
    87112end;
     
    113138      end;
    114139    end;
    115     NewNode := TreeViewProject.Items.AddChild(SelNode, FileName);
    116     NewNode.Data := Pointer(Files[I]);
     140    NewNode := TreeViewProject.Items.AddChildObject(SelNode, FileName, Pointer(Files[I]));
    117141  end;
    118142end;
Note: See TracChangeset for help on using the changeset viewer.