Changeset 15 for trunk/StudioCommon
- Timestamp:
- Aug 6, 2012, 2:35:22 PM (12 years ago)
- Location:
- trunk/StudioCommon
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StudioCommon/LDStudioCommon.lpk
r14 r15 28 28 </Item2> 29 29 </Files> 30 <i18n> 31 <EnableI18N Value="True"/> 32 <OutDir Value="Languages"/> 33 <EnableI18NForLFM Value="True"/> 34 </i18n> 30 35 <Type Value="RunAndDesignTime"/> 31 <RequiredPkgs Count=" 4">36 <RequiredPkgs Count="5"> 32 37 <Item1> 33 <PackageName Value=" TemplateGenerics"/>38 <PackageName Value="Common"/> 34 39 </Item1> 35 40 <Item2> 36 <PackageName Value=" LCL"/>41 <PackageName Value="TemplateGenerics"/> 37 42 </Item2> 38 43 <Item3> 39 <PackageName Value=" ModularSystem"/>44 <PackageName Value="LCL"/> 40 45 </Item3> 41 46 <Item4> 47 <PackageName Value="ModularSystem"/> 48 </Item4> 49 <Item5> 42 50 <PackageName Value="FCL"/> 43 </Item 4>51 </Item5> 44 52 </RequiredPkgs> 45 53 <UsageOptions> -
trunk/StudioCommon/ULDStudioAPI.pas
r14 r15 7 7 uses 8 8 Classes, SysUtils, UModularSystem, ActnList, Menus, Forms, USource, 9 SpecializedList ;9 SpecializedList, URegistry; 10 10 11 11 type … … 19 19 TUnregisterMainMenuItemEvent = procedure (MenuItem: TMenuItem) of object; 20 20 TDockFormEvent = procedure (Form: TForm; Target: TDockTarget) of object; 21 TGetRegistryContextEvent = function: TRegistryContext of object; 22 TRegisterFileTemplateEvent = procedure (Template: TFileTemplate) of object; 21 23 22 24 { TLDStudioAPI } … … 25 27 private 26 28 FOnDockForm: TDockFormEvent; 29 FOnGetRegistryContext: TGetRegistryContextEvent; 27 30 FOnOpenFile: TOpenFileEvent; 28 31 FOnRegisterAction: TRegisterActionEvent; 32 FOnRegisterFileTemplate: TRegisterFileTemplateEvent; 29 33 FOnRegisterFileType: TRegisterFileTypeEvent; 30 34 FOnRegisterForm: TRegisterFormEvent; 31 35 FOnRegisterMainMenuItem: TRegisterMainMenuItemEvent; 32 36 FOnUnregisterAction: TRegisterActionEvent; 37 FOnUnregisterFileTemplate: TRegisterFileTemplateEvent; 33 38 FOnUnregisterFileType: TRegisterFileTypeEvent; 34 39 FOnUnregisterForm: TRegisterFormEvent; … … 42 47 procedure RegisterFileType(FileType: TSourceType); 43 48 procedure UnregisterFileType(FileType: TSourceType); 49 procedure RegisterFileTemplate(Template: TFileTemplate); 50 procedure UnregisterFileTemplate(Template: TFileTemplate); 44 51 procedure RegisterForm(Form: TForm); 45 52 procedure UnregisterForm(Form: TForm); … … 50 57 procedure UnregisterMainMenuItem(MenuItem: TMenuItem); 51 58 procedure DockForm(Form: TForm; Target: TDockTarget); 52 59 function GetRegistryContext: TRegistryContext; 53 60 published 54 61 // API handling … … 71 78 read FOnUnregisterMainMenuItem write FOnUnregisterMainMenuItem; 72 79 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; 73 86 end; 74 87 … … 110 123 if Assigned(FOnUnregisterFileType) then 111 124 FOnUnregisterFileType(FileType); 125 end; 126 127 procedure TLDStudioAPI.RegisterFileTemplate(Template: TFileTemplate); 128 begin 129 if Assigned(FOnRegisterFileTemplate) then 130 FOnRegisterFileTemplate(Template); 131 end; 132 133 procedure TLDStudioAPI.UnregisterFileTemplate(Template: TFileTemplate); 134 begin 135 if Assigned(FOnUnregisterFileTemplate) then 136 FOnUnregisterFileTemplate(Template); 112 137 end; 113 138 … … 155 180 end; 156 181 182 function TLDStudioAPI.GetRegistryContext: TRegistryContext; 183 begin 184 if Assigned(FOnGetRegistryContext) then 185 Result := FOnGetRegistryContext(); 186 end; 187 157 188 end. 158 189 -
trunk/StudioCommon/USource.pas
r8 r15 6 6 7 7 uses 8 Classes, SysUtils, SpecializedList ;8 Classes, SysUtils, SpecializedList, Forms; 9 9 10 10 type 11 12 { TSourceType } 13 11 14 TSourceType = class 12 15 Extension: string; 13 16 Title: string; 17 Form: TForm; 18 constructor Create; virtual; 14 19 end; 20 21 TFileTypeClass = class of TSourceType; 15 22 16 23 { TFileTypes } … … 20 27 end; 21 28 29 { TSource } 30 22 31 TSource = class 23 Name: string; 32 private 33 FName: string; 34 procedure SetName(AValue: string); 35 public 36 Modified: Boolean; 37 Form: TForm; 38 property Name: string read FName write SetName; 24 39 end; 25 40 … … 29 44 Items: TListObject; // TListObject<TSource> 30 45 Main: TSource; 46 end; 47 48 { TFileTemplate } 49 50 TFileTemplate = class 51 public 52 Name: string; 53 Description: TStringList; 54 FileTypeClass: TSourceType; 55 constructor Create; virtual; 56 destructor Destroy; override; 57 function Execute: TSource; virtual; 58 end; 59 60 TFileTemplates = class(TListObject) 31 61 end; 32 62 … … 54 84 TConvertorClass = class of TConvertor; 55 85 86 { TSourceText } 87 56 88 TSourceText = class(TSource) 57 Content: string; 58 InMemory: Boolean; 89 private 90 public 91 Loaded: Boolean; 92 Content: TStringList; 93 constructor Create; 94 destructor Destroy; override; 59 95 end; 96 60 97 61 98 … … 64 101 resourcestring 65 102 SAllFiles = 'All files'; 103 104 { TSourceType } 105 106 constructor TSourceType.Create; 107 begin 108 inherited; 109 end; 110 111 procedure TSource.SetName(AValue: string); 112 begin 113 if FName = AValue then Exit; 114 FName := AValue; 115 if Assigned(Form) then 116 Form.Caption := ExtractFileName(FName); 117 end; 118 119 120 { TFileTemplate } 121 122 constructor TFileTemplate.Create; 123 begin 124 Description := TStringList.Create; 125 end; 126 127 destructor TFileTemplate.Destroy; 128 begin 129 Description.Free; 130 inherited Destroy; 131 end; 132 133 function TFileTemplate.Execute: TSource; 134 begin 135 136 end; 137 66 138 67 139 { TFileTypes } … … 97 169 end; 98 170 171 { TSourceText } 172 173 constructor TSourceText.Create; 174 begin 175 Content := TStringList.Create; 176 end; 177 178 destructor TSourceText.Destroy; 179 begin 180 Content.Free; 181 inherited Destroy; 182 end; 183 99 184 end. 100 185
Note:
See TracChangeset
for help on using the changeset viewer.