Changeset 133 for trunk/Forms/UFormMain.pas
- Timestamp:
- Mar 4, 2022, 10:57:08 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r128 r133 15 15 16 16 TFormMain = class(TForm) 17 AProgramCompileMultiple: TAction; 17 18 AViewLog: TAction; 18 19 AProgramShowExecutionPoint: TAction; … … 52 53 MenuItem19: TMenuItem; 53 54 MenuItem2: TMenuItem; 55 MenuItem20: TMenuItem; 54 56 MenuItem22: TMenuItem; 55 57 MenuItem24: TMenuItem; … … 117 119 procedure AOptionsExecute(Sender: TObject); 118 120 procedure AProgramCompileExecute(Sender: TObject); 121 procedure AProgramCompileMultipleExecute(Sender: TObject); 119 122 procedure AProgramPauseExecute(Sender: TObject); 120 123 procedure AProgramRunToCursorExecute(Sender: TObject); … … 171 174 UCore, UFormCPU, UFormOptions, UFormMessages, UFormTargets, UFormOutput, UFormInput, 172 175 UFormMemory, UFormSourceCode, UFormTargetCode, UTargetInterpretter, UFormLog, 173 UBFTarget, UCommon ;176 UBFTarget, UCommon, UFormCompileMultiple; 174 177 175 178 resourcestring … … 206 209 FormSourceCode.UpdateTheme; 207 210 end; 211 Core.Messages.OnChange := FormMain.MessagesChanged; 208 212 end; 209 213 … … 227 231 AProgramShowExecutionPoint.Execute; 228 232 if Core.CurrentTarget.State = rsStopped then 229 Core. CurrentTarget.Messages.AddMessage(SProgramStopped);233 Core.Messages.AddMessage(SProgramStopped); 230 234 end; 231 235 … … 405 409 if not Core.CurrentTarget.Compiled then AProgramCompile.Execute; 406 410 Core.CurrentTarget.Run; 407 Core. CurrentTarget.Messages.AddMessage(SProgramStarted);411 Core.Messages.AddMessage(SProgramStarted); 408 412 end; 409 413 … … 432 436 procedure TFormMain.AViewCompilersExecute(Sender: TObject); 433 437 begin 434 if not Assigned(FormTargets) then FormTargets := TFormTargets.Create(Self); 435 FormTargets.Show; 438 with TFormTargets.Create(nil) do 439 try 440 ShowModal; 441 finally 442 Free; 443 end; 436 444 end; 437 445 … … 493 501 with Core.CurrentTarget do 494 502 try 503 Core.Messages.Clear; 495 504 AProgramStop.Execute; 496 505 SourceCode := FormSourceCode.SynEditSource.Text; … … 499 508 if Core.CurrentTarget is TBFTarget then 500 509 TBFTarget(Core.CurrentTarget).Optimizations := Core.Optimizations; 501 Core.CurrentTarget.Messages.AddMessage(SCompileStart); 510 DebugEnabled := Core.DebugEnabled; 511 Core.Messages.AddMessage(SCompileStart); 502 512 Application.ProcessMessages; 503 513 Compile; 504 Core. CurrentTarget.Messages.AppendMessage(SDone);514 Core.Messages.AppendMessage(SDone); 505 515 FormTargetCode.SynEditTarget.Text := TargetCode; 506 516 FormTargetCode.SetHighlighter(Core.CurrentTarget.SourceExtension); … … 509 519 on E: Exception do 510 520 MessageDlg(SError, E.Message, mtError, [mbOk], 0); 521 end; 522 end; 523 524 procedure TFormMain.AProgramCompileMultipleExecute(Sender: TObject); 525 var 526 I: Integer; 527 begin 528 AProgramStop.Execute; 529 with TFormCompileMultiple.Create(nil) do 530 try 531 Targets := Core.Targets; 532 if ShowModal = mrOk then begin 533 Core.Messages.Clear; 534 for I := 0 to Targets.Count - 1 do 535 with Targets[I] do 536 if Selected then 537 try 538 AProgramStop.Execute; 539 SourceCode := FormSourceCode.SynEditSource.Text; 540 ProjectFileName := Core.Project.FileName; 541 ProgramName := ExtractFileNameOnly(Core.Project.FileName); 542 if Targets[I] is TBFTarget then 543 TBFTarget(Targets[I]).Optimizations := Core.Optimizations; 544 DebugEnabled := Core.DebugEnabled; 545 Core.Messages.AddMessage(Name + ' ' + SCompileStart); 546 Application.ProcessMessages; 547 Compile; 548 Core.Messages.AppendMessage(SDone); 549 FormTargetCode.SynEditTarget.Text := TargetCode; 550 FormTargetCode.SetHighlighter(Core.CurrentTarget.SourceExtension); 551 UpdateInterface; 552 except 553 on E: Exception do 554 MessageDlg(SError, E.Message, mtError, [mbOk], 0); 555 end; 556 end; 557 finally 558 Free; 511 559 end; 512 560 end;
Note:
See TracChangeset
for help on using the changeset viewer.