Changeset 133 for trunk/UCore.pas
- Timestamp:
- Mar 4, 2022, 10:57:08 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r131 r133 28 28 FCurrentTarget: TTarget; 29 29 StoredDimension: TControlDimension; 30 procedure InitTargets; 30 31 procedure SetCurrentTarget(AValue: TTarget); 31 32 procedure ScaleDPI; 33 procedure TargetMessageExecute(Text: string); 32 34 public 33 35 DataDir: string; 34 36 Project: TProject; 35 Targets: TTargetList; 37 Targets: TTargets; 38 Messages: TMessages; 36 39 OpenProjectOnStart: Boolean; 37 40 OptimizationLevel: TCompilerOptimization; … … 82 85 83 86 Project := TProject.Create; 84 Targets := TTargetList.Create; 87 Targets := TTargets.Create; 88 Messages := TMessages.Create; 89 85 90 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; 98 92 LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext); 99 93 end; … … 102 96 begin 103 97 SaveToRegistry(Core.ApplicationInfo.GetRegistryContext); 98 FreeAndNil(Messages); 104 99 FreeAndNil(Targets); 105 100 FreeAndNil(Project); 106 101 FreeAndNil(StoredDimension); 102 end; 103 104 procedure TCore.InitTargets; 105 var 106 I: Integer; 107 begin 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; 107 122 end; 108 123 … … 170 185 FCurrentTarget.OnLog := FormMain.TargetLogExecute; 171 186 FCurrentTarget.OptimizationLevel := OptimizationLevel; 172 FCurrentTarget.Messages.OnChange := FormMain.MessagesChanged;173 187 if FCurrentTarget is TBFTarget then begin 174 188 TBFTarget(FCurrentTarget).MemorySize := MemorySize; … … 199 213 end; 200 214 215 procedure TCore.TargetMessageExecute(Text: string); 216 begin 217 Messages.AddMessage(Text); 218 end; 219 201 220 procedure TCore.Init; 202 221 begin
Note:
See TracChangeset
for help on using the changeset viewer.