Changeset 75 for trunk/IDE/Core.pas


Ignore:
Timestamp:
Jun 4, 2024, 12:22:49 AM (5 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from unit names.
  • Modified: Updated Common package.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/IDE/Core.pas

    r74 r75  
    1 unit UCore;
    2 
    3 {$mode delphi}
     1unit Core;
    42
    53interface
    64
    75uses
    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;
    119
    1210type
     
    3230  TCore = class(TDataModule)
    3331    ApplicationInfo: TApplicationInfo;
    34     CoolTranslator1: TCoolTranslator;
     32    Translator1: TTranslator;
    3533    DebugLog1: TDebugLog;
    3634    LastOpenedFiles: TLastOpenedList;
     
    4745    LogParsing: Boolean;
    4846    Project: TProject;
    49     ProjectTemplates: TProjectTemplateList;
     47    ProjectTemplates: TProjectTemplates;
    5048    TargetProject: TProject;
    5149    Compiler: TCustomCompiler;
     
    6967
    7068uses
    71   UFormMain, UProjectTemplates, UIDEModulePascal, UModulePascal, UModuleGCC,
    72   UModuleInterpretter, UModuleDelphi, UModulePHP, UModuleJava, UModuleASM8051;
     69  FormMain, ProjectTemplates, IDEModulePascal, ModulePascal, ModuleGCC,
     70  ModuleInterpretter, ModuleDelphi, ModulePHP, ModuleJava, ModuleASM8051;
    7371
    7472{ TCore }
     
    7977  Project.LoadFromFile(FileName);
    8078  LastOpenedFiles.AddItem(FileName);
    81   FormMain.UpdateInterface;
     79  FormMain.FormMain.UpdateInterface;
    8280end;
    8381
     
    102100  //Compiler.OnSaveTarget := SaveSourceFile;
    103101  Project := TProject.Create;
    104   ProjectTemplates := TProjectTemplateList.Create;
     102  ProjectTemplates := TProjectTemplates.Create;
    105103  TargetProject := TProject.Create;
    106104  LastOpenedFiles := TLastOpenedList.Create(nil);
     
    136134procedure TCore.LastOpenedFilesChange(Sender: TObject);
    137135begin
    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);
    142140end;
    143141
    144142procedure TCore.ProjectChange(Sender: TObject);
    145143begin
    146   FormMain.UpdateInterface;
     144  FormMain.FormMain.UpdateInterface;
    147145end;
    148146
    149147function TCore.LoadSourceFile(FileName: string; var Content: string): Boolean;
    150148begin
    151 
    152149end;
    153150
    154151function TCore.SaveSourceFile(FileName: string; const Content: string): Boolean;
    155152begin
    156 
    157153end;
    158154
     
    173169        else LogParsing := False;
    174170      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('');
    177173    finally
    178174      Free;
    179175    end;
    180   LastOpenedFiles.LoadFromRegistry(RegContext(Root, Key + '\LastOpenedFiles')); //Root, Key + '\LastOpenedFiles');
     176  LastOpenedFiles.LoadFromRegistry(TRegistryContext.Create(Root, Key + '\LastOpenedFiles')); //Root, Key + '\LastOpenedFiles');
    181177  Compiler.LoadFromRegistry(Root, Key + '\Compiler');
    182   FormMain.LoadFromRegistry(Root, Key);
     178  FormMain.FormMain.LoadFromRegistry(Root, Key);
    183179end;
    184180
     
    194190        else WriteString('TargetName', '');
    195191      WriteBool('LogParsing', LogParsing);
    196       if Assigned(CoolTranslator1.Language) and (CoolTranslator1.Language.Code <> '') then
    197         WriteString('LanguageCode', CoolTranslator1.Language.Code)
     192      if Assigned(Translator1.Language) and (Translator1.Language.Code <> '') then
     193        WriteString('LanguageCode', Translator1.Language.Code)
    198194        else WriteString('LanguageCode', '');
    199195    finally
    200196      Free;
    201197    end;
    202   LastOpenedFiles.SaveToRegistry(RegContext(Root, Key + '\LastOpenedFiles'));
     198  LastOpenedFiles.SaveToRegistry(TRegistryContext.Create(Root, Key + '\LastOpenedFiles'));
    203199  Compiler.SaveToRegistry(Root, Key + '\Compiler');
    204   FormMain.SaveToRegistry(Root, Key);
     200  FormMain.FormMain.SaveToRegistry(Root, Key);
    205201end;
    206202
     
    237233    Name := 'System';
    238234    Internal := True;
    239     with TType(Body.Types.AddNew(TType.Create)) do begin
     235    with Body.Types.AddNew do begin
    240236      Name := 'Byte';
    241237      Size := 1;
    242238      Internal := True;
    243239    end;
    244     with TType(Body.Types.AddNew(TType.Create)) do begin
     240    with Body.Types.AddNew do begin
    245241      Name := 'ShortInt';
    246242      Size := 1;
    247243      Internal := True;
    248244    end;
    249     with TType(Body.Types.AddNew(TType.Create)) do begin
     245    with Body.Types.AddNew do begin
    250246      Name := 'Word';
    251247      Size := 2;
    252248      Internal := True;
    253249    end;
    254     with TType(Body.Types.AddNew(TType.Create)) do begin
     250    with Body.Types.AddNew do begin
    255251      Name := 'SmallInt';
    256252      Size := 2;
    257253      Internal := True;
    258254    end;
    259     with TType(Body.Types.AddNew(TType.Create)) do begin
     255    with Body.Types.AddNew do begin
    260256      Name := 'Cardinal';
    261257      Size := 4;
    262258      Internal := True;
    263259    end;
    264     with TType(Body.Types.AddNew(TType.Create)) do begin
     260    with Body.Types.AddNew do begin
    265261      Name := 'Integer';
    266262      Size := 4;
    267263      Internal := True;
    268264    end;
    269     with TType(Body.Types.AddNew(TType.Create)) do begin
     265    with Body.Types.AddNew do begin
    270266      Name := 'UInt64';
    271267      Size := 8;
    272268      Internal := True;
    273269    end;
    274     with TType(Body.Types.AddNew(TType.Create)) do begin
     270    with Body.Types.AddNew do begin
    275271      Name := 'Int64';
    276272      Size := 8;
    277273      Internal := True;
    278274    end;
    279     with TFunction(Body.Functions.AddNew(TFunction.Create)) do begin
     275    with Body.Functions.AddNew do begin
    280276      Name := 'WriteLn';
    281277      Internal := True;
Note: See TracChangeset for help on using the changeset viewer.