Skip to content

Commit ae42161

Browse files
committed
Adding TFrame wrapper
1 parent 18f4478 commit ae42161

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

Source/fmx/WrapFmxForms.pas

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
interface
44

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

88
type
99
TPyDelphiApplication = class(TPyDelphiComponent)
@@ -61,6 +61,17 @@ TPyDelphiForm = class(TPyDelphiCustomForm)
6161
property DelphiObject: TForm read GetDelphiObject write SetDelphiObject;
6262
end;
6363

64+
TPyDelphiFrame = class(TPyDelphiControl)
65+
private
66+
function GetDelphiObject: TFrame;
67+
procedure SetDelphiObject(const Value: TFrame);
68+
public
69+
// Class methods
70+
class function DelphiObjectClass: TClass; override;
71+
// Properties
72+
property DelphiObject: TFrame read GetDelphiObject write SetDelphiObject;
73+
end;
74+
6475
implementation
6576

6677
uses
@@ -106,6 +117,7 @@ procedure TFormsRegistration.RegisterWrappers(
106117
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomForm);
107118
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomPopupForm);
108119
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiForm);
120+
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiFrame);
109121
end;
110122

111123
{ TPyDelphiApplication }
@@ -195,6 +207,23 @@ procedure TPyDelphiForm.SetDelphiObject(const Value: TForm);
195207
inherited DelphiObject := Value;
196208
end;
197209

210+
{ TPyDelphiFrame }
211+
212+
class function TPyDelphiFrame.DelphiObjectClass: TClass;
213+
begin
214+
Result := TFrame;
215+
end;
216+
217+
function TPyDelphiFrame.GetDelphiObject: TFrame;
218+
begin
219+
Result := TFrame(inherited DelphiObject);
220+
end;
221+
222+
procedure TPyDelphiFrame.SetDelphiObject(const Value: TFrame);
223+
begin
224+
inherited DelphiObject := Value;
225+
end;
226+
198227
initialization
199228
RegisteredUnits.Add(TFormsRegistration.Create);
200229

0 commit comments

Comments
 (0)