Changeset 5


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
Files:
22 added
2 deleted
6 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
  • trunk/StudioPackage/Forms/UFormMain.lfm

    r4 r5  
    55  Width = 747
    66  Caption = 'LibreDevelop Studio'
    7   ClientHeight = 495
     7  ClientHeight = 501
    88  ClientWidth = 747
    99  Menu = MainMenu1
     
    1212  object StatusBar1: TStatusBar
    1313    Left = 0
    14     Height = 21
    15     Top = 474
     14    Height = 20
     15    Top = 481
    1616    Width = 747
    1717    Panels = <>
     
    4848  object PageControl1: TPageControl
    4949    Left = 547
    50     Height = 343
     50    Height = 350
    5151    Top = 26
    5252    Width = 200
     
    6262  object PageControl2: TPageControl
    6363    Left = 0
    64     Height = 343
     64    Height = 350
    6565    Top = 26
    6666    Width = 200
     
    7777    Left = 0
    7878    Height = 105
    79     Top = 369
     79    Top = 376
    8080    Width = 747
    8181    ActivePage = TabSheet3
     
    8989  object Splitter1: TSplitter
    9090    Left = 200
    91     Height = 343
     91    Height = 350
    9292    Top = 26
    9393    Width = 5
     
    9595  object Splitter2: TSplitter
    9696    Left = 542
    97     Height = 343
     97    Height = 350
    9898    Top = 26
    9999    Width = 5
     
    103103  object PageControl4: TPageControl
    104104    Left = 205
    105     Height = 343
     105    Height = 350
    106106    Top = 26
    107107    Width = 337
  • trunk/StudioPackage/LibreDevelopStudio.lpk

    r4 r5  
    5151    </i18n>
    5252    <Type Value="RunAndDesignTime"/>
    53     <RequiredPkgs Count="4">
     53    <RequiredPkgs Count="5">
    5454      <Item1>
    55         <PackageName Value="synedit"/>
     55        <PackageName Value="LDStudioCommon"/>
    5656      </Item1>
    5757      <Item2>
    58         <PackageName Value="TemplateGenerics"/>
     58        <PackageName Value="synedit"/>
    5959      </Item2>
    6060      <Item3>
    61         <PackageName Value="LCL"/>
     61        <PackageName Value="TemplateGenerics"/>
    6262      </Item3>
    6363      <Item4>
     64        <PackageName Value="LCL"/>
     65      </Item4>
     66      <Item5>
    6467        <PackageName Value="FCL"/>
    65       </Item4>
     68      </Item5>
    6669    </RequiredPkgs>
    6770    <UsageOptions>
Note: See TracChangeset for help on using the changeset viewer.