Skip to content

Commit d1951c1

Browse files
committed
TPyClassWrapper methods declared private. Documentation improved.
1 parent 53c2462 commit d1951c1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Source/WrapDelphi.pas

+6-5
Original file line numberDiff line numberDiff line change
@@ -616,25 +616,26 @@ TPyDelphiObjectClass = class of TPyDelphiObject;
616616
Generic wrapper for pascal classes
617617
618618
Can be used from unit wrappers as follows:
619-
APyDelphiWrapper.RegisterDelphiWrapper(TPyClassWrapper<TMyClass>);
619+
PyDelphiWrapper1.RegisterDelphiWrapper(TPyClassWrapper<TMyClass>);
620620
or at runtime (e.g. inside the FormCreate handler:
621621
PyDelphiWrapper1.RegisterDelphiWrapper(TPyClassWrapper<TMyClass>).Initialize;
622622
623623
if you want your class to capable of being instantiated from python then do:
624624
625-
TTestWrapper = class(TPyClassWrapper<TTest>)
625+
TMyClassWrapper = class(TPyClassWrapper<TMyClass>)
626626
constructor CreateWith(APythonType: TPythonType; args, kwds: PPyObject); overload; override;
627627
end;
628628
629-
constuctor TTestWrapper.CreateWith(APythonType: TPythonType; args, kwds: PPyObject);
629+
constuctor TMyClassWrapper.CreateWith(APythonType: TPythonType; args, kwds: PPyObject);
630630
begin
631631
Create(APythonType);
632-
DelphiObject := TTest.Create;
632+
DelphiObject := TMyClass.Create;
633633
end;
634634
635-
PyDelphiWrapper1.RegisterDelphiWrapper(TTestWrapper).Initialize;
635+
PyDelphiWrapper1.RegisterDelphiWrapper(TMyClassWrapper).Initialize;
636636
}
637637
TPyClassWrapper<T: class> = class(TPyDelphiObject)
638+
private
638639
function GetDelphiObject: T;
639640
procedure SetDelphiObject(const Value: T);
640641
public

0 commit comments

Comments
 (0)