Skip to content

Commit 53fe1bf

Browse files
committed
Addint TCommonCustomForm wrapper
1 parent 2f88142 commit 53fe1bf

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

Source/fmx/WrapFmxForms.pas

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
interface
44

55
uses
6-
FMX.Forms, PythonEngine, WrapDelphiClasses;
6+
FMX.Forms, PythonEngine, WrapDelphiClasses, WrapFmxTypes;
77

88
type
99
TPyDelphiApplication = class(TPyDelphiComponent)
@@ -17,6 +17,17 @@ TPyDelphiApplication = class(TPyDelphiComponent)
1717
property DelphiObject: TApplication read GetDelphiObject write SetDelphiObject;
1818
end;
1919

20+
TPyDelphiCommonCustomForm = class(TPyDelphiFmxObject)
21+
private
22+
function GetDelphiObject: TCommonCustomForm;
23+
procedure SetDelphiObject(const Value: TCommonCustomForm);
24+
public
25+
// Class methods
26+
class function DelphiObjectClass: TClass; override;
27+
// Properties
28+
property DelphiObject: TCommonCustomForm read GetDelphiObject write SetDelphiObject;
29+
end;
30+
2031
implementation
2132

2233
uses
@@ -57,7 +68,7 @@ procedure TFormsRegistration.RegisterWrappers(
5768
APyDelphiWrapper: TPyDelphiWrapper);
5869
begin
5970
inherited;
60-
71+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCommonCustomForm);
6172
end;
6273

6374
{ TPyDelphiApplication }
@@ -77,7 +88,25 @@ procedure TPyDelphiApplication.SetDelphiObject(const Value: TApplication);
7788
inherited DelphiObject := Value;
7889
end;
7990

91+
{ TPyDelphiCommonCustomForm }
92+
93+
class function TPyDelphiCommonCustomForm.DelphiObjectClass: TClass;
94+
begin
95+
Result := TCommonCustomForm;
96+
end;
97+
98+
function TPyDelphiCommonCustomForm.GetDelphiObject: TCommonCustomForm;
99+
begin
100+
Result := TCommonCustomForm(inherited DelphiObject);
101+
end;
102+
103+
procedure TPyDelphiCommonCustomForm.SetDelphiObject(
104+
const Value: TCommonCustomForm);
105+
begin
106+
inherited DelphiObject := Value;
107+
end;
108+
80109
initialization
81-
RegisteredUnits.Add( TFormsRegistration.Create );
110+
RegisteredUnits.Add(TFormsRegistration.Create);
82111

83112
end.

0 commit comments

Comments
 (0)