Changeset 61 for trunk/IDE/Forms/UFormProject.pas
- Timestamp:
- Jul 17, 2012, 9:15:42 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Forms/UFormProject.pas
r56 r61 29 29 procedure AShowExecute(Sender: TObject); 30 30 procedure TreeViewProjectChange(Sender: TObject; Node: TTreeNode); 31 procedure TreeViewProjectDblClick(Sender: TObject); 31 32 private 32 33 procedure UpdateProjectFiles(Node: TTreeNode; Files: TProjectFileList); … … 46 47 UCore, UFormMain, UFormSourceCode, UFormTargetCode, UFormCodeTree; 47 48 49 resourcestring 50 SRenameSourceFile = 'Rename source file'; 51 SEnterNewFileName = 'Enter new file name'; 52 48 53 { TFormProject } 49 54 … … 54 59 if Assigned(Node) then begin 55 60 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; 58 63 (* if FileExists(TProjectFile(Node.Data).ProducedFileName) then 59 64 CompiledForm.SynEdit1.Lines.LoadFromFile(FileName) else … … 78 83 //CodeTreeForm.TreeView1.Assign(TProducerTreeView(Compiler.Producer).TreeView); 79 84 *) 80 end; 85 end else 86 TreeViewProject.PopupMenu := nil; 81 87 end; 88 end; 89 90 procedure TFormProject.TreeViewProjectDblClick(Sender: TObject); 91 begin 92 AShow.Execute; 82 93 end; 83 94 … … 95 106 procedure TFormProject.ADeleteExecute(Sender: TObject); 96 107 begin 97 108 if Assigned(TreeViewProject.Selected) then 109 Core.Project.Files.Remove(TreeViewProject.Selected.Data); 110 UpdateProjectTree; 98 111 end; 99 112 100 113 procedure TFormProject.ARenameExecute(Sender: TObject); 114 var 115 NewName: string; 101 116 begin 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; 103 123 end; 104 124 105 125 procedure TFormProject.AShowExecute(Sender: TObject); 106 126 begin 107 127 if Assigned(TreeViewProject.Selected) then 128 FormSourceCode.SynEditSource.Lines.Assign(TProjectFile(TreeViewProject.Selected.Data).Source); 108 129 end; 109 130
Note:
See TracChangeset
for help on using the changeset viewer.