Changeset 9 for trunk/Studio


Ignore:
Timestamp:
Aug 3, 2012, 1:34:09 PM (12 years ago)
Author:
chronos
Message:
  • Added: Form for application runtime module management.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Studio/UCore.pas

    r8 r9  
    1818    procedure RegisterModules;
    1919  public
    20     ModuleManager: TModuleManager;
    21     API: TLDStudioAPI;
    2220    procedure Init;
    2321  end;
     
    3836begin
    3937  DataModule1 := TDataModule1.Create(nil);
    40   API := TLDStudioAPI.Create;
    41   ModuleManager := TModuleManager.Create(nil);
    42   ModuleManager.API := API;
    4338end;
    4439
    4540procedure TCore.DataModuleDestroy(Sender: TObject);
    4641begin
    47   FreeAndNil(ModuleManager);
    48   FreeAndNil(API);
    4942  FreeAndNil(DataModule1);
    5043end;
     
    5245procedure TCore.RegisterModules;
    5346begin
    54   ModuleManager.RegisterModule(TLDModuleDebug.Create, True);
    55   ModuleManager.RegisterModule(TLDModuleBrainfuck.Create, True);
    56   ModuleManager.RegisterModule(TLDModulePascal.Create, True);
    57   ModuleManager.InstallMarked;
     47  with DataModule1.ModuleManager do begin
     48    RegisterModule(TLDModuleDebug.Create, True);
     49    RegisterModule(TLDModuleBrainfuck.Create, True);
     50    RegisterModule(TLDModulePascal.Create, True);
     51    InstallMarked;
     52  end;
    5853end;
    5954
    6055procedure TCore.Init;
    6156begin
    62   TLDStudioAPI(ModuleManager.API).MainForm := FormMain;
    63   TLDStudioAPI(ModuleManager.API).MainMenu := FormMain.MainMenu;
    64   TLDStudioAPI(ModuleManager.API).FileTypes := DataModule1.FileTypes;
    6557  RegisterModules;
    6658end;
Note: See TracChangeset for help on using the changeset viewer.