Changeset 17 for trunk/StudioModules
- Timestamp:
- Aug 7, 2012, 2:57:19 PM (12 years ago)
- Location:
- trunk/StudioModules
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StudioModules/LDModuleBasic/UFormSourceCode.pas
r16 r17 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, 9 SynEdit, SynHighlighterPas ;9 SynEdit, SynHighlighterPas, USource, ULDModuleBasic; 10 10 11 11 type … … 18 18 procedure SynEditSourceChange(Sender: TObject); 19 19 private 20 F FileName: string;20 FSource: TSource; 21 21 FOnChange: TNotifyEvent; 22 procedure Set FileName(AValue: string);22 procedure SetSource(AValue: TSource); 23 23 public 24 property FileName: string read FFileName write SetFileName;24 property Source: TSource read FSource write SetSource; 25 25 procedure Save; 26 26 procedure UpdateInterface; … … 45 45 end; 46 46 47 procedure TFormSourceCode.Set FileName(AValue: string);47 procedure TFormSourceCode.SetSource(AValue: TSource); 48 48 begin 49 if F FileName = AValue then Exit;50 F FileName := AValue;51 if FileExistsUTF8(FFileName) then52 SynEditSource.Lines. LoadFromFile(FFileName)49 if FSource = AValue then Exit; 50 FSource := AValue; 51 if Assigned(Source) and (Source is TSourceText) then 52 SynEditSource.Lines.Text := TSourceText(Source).Content.Text 53 53 else SynEditSource.ClearAll; 54 54 end; -
trunk/StudioModules/LDModuleBasic/ULDModuleBasic.pas
r16 r17 20 20 end; 21 21 22 { T TextFileType}22 { TSourceTypeText } 23 23 24 T TextFileType= class(TSourceType)24 TSourceTypeText = class(TSourceType) 25 25 constructor Create; override; 26 26 end; 27 27 28 { TTe xtTemplate}28 { TTemplateText } 29 29 30 TTe xtTemplate= class(TFileTemplate)30 TTemplateText = class(TFileTemplate) 31 31 constructor Create; override; 32 32 function Execute: TSource; override; … … 44 44 TLDModuleBasic = class(TModule) 45 45 TextFileType: TSourceType; 46 TextFileTemplate: TTe xtTemplate;46 TextFileTemplate: TTemplateText; 47 47 constructor Create; override; 48 48 procedure Install; override; … … 64 64 65 65 66 { TTe xtTemplate}66 { TTemplateText } 67 67 68 constructor TTe xtTemplate.Create;68 constructor TTemplateText.Create; 69 69 begin 70 70 inherited Create; … … 72 72 end; 73 73 74 function TTe xtTemplate.Execute: TSource;74 function TTemplateText.Execute: TSource; 75 75 begin 76 76 Result := TSourceText.Create; 77 77 Result.Name := STextFile; 78 Result.FileType := TSourceTypeText.Create; 78 79 end; 79 80 80 { T TextFileType}81 { TSourceTypeText } 81 82 82 constructor T TextFileType.Create;83 constructor TSourceTypeText.Create; 83 84 begin 84 85 inherited Create; 85 86 Extension := '.txt'; 86 87 Title := STextFile; 87 // Form := TSour; 88 Form := TFormSourceCode; 89 SourceClass := TSourceText; 88 90 end; 89 91 … … 119 121 FormSourceCode := TFormSourceCode.Create(nil); 120 122 RegisterForm(FormSourceCode); 121 TextFileType := T TextFileType.Create;123 TextFileType := TSourceTypeText.Create; 122 124 RegisterFileType(TextFileType); 123 TextFileTemplate := TTe xtTemplate.Create;125 TextFileTemplate := TTemplateText.Create; 124 126 RegisterFileTemplate(TextFileTemplate); 125 127 end; -
trunk/StudioModules/LDModuleProject/ULDModuleProject.pas
r16 r17 200 200 with TLDStudioAPI(API) do begin 201 201 UnregisterFileType(ProjectFileType); 202 FreeAndNil(ProjectFileType); 202 203 DataModuleProject.SaveToRegistry(RegContext(GetRegistryContext.RootKey, 203 204 GetRegistryContext.Key + '\Project'));
Note:
See TracChangeset
for help on using the changeset viewer.