Ignore:
Timestamp:
Aug 6, 2012, 2:35:22 PM (12 years ago)
Author:
chronos
Message:
  • Added: Registration of new file templates for modules.
  • Added: Program stores last opened file list in registry.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/StudioCommon/ULDStudioAPI.pas

    r14 r15  
    77uses
    88  Classes, SysUtils, UModularSystem, ActnList, Menus, Forms, USource,
    9   SpecializedList;
     9  SpecializedList, URegistry;
    1010
    1111type
     
    1919  TUnregisterMainMenuItemEvent = procedure (MenuItem: TMenuItem) of object;
    2020  TDockFormEvent = procedure (Form: TForm; Target: TDockTarget) of object;
     21  TGetRegistryContextEvent = function: TRegistryContext of object;
     22  TRegisterFileTemplateEvent = procedure (Template: TFileTemplate) of object;
    2123
    2224  { TLDStudioAPI }
     
    2527  private
    2628    FOnDockForm: TDockFormEvent;
     29    FOnGetRegistryContext: TGetRegistryContextEvent;
    2730    FOnOpenFile: TOpenFileEvent;
    2831    FOnRegisterAction: TRegisterActionEvent;
     32    FOnRegisterFileTemplate: TRegisterFileTemplateEvent;
    2933    FOnRegisterFileType: TRegisterFileTypeEvent;
    3034    FOnRegisterForm: TRegisterFormEvent;
    3135    FOnRegisterMainMenuItem: TRegisterMainMenuItemEvent;
    3236    FOnUnregisterAction: TRegisterActionEvent;
     37    FOnUnregisterFileTemplate: TRegisterFileTemplateEvent;
    3338    FOnUnregisterFileType: TRegisterFileTypeEvent;
    3439    FOnUnregisterForm: TRegisterFormEvent;
     
    4247    procedure RegisterFileType(FileType: TSourceType);
    4348    procedure UnregisterFileType(FileType: TSourceType);
     49    procedure RegisterFileTemplate(Template: TFileTemplate);
     50    procedure UnregisterFileTemplate(Template: TFileTemplate);
    4451    procedure RegisterForm(Form: TForm);
    4552    procedure UnregisterForm(Form: TForm);
     
    5057    procedure UnregisterMainMenuItem(MenuItem: TMenuItem);
    5158    procedure DockForm(Form: TForm; Target: TDockTarget);
    52 
     59    function GetRegistryContext: TRegistryContext;
    5360  published
    5461    // API handling
     
    7178      read FOnUnregisterMainMenuItem write FOnUnregisterMainMenuItem;
    7279    property OnDockForm: TDockFormEvent read FOnDockForm write FOnDockForm;
     80    property OnGetRegistryContext: TGetRegistryContextEvent
     81      read FOnGetRegistryContext write FOnGetRegistryContext;
     82    property OnRegisterFileTemplate: TRegisterFileTemplateEvent
     83      read FOnRegisterFileTemplate write FOnRegisterFileTemplate;
     84    property OnUnregisterFileTemplate: TRegisterFileTemplateEvent
     85      read FOnUnregisterFileTemplate write FOnUnregisterFileTemplate;
    7386  end;
    7487
     
    110123  if Assigned(FOnUnregisterFileType) then
    111124    FOnUnregisterFileType(FileType);
     125end;
     126
     127procedure TLDStudioAPI.RegisterFileTemplate(Template: TFileTemplate);
     128begin
     129  if Assigned(FOnRegisterFileTemplate) then
     130    FOnRegisterFileTemplate(Template);
     131end;
     132
     133procedure TLDStudioAPI.UnregisterFileTemplate(Template: TFileTemplate);
     134begin
     135  if Assigned(FOnUnregisterFileTemplate) then
     136    FOnUnregisterFileTemplate(Template);
    112137end;
    113138
     
    155180end;
    156181
     182function TLDStudioAPI.GetRegistryContext: TRegistryContext;
     183begin
     184  if Assigned(FOnGetRegistryContext) then
     185    Result := FOnGetRegistryContext();
     186end;
     187
    157188end.
    158189
Note: See TracChangeset for help on using the changeset viewer.