source: Generics/TemplateGenerics/Specialized/SpecializedRectangle.pas

Last change on this file was 574, checked in by chronos, 30 hours ago
  • Modified: Removed U prefix from unit names.
File size: 1.6 KB
Line 
1unit SpecializedRectangle;
2
3interface
4
5uses
6 Classes, SysUtils, SpecializedPoint, Types;
7
8type
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
32implementation
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
44function TRectangle.GetTRect: TRect;
45begin
46 Result.Left := Left;
47 Result.Top := Top;
48 Result.Bottom := Bottom;
49 Result.Right := Right;
50end;
51
52procedure TRectangle.SetTRect(const AValue: TRect);
53begin
54 Left := AValue.Left;
55 Top := AValue.Top;
56 Bottom := AValue.Bottom;
57 Right := AValue.Right;
58end;
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
67end.
68
Note: See TracBrowser for help on using the repository browser.