Changeset 133 for trunk/UCore.pas


Ignore:
Timestamp:
Mar 4, 2022, 10:57:08 PM (3 years ago)
Author:
chronos
Message:
  • Added: Compile multiple action for compilation of code with mutliple compilers at once.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r131 r133  
    2828    FCurrentTarget: TTarget;
    2929    StoredDimension: TControlDimension;
     30    procedure InitTargets;
    3031    procedure SetCurrentTarget(AValue: TTarget);
    3132    procedure ScaleDPI;
     33    procedure TargetMessageExecute(Text: string);
    3234  public
    3335    DataDir: string;
    3436    Project: TProject;
    35     Targets: TTargetList;
     37    Targets: TTargets;
     38    Messages: TMessages;
    3639    OpenProjectOnStart: Boolean;
    3740    OptimizationLevel: TCompilerOptimization;
     
    8285
    8386  Project := TProject.Create;
    84   Targets := TTargetList.Create;
     87  Targets := TTargets.Create;
     88  Messages := TMessages.Create;
     89
    8590  StoredDimension := TControlDimension.Create;
    86 
    87   // Init targets list
    88   Targets.Add(TTargetInterpretter.Create);
    89   Targets.Add(TTargetDelphi.Create);
    90   Targets.Add(TTargetFPC.Create);
    91   Targets.Add(TTargetPHP.Create);
    92   Targets.Add(TTargetC.Create);
    93   Targets.Add(TTargetJava.Create);
    94   Targets.Add(TTargetPython.Create);
    95   Targets.Add(TTargetCSharp.Create);
    96   Targets.Add(TTargetJavascript.Create);
    97 
     91  InitTargets;
    9892  LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext);
    9993end;
     
    10296begin
    10397  SaveToRegistry(Core.ApplicationInfo.GetRegistryContext);
     98  FreeAndNil(Messages);
    10499  FreeAndNil(Targets);
    105100  FreeAndNil(Project);
    106101  FreeAndNil(StoredDimension);
     102end;
     103
     104procedure TCore.InitTargets;
     105var
     106  I: Integer;
     107begin
     108  with Targets do begin
     109    Clear;
     110    Add(TTargetInterpretter.Create);
     111    Add(TTargetDelphi.Create);
     112    Add(TTargetFPC.Create);
     113    Add(TTargetPHP.Create);
     114    Add(TTargetC.Create);
     115    Add(TTargetJava.Create);
     116    Add(TTargetPython.Create);
     117    Add(TTargetCSharp.Create);
     118    Add(TTargetJavascript.Create);
     119    for I := 0 to Count - 1 do
     120      Items[I].OnMessage := TargetMessageExecute;
     121  end;
    107122end;
    108123
     
    170185    FCurrentTarget.OnLog := FormMain.TargetLogExecute;
    171186    FCurrentTarget.OptimizationLevel := OptimizationLevel;
    172     FCurrentTarget.Messages.OnChange := FormMain.MessagesChanged;
    173187    if FCurrentTarget is TBFTarget then begin
    174188      TBFTarget(FCurrentTarget).MemorySize := MemorySize;
     
    199213end;
    200214
     215procedure TCore.TargetMessageExecute(Text: string);
     216begin
     217  Messages.AddMessage(Text);
     218end;
     219
    201220procedure TCore.Init;
    202221begin
Note: See TracChangeset for help on using the changeset viewer.