Changeset 36 for trunk/IDE/Forms/UMainForm.pas
- Timestamp:
- Feb 13, 2012, 4:07:34 PM (13 years ago)
- Location:
- trunk/IDE
- Files:
-
- 2 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/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
Note:
See TracChangeset
for help on using the changeset viewer.