Skip to content

Commit 18f4478

Browse files
committed
Adding TForm wrapper
1 parent 9032e0b commit 18f4478

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Source/fmx/WrapFmxForms.pas

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ TPyDelphiCustomPopupForm = class(TPyDelphiCustomForm)
5050
property DelphiObject: TCustomPopupForm read GetDelphiObject write SetDelphiObject;
5151
end;
5252

53+
TPyDelphiForm = class(TPyDelphiCustomForm)
54+
private
55+
function GetDelphiObject: TForm;
56+
procedure SetDelphiObject(const Value: TForm);
57+
public
58+
// Class methods
59+
class function DelphiObjectClass: TClass; override;
60+
// Properties
61+
property DelphiObject: TForm read GetDelphiObject write SetDelphiObject;
62+
end;
63+
5364
implementation
5465

5566
uses
@@ -94,6 +105,7 @@ procedure TFormsRegistration.RegisterWrappers(
94105
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCommonCustomForm);
95106
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomForm);
96107
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomPopupForm);
108+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiForm);
97109
end;
98110

99111
{ TPyDelphiApplication }
@@ -166,6 +178,23 @@ procedure TPyDelphiCustomPopupForm.SetDelphiObject(
166178
inherited DelphiObject := Value;
167179
end;
168180

181+
{ TPyDelphiForm }
182+
183+
class function TPyDelphiForm.DelphiObjectClass: TClass;
184+
begin
185+
Result := TForm;
186+
end;
187+
188+
function TPyDelphiForm.GetDelphiObject: TForm;
189+
begin
190+
Result := TForm(inherited DelphiObject);
191+
end;
192+
193+
procedure TPyDelphiForm.SetDelphiObject(const Value: TForm);
194+
begin
195+
inherited DelphiObject := Value;
196+
end;
197+
169198
initialization
170199
RegisteredUnits.Add(TFormsRegistration.Create);
171200

0 commit comments

Comments
 (0)