- Timestamp:
- Mar 4, 2012, 4:28:12 PM (13 years ago)
- Location:
- trunk/IDE
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Forms/UFormMain.lfm
r45 r48 629 629 object AProjectNew: TAction 630 630 Category = 'Project' 631 Caption = 'New '631 Caption = 'New...' 632 632 Hint = 'Create new project' 633 633 ImageIndex = 10 -
trunk/IDE/Forms/UFormMain.lrt
r45 r48 16 16 TFORMMAIN.MENUITEM22.CAPTION=- 17 17 TFORMMAIN.MENUITEM9.CAPTION=Help 18 TFORMMAIN.APROJECTNEW.CAPTION=New 18 TFORMMAIN.APROJECTNEW.CAPTION=New... 19 19 TFORMMAIN.APROJECTNEW.HINT=Create new project 20 20 TFORMMAIN.APROJECTOPEN.CAPTION=Open... -
trunk/IDE/Forms/UFormMain.pas
r47 r48 141 141 private 142 142 LastOpenedFiles: TLastOpenedList; 143 procedure ProjectTemplatesInit; 143 144 procedure CompilerDebugLog(Text: string); 144 145 procedure MenuItemTargetClick(Sender: TObject); … … 153 154 LogParsing: Boolean; 154 155 Project: TProject; 156 ProjectTemplates: TProjectTemplateList; 155 157 TargetProject: TProject; 156 158 Compiler: TCustomCompiler; … … 169 171 uses 170 172 UFormMessages, UFormSourceCode, UFormProject, UCommon, UFormAbout, UFormOptions, 171 UFormTargets, UTarget, UAnalyzer, UProducer, UExecutor; 173 UFormTargets, UTarget, UAnalyzer, UProducer, UExecutor, UFormProjectNew, 174 UProjectTemplates; 172 175 173 176 resourcestring … … 239 242 Compiler.Compile; 240 243 end; 241 //FormProject.TreeViewProjectChange(Self, FormProject.TreeViewProject.Selected);244 FormProject.TreeViewProjectChange(Self, FormProject.TreeViewProject.Selected); 242 245 FormMessages.Reload; 243 246 end; … … 483 486 Compiler := TCustomCompiler.Create; 484 487 Project := TProject.Create; 488 ProjectTemplates := TProjectTemplateList.Create; 485 489 TargetProject := TProject.Create; 486 490 LastOpenedFiles := TLastOpenedList.Create; … … 491 495 procedure TFormMain.FormDestroy(Sender: TObject); 492 496 begin 497 ProjectTemplates.Free; 493 498 LastOpenedFiles.Free; 494 499 TargetProject.Free; … … 497 502 end; 498 503 504 procedure TFormMain.ProjectTemplatesInit; 505 begin 506 ProjectTemplates.AddTemplate(TProjectTemplateConsoleApp.Create); 507 ProjectTemplates.AddTemplate(TProjectTemplateGUIApp.Create); 508 ProjectTemplates.AddTemplate(TProjectTemplatePackage.Create); 509 ProjectTemplates.AddTemplate(TProjectTemplateUnit.Create); 510 end; 511 499 512 procedure TFormMain.CompilerDebugLog(Text: string); 500 513 begin … … 514 527 LoadFromRegistry(RegistryRootKey, ApplicationInfo.RegistryKey); 515 528 DockInit; 529 ProjectTemplatesInit; 516 530 517 531 if ReopenLastOpenedFile and (LastOpenedFiles.Count > 0) then begin … … 560 574 NewFile: TProjectFile; 561 575 begin 562 AProjectClose.Execute;563 Project.Active := True;564 Project.FileName := SNewProject;565 Project.Files.AddFile('Unit1.pas');576 if FormProjectNew.ShowModal = mrOk then begin 577 if Assigned(FormProjectNew.ListView1.Selected) then 578 TProjectTemplate(FormProjectNew.ListView1.Selected.Data).InitProject(Project); 579 end; 566 580 UpdateInterface; 567 581 end; -
trunk/IDE/Languages/Transpascal.cs.po
r45 r48 139 139 140 140 #: tformmain.aprojectnew.caption 141 #| msgid "New" 141 142 msgctxt "tformmain.aprojectnew.caption" 142 msgid "New "143 msgstr "Nový "143 msgid "New..." 144 msgstr "Nový..." 144 145 145 146 #: tformmain.aprojectnew.hint … … 400 401 msgid "Project manager" 401 402 msgstr "Správce projektu" 403 404 #: tformprojectnew.buttoncancel.caption 405 msgctxt "tformprojectnew.buttoncancel.caption" 406 msgid "Cancel" 407 msgstr "Zrušit" 408 409 #: tformprojectnew.buttonok.caption 410 msgctxt "tformprojectnew.buttonok.caption" 411 msgid "Ok" 412 msgstr "Ok" 413 414 #: tformprojectnew.caption 415 msgid "New item" 416 msgstr "Nová položka" 402 417 403 418 #: tformsourcecode.caption … … 762 777 msgstr "Nový projekt" 763 778 779 #: uproject.snewproject 780 msgctxt "uproject.snewproject" 781 msgid "New project" 782 msgstr "Nový projekt" 783 -
trunk/IDE/Languages/Transpascal.po
r45 r48 132 132 #: tformmain.aprojectnew.caption 133 133 msgctxt "TFORMMAIN.APROJECTNEW.CAPTION" 134 msgid "New "134 msgid "New..." 135 135 msgstr "" 136 136 … … 393 393 msgstr "" 394 394 395 #: tformprojectnew.buttoncancel.caption 396 msgctxt "TFORMPROJECTNEW.BUTTONCANCEL.CAPTION" 397 msgid "Cancel" 398 msgstr "" 399 400 #: tformprojectnew.buttonok.caption 401 msgctxt "TFORMPROJECTNEW.BUTTONOK.CAPTION" 402 msgid "Ok" 403 msgstr "" 404 405 #: tformprojectnew.caption 406 msgid "New item" 407 msgstr "" 408 395 409 #: tformsourcecode.caption 396 410 msgctxt "TFORMSOURCECODE.CAPTION" … … 753 767 msgstr "" 754 768 769 #: uproject.snewproject 770 msgctxt "uproject.snewproject" 771 msgid "New project" 772 msgstr "" 773 -
trunk/IDE/Transpascal.lpi
r46 r48 106 106 </Item7> 107 107 </RequiredPackages> 108 <Units Count="1 4">108 <Units Count="16"> 109 109 <Unit0> 110 110 <Filename Value="Transpascal.lpr"/> … … 201 201 <UnitName Value="UFormCompilerSettings"/> 202 202 </Unit13> 203 <Unit14> 204 <Filename Value="Forms\UFormProjectNew.pas"/> 205 <IsPartOfProject Value="True"/> 206 <ComponentName Value="FormProjectNew"/> 207 <ResourceBaseClass Value="Form"/> 208 <UnitName Value="UFormProjectNew"/> 209 </Unit14> 210 <Unit15> 211 <Filename Value="UProjectTemplates.pas"/> 212 <IsPartOfProject Value="True"/> 213 <UnitName Value="UProjectTemplates"/> 214 </Unit15> 203 215 </Units> 204 216 </ProjectOptions> -
trunk/IDE/Transpascal.lpr
r45 r48 12 12 UFormSourceCode, UFormMessages, 13 13 UFormTargetCode, UFormCodeTree, TemplateGenerics, CoolTranslator, Common, 14 UFormAbout, UFormOptions, UFormTargets, UFormCompilerSettings; 14 UFormAbout, UFormOptions, UFormTargets, UFormCompilerSettings, 15 UFormProjectNew, UProjectTemplates; 15 16 16 17 {$R *.res} … … 40 41 Application.CreateForm(TFormCompilerSettings, FormCompilerSettings); 41 42 Application.CreateForm(TFormTargets, FormTargets); 43 Application.CreateForm(TFormProjectNew, FormProjectNew); 42 44 Application.Run; 43 45 end. -
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.