Changeset 36
- Timestamp:
- Feb 13, 2012, 4:07:34 PM (13 years ago)
- Location:
- trunk/IDE
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE
- Property svn:ignore
-
old new 4 4 Transpascal.lps 5 5 Transpascal.exe 6 heaptrclog.trc
-
- Property svn:ignore
-
trunk/IDE/Forms/UCodeForm.pas
r34 r36 23 23 property ProjectFile: TProjectFile read FProjectFile write SetProjectFile; 24 24 procedure Save; 25 procedure UpdateInterface; 25 26 end; 26 27 … … 57 58 end; 58 59 60 procedure TCodeForm.UpdateInterface; 61 begin 62 SynPasSyn1.Enabled := MainForm.Project.Active; 63 end; 64 59 65 end. 60 66 -
trunk/IDE/Forms/UMainForm.lfm
r35 r36 1 1 object MainForm: TMainForm 2 Left = 2 402 Left = 217 3 3 Height = 501 4 Top = 1 194 Top = 104 5 5 Width = 695 6 6 Caption = 'Transpascal IDE' … … 320 320 end 321 321 object OpenDialog1: TOpenDialog 322 Filter = 'Project file (*.*)|*.tppr|Any file (*.*)|*.*' 322 DefaultExt = '.tppr' 323 Filter = 'Project file (*.tppr)|*.tppr|Any file (*.*)|*.*' 323 324 left = 115 324 325 top = 52 325 326 end 326 327 object SaveDialog1: TSaveDialog 327 Filter = 'Project file (*.*)|*.tppr|Any file (*.*)|*.*' 328 DefaultExt = '.tppr' 329 Filter = 'Project file (*.tppr)|*.tppr|Any file (*.*)|*.*' 328 330 left = 115 329 331 top = 104 -
trunk/IDE/Forms/UMainForm.pas
r35 r36 119 119 procedure LoadFromRegistry(Root: HKEY; Key: string); 120 120 procedure SaveToRegistry(Root: HKEY; Key: string); 121 procedure OpenProject(FileName: string);121 procedure ProjectOpen(FileName: string); 122 122 procedure UpdateMenu; 123 123 public … … 235 235 AProgramStop.Enabled := Project.Active and (BrainFuckInterpreter.State <> rsStopped);*) 236 236 UpdateMenu; 237 CodeForm.UpdateInterface; 238 ProjectManager.UpdateInterface; 237 239 end; 238 240 … … 332 334 end; 333 335 334 procedure TMainForm. OpenProject(FileName: string);336 procedure TMainForm.ProjectOpen(FileName: string); 335 337 begin 336 338 Project.LoadFromFile(FileName); … … 382 384 procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction); 383 385 begin 384 Project.Save;386 AProjectClose.Execute; 385 387 SaveToRegistry(RegistryRootKey, ApplicationInfo.RegistryKey); 386 388 end; … … 413 415 begin 414 416 if Sender is TMenuItem then 415 OpenProject(StringReplace(TMenuItem(Sender).Caption, '&', '', [rfReplaceAll]));417 ProjectOpen(StringReplace(TMenuItem(Sender).Caption, '&', '', [rfReplaceAll])); 416 418 end; 417 419 … … 424 426 425 427 if ReopenLastOpenedFile and (LastOpenedFiles.Count > 0) then begin 426 OpenProject(LastOpenedFiles[0]);428 ProjectOpen(LastOpenedFiles[0]); 427 429 end; 428 430 … … 438 440 begin 439 441 if OpenDialog1.Execute then begin 440 OpenProject(OpenDialog1.FileName);442 ProjectOpen(OpenDialog1.FileName); 441 443 end; 442 444 end; … … 444 446 procedure TMainForm.AProjectCloseExecute(Sender: TObject); 445 447 begin 448 //if Project.Modified then ; 449 Project.Active := False; 450 UpdateInterface; 451 end; 452 453 procedure TMainForm.AExitExecute(Sender: TObject); 454 begin 446 455 Close; 447 456 end; 448 457 449 procedure TMainForm.AExitExecute(Sender: TObject);450 begin451 Close;452 end;453 454 458 procedure TMainForm.AAboutExecute(Sender: TObject); 455 459 begin … … 464 468 procedure TMainForm.AProjectNewExecute(Sender: TObject); 465 469 begin 466 Project.Clear; 470 AProjectClose.Execute; 471 Project.Active := True; 467 472 Project.Name := SNewProject; 468 ProjectManager.UpdateProjectTree; 469 Caption := ApplicationInfo.Name + ' - ' + Project.Name; 473 UpdateInterface; 470 474 end; 471 475 … … 473 477 begin 474 478 if SaveDialog1.Execute then begin 479 Project.Active := True; 475 480 Project.SaveToFile(SaveDialog1.FileName); 476 481 CodeForm.Save; 477 482 Project.Save; 483 UpdateInterface; 484 LastOpenedFiles.AddItem(SaveDialog1.FileName); 485 LastOpenedFiles.ReloadMenu; 478 486 end; 479 487 end; … … 482 490 begin 483 491 CodeForm.Save; 484 Project.SaveToFile(Project.GetDir(True) + Project.Name + '.tppr'); 492 if not FileExistsUTF8(Project.FileName) then AProjectSaveAs.Execute 493 else Project.SaveToFile(Project.FileName); 485 494 end; 486 495 -
trunk/IDE/Forms/UProjectManager.pas
r24 r36 18 18 public 19 19 procedure UpdateProjectTree; 20 procedure UpdateInterface; 20 21 end; 21 22 … … 84 85 end; 85 86 87 procedure TProjectManager.UpdateInterface; 88 begin 89 UpdateProjectTree; 90 end; 91 86 92 procedure TProjectManager.UpdateProjectGroup(Node: TTreeNode; Group: TProjectGroup); 87 93 var -
trunk/IDE/Transpascal.lpi
r35 r36 247 247 <UseMsgFile Value="True"/> 248 248 </CompilerMessages> 249 <CustomOptions Value="-dDEBUG"/> 249 250 <CompilerPath Value="$(CompPath)"/> 250 251 </Other> -
trunk/IDE/Transpascal.lpr
r35 r36 16 16 {$R *.res} 17 17 18 {$IFDEF DEBUG} 18 19 const 19 20 HeapTraceLog = 'heaptrclog.trc'; 21 {$ENDIF} 20 22 21 23 begin 22 24 Application.Title := 'Transpascal IDE'; 25 {$IFDEF DEBUG} 23 26 // Heap trace 24 // DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 25 // SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 27 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 28 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 29 {$ENDIF} 26 30 27 31 Application.Initialize; -
trunk/IDE/UProject.pas
r35 r36 9 9 Classes, SysUtils, Dialogs, DOM, XMLWrite, XMLRead, FileUtil, 10 10 SpecializedList; 11 12 const 13 ProjectExt = '.tppr'; 11 14 12 15 type … … 63 66 FActive: Boolean; 64 67 function GetActive: Boolean; 68 function GetFileName: string; 65 69 procedure SetActive(AValue: Boolean); 66 70 public … … 75 79 procedure Clear; 76 80 property Active: Boolean read GetActive write SetActive; 81 property FileName: string read GetFileName; 77 82 end; 78 83 … … 236 241 end; 237 242 243 function TProject.GetFileName: string; 244 begin 245 Result := GetDir(True) + Name + ProjectExt; 246 end; 247 238 248 procedure TProject.SetActive(AValue: Boolean); 239 249 begin 250 if FActive = AValue then Exit; 240 251 FActive := AValue; 252 if FActive then Clear; 241 253 end; 242 254 … … 264 276 Doc.Free; 265 277 end; 278 FModified := False; 266 279 end; 267 280 … … 310 323 Free; 311 324 end; 325 FModified := False; 312 326 inherited Save; 313 327 end;
Note:
See TracChangeset
for help on using the changeset viewer.