Changeset 5 for trunk/Studio/UCore.pas


Ignore:
Timestamp:
Aug 2, 2012, 3:23:38 PM (12 years ago)
Author:
chronos
Message:
  • Added: LibreDevelopCommon package which supply API unit ULDStudioAPI.
  • Modified: Module LDStudioCommon now register forms, actions and menu items using API.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Studio/UCore.pas

    r1 r5  
    11unit UCore;
    22
    3 {$mode objfpc}{$H+}
     3{$mode delphi}{$H+}
    44
    55interface
    66
    77uses
    8   Classes, SysUtils, FileUtil;
     8  Classes, SysUtils, FileUtil, UModularSystem, ULDStudioAPI;
    99
    1010type
     11
     12  { TCore }
     13
    1114  TCore = class(TDataModule)
     15    procedure DataModuleCreate(Sender: TObject);
     16    procedure DataModuleDestroy(Sender: TObject);
    1217  private
    13     { private declarations }
     18    procedure RegisterModules;
    1419  public
    15     { public declarations }
     20    ModuleManager: TModuleManager;
     21    API: TLDStudioAPI;
     22    procedure Init;
    1623  end;
    1724
     
    2330{$R *.lfm}
    2431
     32uses
     33  ULDModuleDebug, UFormMain;
     34
     35{ TCore }
     36
     37procedure TCore.DataModuleCreate(Sender: TObject);
     38begin
     39  API := TLDStudioAPI.Create;
     40  ModuleManager := TModuleManager.Create(nil);
     41  ModuleManager.API := API;
     42end;
     43
     44procedure TCore.DataModuleDestroy(Sender: TObject);
     45begin
     46  FreeAndNil(ModuleManager);
     47  FreeAndNil(API);
     48end;
     49
     50procedure TCore.RegisterModules;
     51begin
     52  ModuleManager.RegisterModule(TLDModuleDebug.Create, True);
     53  ModuleManager.InstallMarked;
     54end;
     55
     56procedure TCore.Init;
     57begin
     58  TLDStudioAPI(ModuleManager.API).MainForm := FormMain;
     59  TLDStudioAPI(ModuleManager.API).MainMenu := FormMain.MainMenu1;
     60  RegisterModules;
     61end;
     62
    2563end.
    2664
Note: See TracChangeset for help on using the changeset viewer.