@@ -7,7 +7,7 @@ interface
77uses
88 Classes, SysUtils, TypInfo, Types,
99 Fmx.Controls,
10- PythonEngine, WrapDelphi, WrapDelphiClasses;
10+ PythonEngine, WrapDelphi, WrapDelphiClasses, WrapFmxTypes ;
1111
1212type
1313 {
@@ -16,7 +16,7 @@ interface
1616 SetBounds and Repaint
1717 Exposes properties Parent and Visible
1818 }
19- TPyDelphiControl = class (TPyDelphiComponent )
19+ TPyDelphiControl = class (TPyDelphiFmxObject )
2020 private
2121 function GetDelphiObject : TControl;
2222 procedure SetDelphiObject (const Value : TControl);
@@ -32,13 +32,12 @@ TPyDelphiControl = class (TPyDelphiComponent)
3232 function SetFocus_Wrapper (args: PPyObject): PPyObject; cdecl;
3333 function ResetFocus_Wrapper (args: PPyObject): PPyObject; cdecl;
3434 // Property Getters
35- function Get_Parent ( AContext : Pointer) : PPyObject; cdecl;
3635 function Get_Visible (AContext: Pointer): PPyObject; cdecl;
3736 function Get_ControlsCount ( AContext : Pointer) : PPyObject; cdecl;
3837 function Get_Controls (AContext: Pointer): PPyObject; cdecl;
3938 function Get_IsFocused ( AContext : Pointer) : PPyObject; cdecl;
39+ function Get_ParentControl ( AContext : Pointer) : PPyObject; cdecl;
4040 // Property Setters
41- function Set_Parent ( AValue : PPyObject; AContext : Pointer) : integer; cdecl;
4241 function Set_Visible (AValue: PPyObject; AContext: Pointer): integer; cdecl;
4342 public
4443 class function DelphiObjectClass : TClass; override;
@@ -69,7 +68,7 @@ TControlsAccess = class(TContainerAccess)
6968implementation
7069
7170uses
72- WrapFmxTypes, FMX.Types;
71+ FMX.Types;
7372
7473type
7574{ Register the wrappers, the globals and the constants }
@@ -156,10 +155,10 @@ function TPyDelphiControl.Get_Controls(AContext: Pointer): PPyObject;
156155 Setup(Self.PyDelphiWrapper, TControlsAccess.Create(Self.PyDelphiWrapper, Self.DelphiObject));
157156end ;
158157
159- function TPyDelphiControl.Get_Parent (AContext: Pointer): PPyObject;
158+ function TPyDelphiControl.Get_ParentControl (AContext: Pointer): PPyObject;
160159begin
161160 Adjust(@Self);
162- Result := Wrap(DelphiObject.Parent );
161+ Result := Wrap(DelphiObject.ParentControl );
163162end ;
164163
165164function TPyDelphiControl.Get_Visible (AContext: Pointer): PPyObject;
@@ -171,8 +170,6 @@ function TPyDelphiControl.Get_Visible(AContext: Pointer): PPyObject;
171170class procedure TPyDelphiControl.RegisterGetSets (PythonType: TPythonType);
172171begin
173172 inherited ;
174- PythonType.AddGetSet(' Parent' , @TPyDelphiControl.Get_Parent, @TPyDelphiControl.Set_Parent,
175- ' Returns/Sets the Control Visibility' , nil );
176173 PythonType.AddGetSet(' Visible' , @TPyDelphiControl.Get_Visible, @TPyDelphiControl.Set_Visible,
177174 ' Returns/Sets the Control Visibility' , nil );
178175 PythonType.AddGetSet(' ControlsCount' , @TPyDelphiControl.Get_ControlsCount, nil ,
@@ -307,21 +304,6 @@ function TPyDelphiControl.SetFocus_Wrapper(args: PPyObject): PPyObject;
307304 end ;
308305end ;
309306
310- function TPyDelphiControl.Set_Parent (AValue: PPyObject;
311- AContext: Pointer): integer;
312- var
313- _object : TObject;
314- begin
315- Adjust(@Self);
316- if CheckObjAttribute(AValue, ' Parent' , TFmxObject, _object) then
317- begin
318- Self.DelphiObject.Parent := TFmxObject(_object);
319- Result := 0 ;
320- end
321- else
322- Result := -1 ;
323- end ;
324-
325307function TPyDelphiControl.Set_Visible (AValue: PPyObject;
326308 AContext: Pointer): integer;
327309var
0 commit comments