Changeset 60 for trunk/Packages/Kernel/Kernel.Graphics.pas
- Timestamp:
- Apr 7, 2024, 11:26:09 PM (10 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Kernel/Kernel.Graphics.pas
r59 r60 1 unit UGraphics; 2 3 {$mode delphi} 1 unit Kernel.Graphics; 4 2 5 3 interface 6 4 7 5 uses 8 SysUtils, fgl;6 SysUtils, Generics.Collections; 9 7 10 8 type … … 16 14 X: Integer; 17 15 Y: Integer; 18 function Create(X, Y: Integer): TPoint; inline;16 class function Create(X, Y: Integer): TPoint; inline; static; 19 17 function Add(P: TPoint): TPoint; 20 18 end; … … 36 34 Size: TPoint; 37 35 function PointInside(P: TPoint): Boolean; 38 function Create(Left, Top, Width, Height: Integer): TRectangle; overload; inline;39 function Create(Position, Size: TPoint): TRectangle; overload; inline;36 class function Create(Left, Top, Width, Height: Integer): TRectangle; overload; inline; static; 37 class function Create(Position, Size: TPoint): TRectangle; overload; inline; static; 40 38 function AddPoint(P: TPoint): TRectangle; 41 39 property Left: Integer read GetLeft write SetLeft; … … 88 86 89 87 TRaster = class(TGraphicObject) 90 91 88 end; 92 89 93 90 TFont = class(TGraphicObject) 94 95 91 end; 96 92 … … 102 98 CanvasLastId: Integer; 103 99 public 104 Objects: T FPGObjectList<TGraphicObject>;105 Canvases: T FPGObjectList<TCanvas>;100 Objects: TObjectList<TGraphicObject>; 101 Canvases: TObjectList<TCanvas>; 106 102 ParentCanvas: TCanvas; 107 103 function CreateWindow: TWindow; … … 114 110 end; 115 111 112 116 113 implementation 117 114 … … 164 161 end; 165 162 166 function TRectangle.Create(Left, Top, Width, Height: Integer): TRectangle;163 class function TRectangle.Create(Left, Top, Width, Height: Integer): TRectangle; 167 164 begin 168 165 Result.Position.X := Left; … … 172 169 end; 173 170 174 function TRectangle.Create(Position, Size: TPoint): TRectangle;171 class function TRectangle.Create(Position, Size: TPoint): TRectangle; 175 172 begin 176 173 Result.Position := Position; … … 186 183 { TPoint } 187 184 188 function TPoint.Create(X, Y: Integer): TPoint;185 class function TPoint.Create(X, Y: Integer): TPoint; 189 186 begin 190 187 Result.X := X; … … 263 260 destructor TWindow.Destroy; 264 261 begin 265 inherited Destroy;262 inherited; 266 263 end; 267 264 … … 317 314 constructor TDesktop.Create; 318 315 begin 319 Objects := T FPGObjectList<TGraphicObject>.Create;320 Canvases := T FPGObjectList<TCanvas>.Create;316 Objects := TObjectList<TGraphicObject>.Create; 317 Canvases := TObjectList<TCanvas>.Create; 321 318 end; 322 319 … … 325 322 FreeAndNil(Canvases); 326 323 FreeAndNil(Objects); 327 inherited Destroy;324 inherited; 328 325 end; 329 326
Note:
See TracChangeset
for help on using the changeset viewer.