Changeset 97 for trunk/Forms/UFormMain.pas
- Timestamp:
- Aug 2, 2018, 3:33:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r96 r97 202 202 DockInit; 203 203 Core.PersistentForm1.Load(Self, True); 204 Core.ThemeManager.UseTheme(Self) 204 Core.ThemeManager.UseTheme(Self); 205 FormSourceCode.UpdateTheme; 205 206 end; 206 207 end; … … 249 250 if Core.Project.Openned then 250 251 raise Exception.Create(SCloseProjectFirst); 251 FormSourceCode. MemoSource.Lines.LoadFromFile(FileName);252 FormSourceCode.SynEdit1.Lines.LoadFromFile(FileName); 252 253 Core.LastOpenedList.AddItem(FileName); 253 254 Core.Project.FileName := FileName; … … 343 344 Caption := Title; 344 345 AProjectSave.Enabled := Core.Project.Modified; 345 FormSourceCode. MemoSource.Enabled := Core.Project.Openned;346 FormSourceCode.SynEdit1.Enabled := Core.Project.Openned; 346 347 AProjectClose.Enabled := Core.Project.Openned; 347 348 AProjectSaveAs.Enabled := Core.Project.Openned; … … 371 372 procedure TFormMain.UpdateStatusBar; 372 373 begin 373 StatusBarMain.Panels[0].Text := IntToStr(FormSourceCode. MemoSource.CaretPos.X) +374 ', ' + IntToStr(FormSourceCode. MemoSource.CaretPos.Y);374 StatusBarMain.Panels[0].Text := IntToStr(FormSourceCode.SynEdit1.CaretXY.X) + 375 ', ' + IntToStr(FormSourceCode.SynEdit1.CaretXY.Y); 375 376 end; 376 377 … … 418 419 DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(FormTargetCode.MemoTarget.SelStart); 419 420 if Assigned(DebugStep) then begin 420 FormSourceCode. MemoSource.SelStart := DebugStep.SourcePosition;421 FormSourceCode.SynEdit1.SelStart := DebugStep.SourcePosition; 421 422 PageControlMain.TabIndex := 0; 422 423 end; … … 427 428 DebugStep: TDebugStep; 428 429 begin 429 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode. MemoSource.SelStart);430 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit1.SelStart); 430 431 if Assigned(DebugStep) then begin 431 432 FormTargetCode.MemoTarget.SelStart := DebugStep.TargetPosition; … … 484 485 end; 485 486 Core.ThemeManager.UseTheme(Self); 487 FormSourceCode.UpdateTheme; 486 488 end; 487 489 finally … … 495 497 try 496 498 AProgramStop.Execute; 497 SourceCode := FormSourceCode. MemoSource.Text;499 SourceCode := FormSourceCode.SynEdit1.Text; 498 500 ProjectFileName := Core.Project.FileName; 499 501 ProgramName := ExtractFileNameOnly(Core.Project.FileName); … … 517 519 BreakPoint: TBreakPoint; 518 520 begin 519 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode. MemoSource.SelStart);521 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit1.SelStart); 520 522 if Assigned(DebugStep) then begin 521 523 BreakPoint := Core.CurrentTarget.BreakPoints.SearchByTargetPos(DebugStep.TargetPosition); … … 550 552 if Core.CurrentTarget.State = rsStopped then begin 551 553 if not Core.CurrentTarget.Compiled then AProgramCompile.Execute; 552 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode. MemoSource.SelStart);554 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit1.SelStart); 553 555 Core.CurrentTarget.BreakPoints.SetSystem(DebugStep.TargetPosition); 554 556 AProgramRun.Execute; 555 557 end else begin 556 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode. MemoSource.SelStart);558 DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit1.SelStart); 557 559 Core.CurrentTarget.RunToCursor(DebugStep.TargetPosition); 558 560 end; … … 564 566 begin 565 567 DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(Core.CurrentTarget.ExecutionPosition); 566 FormSourceCode. MemoSource.SelStart := DebugStep.SourcePosition;568 FormSourceCode.SynEdit1.SelStart := DebugStep.SourcePosition; 567 569 FormTargetCode.MemoTarget.SelStart := DebugStep.TargetPosition; 568 if PageControlMain.TabIndex = 0 then FormSourceCode. MemoSource.SetFocus;570 if PageControlMain.TabIndex = 0 then FormSourceCode.SynEdit1.SetFocus; 569 571 if PageControlMain.TabIndex = 1 then FormTargetCode.MemoTarget.SetFocus; 570 572 end; … … 612 614 AProgramStop.Execute; 613 615 Core.Project.Openned := False; 614 FormSourceCode. MemoSource.Clear;616 FormSourceCode.SynEdit1.Clear; 615 617 UpdateInterface; 616 618 end; … … 622 624 if Core.Project.Openned then Exit; 623 625 Core.Project.FileName := 'Examples' + DirectorySeparator + SNewProject + '.b'; 624 FormSourceCode. MemoSource.Clear;626 FormSourceCode.SynEdit1.Clear; 625 627 Core.Project.Openned := True; 626 628 Core.CurrentTarget.Compiled := False; … … 652 654 SaveDialog1.FileName := Core.Project.FileName; 653 655 if SaveDialog1.Execute then begin 654 FormSourceCode. MemoSource.Lines.SaveToFile(SaveDialog1.FileName);656 FormSourceCode.SynEdit1.Lines.SaveToFile(SaveDialog1.FileName); 655 657 Core.Project.FileName := SaveDialog1.FileName; 656 658 Core.LastOpenedList.AddItem(SaveDialog1.FileName); … … 663 665 begin 664 666 if Core.Project.Modified and FileExistsUTF8(Core.Project.FileName) then begin 665 FormSourceCode. MemoSource.Lines.SaveToFile(Core.Project.FileName);667 FormSourceCode.SynEdit1.Lines.SaveToFile(Core.Project.FileName); 666 668 Core.Project.Modified := False; 667 669 UpdateInterface;
Note:
See TracChangeset
for help on using the changeset viewer.