Changeset 106 for trunk/Forms/UFormMain.pas
- Timestamp:
- May 6, 2019, 11:03:00 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r97 r106 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, SynEdit, Forms, Controls, Graphics, Dialogs,9 Menus, ActnList, ComCtrls, ExtCtrls, UTarget, Registry, URegistry,10 LazFileUtils;8 Classes, SysUtils, FileUtil, Forms, Controls, 9 Graphics, Dialogs, Menus, ActnList, ComCtrls, ExtCtrls, UTarget, Registry, 10 URegistry, LazFileUtils; 11 11 12 12 type … … 216 216 procedure TFormMain.TargetLogExecute(Lines: TStrings); 217 217 begin 218 FormLog.Memo1.Lines.AddStrings(Lines); 218 if Assigned(FormLog) then 219 FormLog.Memo1.Lines.AddStrings(Lines); 219 220 end; 220 221 … … 250 251 if Core.Project.Openned then 251 252 raise Exception.Create(SCloseProjectFirst); 252 FormSourceCode.SynEdit 1.Lines.LoadFromFile(FileName);253 FormSourceCode.SynEditSource.Lines.LoadFromFile(FileName); 253 254 Core.LastOpenedList.AddItem(FileName); 254 255 Core.Project.FileName := FileName; … … 344 345 Caption := Title; 345 346 AProjectSave.Enabled := Core.Project.Modified; 346 FormSourceCode.SynEdit 1.Enabled := Core.Project.Openned;347 FormSourceCode.SynEditSource.Enabled := Core.Project.Openned; 347 348 AProjectClose.Enabled := Core.Project.Openned; 348 349 AProjectSaveAs.Enabled := Core.Project.Openned; … … 372 373 procedure TFormMain.UpdateStatusBar; 373 374 begin 374 StatusBarMain.Panels[0].Text := IntToStr(FormSourceCode.SynEdit 1.CaretXY.X) +375 ', ' + IntToStr(FormSourceCode.SynEdit 1.CaretXY.Y);375 StatusBarMain.Panels[0].Text := IntToStr(FormSourceCode.SynEditSource.CaretXY.X) + 376 ', ' + IntToStr(FormSourceCode.SynEditSource.CaretXY.Y); 376 377 end; 377 378 … … 417 418 DebugStep: TDebugStep; 418 419 begin 419 DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(FormTargetCode. MemoTarget.SelStart);420 DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(FormTargetCode.SynEditTarget.SelStart); 420 421 if Assigned(DebugStep) then begin 421 FormSourceCode.SynEdit 1.SelStart := DebugStep.SourcePosition;422 FormSourceCode.SynEditSource.SelStart := DebugStep.SourcePosition; 422 423 PageControlMain.TabIndex := 0; 423 424 end; … … 428 429 DebugStep: TDebugStep; 429 430 begin 430 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit 1.SelStart);431 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart); 431 432 if Assigned(DebugStep) then begin 432 FormTargetCode. MemoTarget.SelStart := DebugStep.TargetPosition;433 FormTargetCode.SynEditTarget.SelStart := DebugStep.TargetPosition; 433 434 PageControlMain.TabIndex := 1; 434 435 end; … … 497 498 try 498 499 AProgramStop.Execute; 499 SourceCode := FormSourceCode.SynEdit 1.Text;500 SourceCode := FormSourceCode.SynEditSource.Text; 500 501 ProjectFileName := Core.Project.FileName; 501 502 ProgramName := ExtractFileNameOnly(Core.Project.FileName); … … 506 507 Compile; 507 508 Core.CurrentTarget.Messages.AppendMessage(SDone); 508 FormTargetCode.MemoTarget.Text := TargetCode; 509 FormTargetCode.SynEditTarget.Text := TargetCode; 510 FormTargetCode.SetHighlighter(Core.CurrentTarget.SourceExtension); 509 511 UpdateInterface; 510 512 except … … 519 521 BreakPoint: TBreakPoint; 520 522 begin 521 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit 1.SelStart);523 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart); 522 524 if Assigned(DebugStep) then begin 523 525 BreakPoint := Core.CurrentTarget.BreakPoints.SearchByTargetPos(DebugStep.TargetPosition); … … 552 554 if Core.CurrentTarget.State = rsStopped then begin 553 555 if not Core.CurrentTarget.Compiled then AProgramCompile.Execute; 554 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit 1.SelStart);556 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart); 555 557 Core.CurrentTarget.BreakPoints.SetSystem(DebugStep.TargetPosition); 556 558 AProgramRun.Execute; 557 559 end else begin 558 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit 1.SelStart);560 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEditSource.SelStart); 559 561 Core.CurrentTarget.RunToCursor(DebugStep.TargetPosition); 560 562 end; … … 566 568 begin 567 569 DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(Core.CurrentTarget.ExecutionPosition); 568 FormSourceCode.SynEdit 1.SelStart := DebugStep.SourcePosition;569 FormTargetCode. MemoTarget.SelStart := DebugStep.TargetPosition;570 if PageControlMain.TabIndex = 0 then FormSourceCode.SynEdit 1.SetFocus;571 if PageControlMain.TabIndex = 1 then FormTargetCode. MemoTarget.SetFocus;570 FormSourceCode.SynEditSource.SelStart := DebugStep.SourcePosition; 571 FormTargetCode.SynEditTarget.SelStart := DebugStep.TargetPosition; 572 if PageControlMain.TabIndex = 0 then FormSourceCode.SynEditSource.SetFocus; 573 if PageControlMain.TabIndex = 1 then FormTargetCode.SynEditTarget.SetFocus; 572 574 end; 573 575 … … 614 616 AProgramStop.Execute; 615 617 Core.Project.Openned := False; 616 FormSourceCode.SynEdit 1.Clear;618 FormSourceCode.SynEditSource.Clear; 617 619 UpdateInterface; 618 620 end; … … 624 626 if Core.Project.Openned then Exit; 625 627 Core.Project.FileName := 'Examples' + DirectorySeparator + SNewProject + '.b'; 626 FormSourceCode.SynEdit 1.Clear;628 FormSourceCode.SynEditSource.Clear; 627 629 Core.Project.Openned := True; 628 630 Core.CurrentTarget.Compiled := False; … … 654 656 SaveDialog1.FileName := Core.Project.FileName; 655 657 if SaveDialog1.Execute then begin 656 FormSourceCode.SynEdit 1.Lines.SaveToFile(SaveDialog1.FileName);658 FormSourceCode.SynEditSource.Lines.SaveToFile(SaveDialog1.FileName); 657 659 Core.Project.FileName := SaveDialog1.FileName; 658 660 Core.LastOpenedList.AddItem(SaveDialog1.FileName); … … 665 667 begin 666 668 if Core.Project.Modified and FileExistsUTF8(Core.Project.FileName) then begin 667 FormSourceCode.SynEdit 1.Lines.SaveToFile(Core.Project.FileName);669 FormSourceCode.SynEditSource.Lines.SaveToFile(Core.Project.FileName); 668 670 Core.Project.Modified := False; 669 671 UpdateInterface;
Note:
See TracChangeset
for help on using the changeset viewer.