Changeset 15 for trunk/StudioCommon/USource.pas
- Timestamp:
- Aug 6, 2012, 2:35:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.