Skip to content

Commit d892730

Browse files
committed
Adding TRectangle wrapper
1 parent caf79be commit d892730

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Source/fmx/WrapFmxShapes.pas

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ TPyDelphiLine = class(TPyDelphiShape)
2626
property DelphiObject: TLine read GetDelphiObject write SetDelphiObject;
2727
end;
2828

29+
TPyDelphiRectangle = class(TPyDelphiShape)
30+
private
31+
function GetDelphiObject: TRectangle;
32+
procedure SetDelphiObject(const Value: TRectangle);
33+
public
34+
class function DelphiObjectClass : TClass; override;
35+
// Properties
36+
property DelphiObject: TRectangle read GetDelphiObject write SetDelphiObject;
37+
end;
38+
2939
implementation
3040

3141
uses
@@ -58,6 +68,7 @@ procedure TShapesRegistration.RegisterWrappers(
5868
inherited;
5969
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiShape);
6070
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiLine);
71+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiRectangle);
6172
end;
6273

6374
{ TPyDelphiShape }
@@ -94,6 +105,23 @@ procedure TPyDelphiLine.SetDelphiObject(const Value: TLine);
94105
inherited DelphiObject := Value;
95106
end;
96107

108+
{ TPyDelphiRectangle }
109+
110+
class function TPyDelphiRectangle.DelphiObjectClass: TClass;
111+
begin
112+
Result := TRectangle;
113+
end;
114+
115+
function TPyDelphiRectangle.GetDelphiObject: TRectangle;
116+
begin
117+
Result := TRectangle(inherited DelphiObject);
118+
end;
119+
120+
procedure TPyDelphiRectangle.SetDelphiObject(const Value: TRectangle);
121+
begin
122+
inherited DelphiObject := Value;
123+
end;
124+
97125
initialization
98126
RegisteredUnits.Add(TShapesRegistration.Create);
99127

0 commit comments

Comments
 (0)