| 1 | unit SpecializedRectangle;
|
|---|
| 2 |
|
|---|
| 3 | interface
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 6 | Classes, SysUtils, SpecializedPoint, Types;
|
|---|
| 7 |
|
|---|
| 8 | type
|
|---|
| 9 | {$MACRO ON}
|
|---|
| 10 |
|
|---|
| 11 | // TRectangle = TGRectangle<Integer>
|
|---|
| 12 | {$DEFINE TGRectangleDimension := Integer}
|
|---|
| 13 | {$DEFINE TGRectangle := TBaseRectangle}
|
|---|
| 14 | {$DEFINE TGRectanglePoint := TPoint}
|
|---|
| 15 | {$DEFINE INTERFACE}
|
|---|
| 16 | {$I 'GenericRectangle.inc'}
|
|---|
| 17 | TRectangle = class(TBaseRectangle)
|
|---|
| 18 | private
|
|---|
| 19 | procedure SetTRect(const AValue: TRect);
|
|---|
| 20 | function GetTRect: TRect;
|
|---|
| 21 | public
|
|---|
| 22 | property AsTRect: TRect read GetTRect write SetTRect;
|
|---|
| 23 | end;
|
|---|
| 24 |
|
|---|
| 25 | // TRectangleDouble = TGRectangle<Double>
|
|---|
| 26 | {$DEFINE TGRectangleDimension := Double}
|
|---|
| 27 | {$DEFINE TGRectangle := TRectangleDouble}
|
|---|
| 28 | {$DEFINE TGRectanglePoint := TPointDouble}
|
|---|
| 29 | {$DEFINE INTERFACE}
|
|---|
| 30 | {$I 'GenericRectangle.inc'}
|
|---|
| 31 |
|
|---|
| 32 | implementation
|
|---|
| 33 |
|
|---|
| 34 | {$DEFINE IMPLEMENTATION_USES}
|
|---|
| 35 | {$I 'GenericRectangle.inc'}
|
|---|
| 36 |
|
|---|
| 37 | // TRectangleInteger = TGRectangle<Integer>
|
|---|
| 38 | {$DEFINE TGRectangleDimension := Integer}
|
|---|
| 39 | {$DEFINE TGRectangle := TBaseRectangle}
|
|---|
| 40 | {$DEFINE TGRectanglePoint := TPoint}
|
|---|
| 41 | {$DEFINE IMPLEMENTATION}
|
|---|
| 42 | {$I 'GenericRectangle.inc'}
|
|---|
| 43 |
|
|---|
| 44 | function TRectangle.GetTRect: TRect;
|
|---|
| 45 | begin
|
|---|
| 46 | Result.Left := Left;
|
|---|
| 47 | Result.Top := Top;
|
|---|
| 48 | Result.Bottom := Bottom;
|
|---|
| 49 | Result.Right := Right;
|
|---|
| 50 | end;
|
|---|
| 51 |
|
|---|
| 52 | procedure TRectangle.SetTRect(const AValue: TRect);
|
|---|
| 53 | begin
|
|---|
| 54 | Left := AValue.Left;
|
|---|
| 55 | Top := AValue.Top;
|
|---|
| 56 | Bottom := AValue.Bottom;
|
|---|
| 57 | Right := AValue.Right;
|
|---|
| 58 | end;
|
|---|
| 59 |
|
|---|
| 60 | // TRectangleDouble = TGRectangle<Double>
|
|---|
| 61 | {$DEFINE TGRectangleDimension := Double}
|
|---|
| 62 | {$DEFINE TGRectangle := TRectangleDouble}
|
|---|
| 63 | {$DEFINE TGRectanglePoint := TPointDouble}
|
|---|
| 64 | {$DEFINE IMPLEMENTATION}
|
|---|
| 65 | {$I 'GenericRectangle.inc'}
|
|---|
| 66 |
|
|---|
| 67 | end.
|
|---|
| 68 |
|
|---|