Changeset 75 for trunk/IDE/Core.pas
- Timestamp:
- Jun 4, 2024, 12:22:49 AM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Core.pas
r74 r75 1 unit UCore; 2 3 {$mode delphi} 1 unit Core; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, FileUtil, ULastOpenedList, UProject, UApplicationInfo,9 UCompiler, URegistry, Registry, UDebugLog, UCoolTranslator, UTarget,10 USourceCodePascal, UModularSystem;6 Classes, SysUtils, FileUtil, LastOpenedList, Project, ApplicationInfo, 7 Compiler, Registry, RegistryEx, DebugLog, Translator, Target, 8 SourceCodePascal, ModularSystem; 11 9 12 10 type … … 32 30 TCore = class(TDataModule) 33 31 ApplicationInfo: TApplicationInfo; 34 CoolTranslator1: TCoolTranslator;32 Translator1: TTranslator; 35 33 DebugLog1: TDebugLog; 36 34 LastOpenedFiles: TLastOpenedList; … … 47 45 LogParsing: Boolean; 48 46 Project: TProject; 49 ProjectTemplates: TProjectTemplate List;47 ProjectTemplates: TProjectTemplates; 50 48 TargetProject: TProject; 51 49 Compiler: TCustomCompiler; … … 69 67 70 68 uses 71 UFormMain, UProjectTemplates, UIDEModulePascal, UModulePascal, UModuleGCC,72 UModuleInterpretter, UModuleDelphi, UModulePHP, UModuleJava, UModuleASM8051;69 FormMain, ProjectTemplates, IDEModulePascal, ModulePascal, ModuleGCC, 70 ModuleInterpretter, ModuleDelphi, ModulePHP, ModuleJava, ModuleASM8051; 73 71 74 72 { TCore } … … 79 77 Project.LoadFromFile(FileName); 80 78 LastOpenedFiles.AddItem(FileName); 81 FormMain. UpdateInterface;79 FormMain.FormMain.UpdateInterface; 82 80 end; 83 81 … … 102 100 //Compiler.OnSaveTarget := SaveSourceFile; 103 101 Project := TProject.Create; 104 ProjectTemplates := TProjectTemplate List.Create;102 ProjectTemplates := TProjectTemplates.Create; 105 103 TargetProject := TProject.Create; 106 104 LastOpenedFiles := TLastOpenedList.Create(nil); … … 136 134 procedure TCore.LastOpenedFilesChange(Sender: TObject); 137 135 begin 138 LastOpenedFiles.LoadToMenuItem(FormMain. MenuItemOpenRecent,139 FormMain. OpenRecentClick);140 LastOpenedFiles.LoadToMenuItem(FormMain. PopupMenu1.Items,141 FormMain. OpenRecentClick);136 LastOpenedFiles.LoadToMenuItem(FormMain.FormMain.MenuItemOpenRecent, 137 FormMain.FormMain.OpenRecentClick); 138 LastOpenedFiles.LoadToMenuItem(FormMain.FormMain.PopupMenu1.Items, 139 FormMain.FormMain.OpenRecentClick); 142 140 end; 143 141 144 142 procedure TCore.ProjectChange(Sender: TObject); 145 143 begin 146 FormMain. UpdateInterface;144 FormMain.FormMain.UpdateInterface; 147 145 end; 148 146 149 147 function TCore.LoadSourceFile(FileName: string; var Content: string): Boolean; 150 148 begin 151 152 149 end; 153 150 154 151 function TCore.SaveSourceFile(FileName: string; const Content: string): Boolean; 155 152 begin 156 157 153 end; 158 154 … … 173 169 else LogParsing := False; 174 170 if ValueExists('LanguageCode') then 175 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(ReadString('LanguageCode'))176 else CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode('');171 Translator1.Language := Translator1.Languages.SearchByCode(ReadString('LanguageCode')) 172 else Translator1.Language := Translator1.Languages.SearchByCode(''); 177 173 finally 178 174 Free; 179 175 end; 180 LastOpenedFiles.LoadFromRegistry( RegContext(Root, Key + '\LastOpenedFiles')); //Root, Key + '\LastOpenedFiles');176 LastOpenedFiles.LoadFromRegistry(TRegistryContext.Create(Root, Key + '\LastOpenedFiles')); //Root, Key + '\LastOpenedFiles'); 181 177 Compiler.LoadFromRegistry(Root, Key + '\Compiler'); 182 FormMain. LoadFromRegistry(Root, Key);178 FormMain.FormMain.LoadFromRegistry(Root, Key); 183 179 end; 184 180 … … 194 190 else WriteString('TargetName', ''); 195 191 WriteBool('LogParsing', LogParsing); 196 if Assigned( CoolTranslator1.Language) and (CoolTranslator1.Language.Code <> '') then197 WriteString('LanguageCode', CoolTranslator1.Language.Code)192 if Assigned(Translator1.Language) and (Translator1.Language.Code <> '') then 193 WriteString('LanguageCode', Translator1.Language.Code) 198 194 else WriteString('LanguageCode', ''); 199 195 finally 200 196 Free; 201 197 end; 202 LastOpenedFiles.SaveToRegistry( RegContext(Root, Key + '\LastOpenedFiles'));198 LastOpenedFiles.SaveToRegistry(TRegistryContext.Create(Root, Key + '\LastOpenedFiles')); 203 199 Compiler.SaveToRegistry(Root, Key + '\Compiler'); 204 FormMain. SaveToRegistry(Root, Key);200 FormMain.FormMain.SaveToRegistry(Root, Key); 205 201 end; 206 202 … … 237 233 Name := 'System'; 238 234 Internal := True; 239 with TType(Body.Types.AddNew(TType.Create))do begin235 with Body.Types.AddNew do begin 240 236 Name := 'Byte'; 241 237 Size := 1; 242 238 Internal := True; 243 239 end; 244 with TType(Body.Types.AddNew(TType.Create))do begin240 with Body.Types.AddNew do begin 245 241 Name := 'ShortInt'; 246 242 Size := 1; 247 243 Internal := True; 248 244 end; 249 with TType(Body.Types.AddNew(TType.Create))do begin245 with Body.Types.AddNew do begin 250 246 Name := 'Word'; 251 247 Size := 2; 252 248 Internal := True; 253 249 end; 254 with TType(Body.Types.AddNew(TType.Create))do begin250 with Body.Types.AddNew do begin 255 251 Name := 'SmallInt'; 256 252 Size := 2; 257 253 Internal := True; 258 254 end; 259 with TType(Body.Types.AddNew(TType.Create))do begin255 with Body.Types.AddNew do begin 260 256 Name := 'Cardinal'; 261 257 Size := 4; 262 258 Internal := True; 263 259 end; 264 with TType(Body.Types.AddNew(TType.Create))do begin260 with Body.Types.AddNew do begin 265 261 Name := 'Integer'; 266 262 Size := 4; 267 263 Internal := True; 268 264 end; 269 with TType(Body.Types.AddNew(TType.Create))do begin265 with Body.Types.AddNew do begin 270 266 Name := 'UInt64'; 271 267 Size := 8; 272 268 Internal := True; 273 269 end; 274 with TType(Body.Types.AddNew(TType.Create))do begin270 with Body.Types.AddNew do begin 275 271 Name := 'Int64'; 276 272 Size := 8; 277 273 Internal := True; 278 274 end; 279 with TFunction(Body.Functions.AddNew(TFunction.Create))do begin275 with Body.Functions.AddNew do begin 280 276 Name := 'WriteLn'; 281 277 Internal := True;
Note:
See TracChangeset
for help on using the changeset viewer.