Changeset 67 for trunk/UCore.pas


Ignore:
Timestamp:
Jan 17, 2015, 4:08:03 PM (10 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r64 r67  
    2020    procedure DataModuleDestroy(Sender: TObject);
    2121  private
     22    FCurrentTarget: TTarget;
     23    procedure SetCurrentTarget(AValue: TTarget);
    2224  public
    2325    ScaleDPI: TScaleDPI;
     
    2830    procedure LoadFromRegistry(Root: HKEY; Key: string);
    2931    procedure SaveToRegistry(Root: HKEY; Key: string);
     32    property CurrentTarget: TTarget read FCurrentTarget write SetCurrentTarget;
    3033  end;
    3134
     
    3942
    4043uses
    41   UTargetJava, UTargetDelphi, UTargetPHP, UTargetC, UTargetInterpretter, UTargetFPC;
     44  UFormMain, UTargetJava, UTargetDelphi, UTargetPHP, UTargetC,
     45  UTargetInterpretter, UTargetFPC;
    4246
    4347
     
    110114end;
    111115
     116procedure TCore.SetCurrentTarget(AValue: TTarget);
     117var
     118  I: Integer;
     119begin
     120  if FCurrentTarget = AValue then Exit;
     121  FCurrentTarget := AValue;
     122  for I := 0 to Targets.Count - 1 do
     123    TTarget(Targets[I]).OnChangeState := nil;
     124  if Assigned(FCurrentTarget) then begin
     125    FCurrentTarget.OnChangeState := FormMain.TargetStateChanged;
     126    FCurrentTarget.OnLog := FormMain.TargetLogExecute;
     127    FCurrentTarget.OptimizationLevel := OptimizationLevel;
     128    FCurrentTarget.Messages.OnChange := FormMain.MessagesChanged;
     129  end;
     130  FormMain.UpdateTargetList;
     131  FormMain.UpdateInterface;
     132end;
     133
     134
    112135end.
    113136
Note: See TracChangeset for help on using the changeset viewer.