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

Lines changed: 6 additions & 5 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy