Changeset 48 for trunk/IDE/UProject.pas
- Timestamp:
- Mar 4, 2012, 4:28:12 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/UProject.pas
r47 r48 65 65 procedure LoadFromXMLNode(Node: TDOMNode); 66 66 function SearchFile(FileName: string): TProjectFile; 67 procedure AddFile(FileName: string);67 function AddFile(FileName: string): TProjectFile; 68 68 end; 69 69 … … 91 91 end; 92 92 93 { TProjectTemplate } 94 95 TProjectTemplate = class 96 Name: string; 97 Description: TStringList; 98 procedure InitProject(Project: TProject); virtual; 99 constructor Create; virtual; 100 destructor Destroy; override; 101 end; 102 103 { TProjectTemplateList } 104 105 TProjectTemplateList = class(TListObject) 106 procedure AddTemplate(Template: TProjectTemplate); 107 end; 108 109 93 110 implementation 94 111 112 resourcestring 113 SNewProject = 'New project'; 114 115 { TProjectTemplateList } 116 117 procedure TProjectTemplateList.AddTemplate(Template: TProjectTemplate); 118 begin 119 Add(Template); 120 end; 121 122 { TProjectTemplate } 123 124 procedure TProjectTemplate.InitProject(Project: TProject); 125 begin 126 Project.Active := False; 127 Project.Active := True; 128 Project.FileName := SNewProject; 129 end; 130 131 constructor TProjectTemplate.Create; 132 begin 133 Description := TStringList.Create; 134 end; 135 136 destructor TProjectTemplate.Destroy; 137 begin 138 Description.Free; 139 inherited Destroy; 140 end; 141 95 142 { TProjectPackageList } 96 143 … … 114 161 115 162 end; 116 117 118 163 119 164 { TProjectGroup } … … 184 229 end; 185 230 186 procedure TProjectFileList.AddFile(FileName: string); 187 var 188 NewFile: TProjectFile; 189 begin 190 NewFile := TProjectFile(AddNew(TProjectFile.Create)); 191 NewFile.Parent := Parent; 192 NewFile.FileName := FileName; 231 function TProjectFileList.AddFile(FileName: string): TProjectFile; 232 begin 233 Result := TProjectFile(AddNew(TProjectFile.Create)); 234 Result.Parent := Parent; 235 Result.FileName := FileName; 193 236 end; 194 237 … … 234 277 FileName := UTF8Encode(NewNode.TextContent); 235 278 end; 236 if FileExistsUTF8( FileName) then Load;279 if FileExistsUTF8(ExtractFileDir(Parent.FileName) + DirectorySeparator + FileName) then Load; 237 280 end; 238 281
Note:
See TracChangeset
for help on using the changeset viewer.