Changeset 5 for trunk/Studio


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.
Location:
trunk/Studio
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Studio/LibreDevelopStudio.lpi

    r4 r5  
    3333      </local>
    3434    </RunParams>
    35     <RequiredPackages Count="2">
     35    <RequiredPackages Count="3">
    3636      <Item1>
    37         <PackageName Value="LibreDevelopStudio"/>
     37        <PackageName Value="LDModuleDebug"/>
    3838      </Item1>
    3939      <Item2>
     40        <PackageName Value="LibreDevelopStudio"/>
     41      </Item2>
     42      <Item3>
    4043        <PackageName Value="LCL"/>
    41       </Item2>
     44      </Item3>
    4245    </RequiredPackages>
    4346    <Units Count="2">
  • trunk/Studio/LibreDevelopStudio.lpr

    r4 r5  
    1717  Application.CreateForm(TCore, Core);
    1818  Application.CreateForm(TDataModule1, DataModule1);
     19  Core.Init;
    1920  Application.Run;
    2021end.
  • trunk/Studio/UCore.lfm

    r1 r5  
    11object Core: TCore
     2  OnCreate = DataModuleCreate
     3  OnDestroy = DataModuleDestroy
    24  OldCreateOrder = False
    35  Height = 251
  • 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.