Ignore:
Timestamp:
Jul 17, 2012, 9:15:42 AM (12 years ago)
Author:
chronos
Message:
  • Added: Form with text output of executed external producer tool.
  • Fixed: Template for new unit mustn't initialize new project but only add unit file to project.
  • Added: Project manager file deletion and rename.
File:
1 edited

Legend:

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

    r56 r61  
    2929    procedure AShowExecute(Sender: TObject);
    3030    procedure TreeViewProjectChange(Sender: TObject; Node: TTreeNode);
     31    procedure TreeViewProjectDblClick(Sender: TObject);
    3132  private
    3233    procedure UpdateProjectFiles(Node: TTreeNode; Files: TProjectFileList);
     
    4647  UCore, UFormMain, UFormSourceCode, UFormTargetCode, UFormCodeTree;
    4748
     49resourcestring
     50  SRenameSourceFile = 'Rename source file';
     51  SEnterNewFileName = 'Enter new file name';
     52
    4853{ TFormProject }
    4954
     
    5459  if Assigned(Node) then begin
    5560    if TProjectFile(Node.Data) is TProjectFile then begin
    56       ProjectFile := TProjectFile(Node.Data);
    57       SynEditSource.Lines.Assign(TProjectFile(Node.Data).Source);
     61      TreeViewProject.PopupMenu := PopupMenuFile;
     62      AShow.Execute;
    5863(*        if FileExists(TProjectFile(Node.Data).ProducedFileName) then
    5964        CompiledForm.SynEdit1.Lines.LoadFromFile(FileName) else
     
    7883      //CodeTreeForm.TreeView1.Assign(TProducerTreeView(Compiler.Producer).TreeView);
    7984      *)
    80     end;
     85    end else
     86      TreeViewProject.PopupMenu := nil;
    8187  end;
     88end;
     89
     90procedure TFormProject.TreeViewProjectDblClick(Sender: TObject);
     91begin
     92  AShow.Execute;
    8293end;
    8394
     
    95106procedure TFormProject.ADeleteExecute(Sender: TObject);
    96107begin
    97 
     108  if Assigned(TreeViewProject.Selected) then
     109    Core.Project.Files.Remove(TreeViewProject.Selected.Data);
     110  UpdateProjectTree;
    98111end;
    99112
    100113procedure TFormProject.ARenameExecute(Sender: TObject);
     114var
     115  NewName: string;
    101116begin
    102 
     117  if Assigned(TreeViewProject.Selected) then begin
     118    NewName := TProjectFile(TreeViewProject.Selected.Data).FileName;
     119    if InputQuery(SRenameSourceFile, SEnterNewFileName, NewName) then
     120      TProjectFile(TreeViewProject.Selected.Data).FileName := NewName;
     121    UpdateProjectTree;
     122  end;
    103123end;
    104124
    105125procedure TFormProject.AShowExecute(Sender: TObject);
    106126begin
    107 
     127  if Assigned(TreeViewProject.Selected) then
     128  FormSourceCode.SynEditSource.Lines.Assign(TProjectFile(TreeViewProject.Selected.Data).Source);
    108129end;
    109130
Note: See TracChangeset for help on using the changeset viewer.