Skip to content

Commit 3720e6e

Browse files
committed
Adding TScaledLayout wrapper
1 parent 46f5320 commit 3720e6e

File tree

1 file changed

+37
-9
lines changed

1 file changed

+37
-9
lines changed

Source/fmx/WrapFmxLayouts.pas

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ TPyDelphiLayout = class(TPyDelphiControl)
1616
property DelphiObject: TLayout read GetDelphiObject write SetDelphiObject;
1717
end;
1818

19+
TPyDelphiScaledLayout = class(TPyDelphiControl)
20+
private
21+
function GetDelphiObject: TScaledLayout;
22+
procedure SetDelphiObject(const Value: TScaledLayout);
23+
public
24+
class function DelphiObjectClass : TClass; override;
25+
// Properties
26+
property DelphiObject: TScaledLayout read GetDelphiObject write SetDelphiObject;
27+
end;
28+
1929
implementation
2030

2131
{ Register the wrappers, the globals and the constants }
@@ -27,6 +37,26 @@ TLayoutsRegistration = class(TRegisteredUnit)
2737
procedure DefineVars(APyDelphiWrapper : TPyDelphiWrapper); override;
2838
end;
2939

40+
{ TLayoutsRegistration }
41+
42+
procedure TLayoutsRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
43+
begin
44+
inherited;
45+
end;
46+
47+
function TLayoutsRegistration.Name: string;
48+
begin
49+
Result := 'Layouts';
50+
end;
51+
52+
procedure TLayoutsRegistration.RegisterWrappers(
53+
APyDelphiWrapper: TPyDelphiWrapper);
54+
begin
55+
inherited;
56+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiLayout);
57+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiScaledLayout);
58+
end;
59+
3060
{ TPyDelphiLayout }
3161

3262
class function TPyDelphiLayout.DelphiObjectClass: TClass;
@@ -44,23 +74,21 @@ procedure TPyDelphiLayout.SetDelphiObject(const Value: TLayout);
4474
inherited DelphiObject := Value;
4575
end;
4676

47-
{ TLayoutsRegistration }
77+
{ TPyDelphiScaledLayout }
4878

49-
procedure TLayoutsRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper);
79+
class function TPyDelphiScaledLayout.DelphiObjectClass: TClass;
5080
begin
51-
inherited;
81+
Result := TScaledLayout;
5282
end;
5383

54-
function TLayoutsRegistration.Name: string;
84+
function TPyDelphiScaledLayout.GetDelphiObject: TScaledLayout;
5585
begin
56-
Result := 'Layouts';
86+
Result := TScaledLayout(inherited DelphiObject);
5787
end;
5888

59-
procedure TLayoutsRegistration.RegisterWrappers(
60-
APyDelphiWrapper: TPyDelphiWrapper);
89+
procedure TPyDelphiScaledLayout.SetDelphiObject(const Value: TScaledLayout);
6190
begin
62-
inherited;
63-
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiLayout);
91+
inherited DelphiObject := Value;
6492
end;
6593

6694
initialization

0 commit comments

Comments
 (0)