@@ -38,6 +38,8 @@ TPyDelphiGraphic = class(TPyDelphiPersistent)
38
38
function Set_Transparent ( AValue : PPyObject; AContext : Pointer) : integer; cdecl;
39
39
function Set_Width ( AValue : PPyObject; AContext : Pointer) : integer; cdecl;
40
40
public
41
+ constructor CreateWith(APythonType: TPythonType; args: PPyObject); override;
42
+
41
43
class function DelphiObjectClass : TClass; override;
42
44
class procedure RegisterGetSets ( PythonType : TPythonType ); override;
43
45
class procedure RegisterMethods ( PythonType : TPythonType ); override;
@@ -88,6 +90,8 @@ TPyDelphiBitmap = class(TPyDelphiGraphic)
88
90
function Set_TransparentColor ( AValue : PPyObject; AContext : Pointer) : Integer; cdecl;
89
91
function Set_TransparentMode ( AValue : PPyObject; AContext : Pointer) : Integer; cdecl;
90
92
public
93
+ constructor CreateWith(APythonType: TPythonType; args: PPyObject); override;
94
+
91
95
class function DelphiObjectClass : TClass; override;
92
96
class procedure RegisterGetSets ( PythonType : TPythonType ); override;
93
97
class procedure RegisterMethods ( PythonType : TPythonType ); override;
@@ -362,6 +366,13 @@ procedure TGraphicsRegistration.RegisterWrappers(APyDelphiWrapper: TPyDelphiWrap
362
366
363
367
{ TPyDelphiGraphic }
364
368
369
+ constructor TPyDelphiGraphic.CreateWith(APythonType: TPythonType;
370
+ args: PPyObject);
371
+ begin
372
+ inherited ;
373
+ DelphiObject := TGraphicClass(DelphiObjectClass()).Create();
374
+ end ;
375
+
365
376
class function TPyDelphiGraphic.DelphiObjectClass : TClass;
366
377
begin
367
378
Result := TGraphic;
@@ -695,6 +706,16 @@ function TPyDelphiGraphic.Set_Width(AValue: PPyObject;
695
706
696
707
{ TPyDelphiBitmap }
697
708
709
+ constructor TPyDelphiBitmap.CreateWith(APythonType: TPythonType;
710
+ args: PPyObject);
711
+ var
712
+ LWidth, LHeight : Integer;
713
+ begin
714
+ inherited ;
715
+ if APythonType.Engine.PyArg_ParseTuple(args, ' ii:Create' , @LWidth, @LHeight) <> 0 then
716
+ DelphiObject.SetSize(LWidth, LHeight);
717
+ end ;
718
+
698
719
class function TPyDelphiBitmap.DelphiObjectClass : TClass;
699
720
begin
700
721
Result := TBitmap;
0 commit comments