- Timestamp:
- Dec 5, 2014, 8:34:59 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r64 r65 180 180 SDone = 'Done'; 181 181 SChanged = 'Changed'; 182 SUnsavedChanges = 'Unsaved changes'; 183 SDoYouWantToSaveProject = 'There are unsaved changes in project. Do you want to save them?'; 184 SCloseProjectFirst = 'Project need to be closed before it can be openned'; 182 185 183 186 { TMainForm } … … 259 262 procedure TMainForm.ProjectOpen(FileName: string); 260 263 begin 261 AProjectClose.Execute; 264 if Core.Project.Openned then 265 raise Exception.Create(SCloseProjectFirst); 262 266 FormSourceCode.MemoSource.Lines.LoadFromFile(UTF8Decode(FileName)); 263 267 Core.LastOpenedList.AddItem(FileName); … … 455 459 procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: boolean); 456 460 begin 457 if Core.Project.Modified then AProjectSaveAs.Execute; 461 if Core.Project.Modified then begin 462 AProjectClose.Execute; 463 if Core.Project.Openned then CanClose := False; 464 end; 458 465 end; 459 466 … … 564 571 565 572 procedure TMainForm.AProjectCloseExecute(Sender: TObject); 566 begin 567 if Core.Project.Modified then AProjectSaveAs.Execute; 568 AProgramStop.Execute; 569 Core.Project.Openned := False; 570 FormSourceCode.MemoSource.Clear; 571 UpdateInterface; 573 var 574 DialogResult: TModalResult; 575 begin 576 DialogResult := mrNo; 577 if Core.Project.Modified then begin 578 DialogResult := MessageDlg(SUnsavedChanges, SDoYouWantToSaveProject, mtConfirmation, [mbYes, mbNo, mbCancel], 0); 579 if DialogResult = mrYes then begin 580 AProjectSave.Execute; 581 end; 582 end; 583 if (DialogResult = mrNo) or (DialogResult = mrYes) then begin 584 AProgramStop.Execute; 585 Core.Project.Openned := False; 586 FormSourceCode.MemoSource.Clear; 587 UpdateInterface; 588 end; 572 589 end; 573 590 … … 575 592 begin 576 593 AProjectClose.Execute; 594 if Core.Project.Openned then Exit; 577 595 Core.Project.FileName := 'Examples' + DirectorySeparator + SNewProject + '.b'; 578 596 FormSourceCode.MemoSource.Clear; … … 584 602 procedure TMainForm.AProjectOpenRecentExecute(Sender: TObject); 585 603 begin 604 AProjectClose.Execute; 605 if Core.Project.Openned then Exit; 586 606 ProjectOpen(Core.LastOpenedList.Items[TMenuItem(Sender).MenuIndex]); 587 607 end; … … 589 609 procedure TMainForm.AProjectOpenExecute(Sender: TObject); 590 610 begin 591 AProjectClose.Execute;592 611 if Core.LastOpenedList.Items.Count > 0 then 593 612 OpenDialog1.FileName := Core.LastOpenedList.Items[0] … … 595 614 OpenDialog1.InitialDir := ExtractFileDir(OpenDialog1.FileName); 596 615 if OpenDialog1.Execute then begin 616 AProjectClose.Execute; 617 if Core.Project.Openned then Exit; 597 618 ProjectOpen(OpenDialog1.FileName); 598 619 end; -
trunk/Languages/LazFuckIDE.cs.po
r64 r65 549 549 #: toptionsform.label4.caption 550 550 msgid "Compiler optimizations:" 551 msgstr " "551 msgstr "Optimalizace pÅekladaÄe:" 552 552 553 553 #: toptionsform.labeldpi.caption … … 620 620 msgstr "ZmÄnÄno" 621 621 622 #: uformmain.scloseprojectfirst 623 msgid "Project need to be closed before it can be openned" 624 msgstr "Projekt musà bÃœt uzavÅen pÅed tÃm, nÄÅŸ můşe bÃœt otevÅen" 625 622 626 #: uformmain.scompilestart 623 627 msgid "Compiling..." … … 627 631 msgid "Done" 628 632 msgstr "DokonÄeno" 633 634 #: uformmain.sdoyouwanttosaveproject 635 msgid "There are unsaved changes in project. Do you want to save them?" 636 msgstr "V projektu Jsou neuloÅŸené zmÄny. Chcete je uloÅŸit?" 629 637 630 638 #: uformmain.snewproject … … 645 653 msgstr "Program zastaven" 646 654 655 #: uformmain.sunsavedchanges 656 msgid "Unsaved changes" 657 msgstr "NeuloÅŸené zmÄny" 658 647 659 #: uformsourcecode.senternumber 648 660 msgctxt "uformsourcecode.senternumber" … … 750 762 #: utargetinterpretter.sunsupportedcommand 751 763 msgid "Unsupported command" 752 msgstr "" 753 764 msgstr "NepodporovanÃœ pÅÃkaz" -
trunk/Languages/LazFuckIDE.po
r64 r65 607 607 msgstr "" 608 608 609 #: uformmain.scloseprojectfirst 610 msgid "Project need to be closed before it can be openned" 611 msgstr "" 612 609 613 #: uformmain.scompilestart 610 614 msgid "Compiling..." … … 613 617 #: uformmain.sdone 614 618 msgid "Done" 619 msgstr "" 620 621 #: uformmain.sdoyouwanttosaveproject 622 msgid "There are unsaved changes in project. Do you want to save them?" 615 623 msgstr "" 616 624 … … 632 640 msgstr "" 633 641 642 #: uformmain.sunsavedchanges 643 msgid "Unsaved changes" 644 msgstr "" 645 634 646 #: uformsourcecode.senternumber 635 647 msgctxt "uformsourcecode.senternumber" -
trunk/UTarget.pas
r64 r65 32 32 function SearchByTargetPos(Pos: Integer): TDebugStep; 33 33 procedure AddStep(SourcePos, TargetPos: Integer; Operation: TStepOperation); 34 procedure UpdateTargetPos(Old, New: Integer); 34 35 end; 35 36 … … 271 272 end; 272 273 274 procedure TDebugStepList.UpdateTargetPos(Old, New: Integer); 275 var 276 I: Integer; 277 begin 278 I := 0; 279 while (I < Count) do begin 280 if TDebugStep(Items[I]).TargetPosition = Old then 281 TDebugStep(Items[I]).TargetPosition := New; 282 Inc(I); 283 end; 284 end; 285 273 286 274 287 { TTargetList } … … 594 607 end; 595 608 end; 609 DebugSteps.UpdateTargetPos(FProgramIndex, NewProgramIndex); 596 610 Inc(FProgramIndex); 597 611 Inc(NewProgramIndex); … … 734 748 end; 735 749 PreviousCommand := FProgram[FProgramIndex].Command; 750 DebugSteps.UpdateTargetPos(FProgramIndex, NewProgramIndex); 736 751 Inc(FProgramIndex); 737 752 Inc(NewProgramIndex);
Note:
See TracChangeset
for help on using the changeset viewer.