Changeset 33 for trunk/Packages/FastGraphics/UFGraphics.pas
- Timestamp:
- Jan 5, 2017, 11:48:36 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/FastGraphics/UFGraphics.pas
r31 r33 6 6 7 7 uses 8 Classes, SysUtils, Graphics, UGGraphics, UPixmapSpecialized, Contnrs;8 Classes, SysUtils, Graphics, UGGraphics, UPixmapSpecialized, Fgl; 9 9 10 10 type … … 81 81 end; 82 82 83 TColorFormats = class(TFPGObjectList<TColorFormat>) 84 end; 85 83 86 TColorFormatClass = class of TColorFormat; 84 87 … … 87 90 TColorFormatManager = class 88 91 private 89 FFormats: T ObjectList; // TList<TColorFormat>92 FFormats: TColorFormats; 90 93 function GetFormat(Index: Integer): TColorFormat; 91 94 public 92 95 constructor Create; virtual; 93 destructor Destroy; override; 96 destructor Destroy; override; 97 function FindByName(Name: string): Integer; 94 98 procedure RegisterFormat(Format: TColorFormatClass); 95 99 function FormatCount: Integer; 96 property Formats [Index: Integer]: TColorFormat read GetFormat;100 property Formats: TColorFormats read FFormats; 97 101 end; 98 102 … … 261 265 constructor TColorFormatManager.Create; 262 266 begin 263 FFormats := T ObjectList.Create;267 FFormats := TColorFormats.Create; 264 268 end; 265 269 … … 268 272 FreeAndNil(FFormats); 269 273 inherited Destroy; 274 end; 275 276 function TColorFormatManager.FindByName(Name: string): Integer; 277 var 278 I: Integer; 279 begin 280 Result := -1; 281 for I := 0 to FFormats.Count - 1 do begin 282 if FFormats[I].Name = Name then begin 283 Result := I; 284 Break; 285 end; 286 end; 270 287 end; 271 288
Note:
See TracChangeset
for help on using the changeset viewer.