DelphiWrapper.
-, RTTI {$ METHODINFO ON} :
, getObj.
TSimple :
{$METHODINFO ON}
TSimple = Class
Private
function getvar1:string;
Public
Published
property var1:string read getVar1;
function getObj:TSimple;
end;
{$METHODINFO OFF}
getObj - !
, , . Demo32:
Unit1.pas:
TPoint = class(TPersistent)
private
fx, fy : Integer;
fName : String;
public
constructor Create();
procedure OffsetBy( dx, dy : integer );
function MySelf: TPoint; //**access self using function**
published
property x : integer read fx write fx;
property y : integer read fy write fy;
property Name : string read fName write fName;
property MySelf2: TPoint read MySelf; //**access self using property**
end;
Python Memo1.Lines:
import spam
p = spam.Point(2, 5)
b = p.MySelf() //**using function**
print 'Using MySelf: ', type(b), b
c = p.MySelf2 //**using property**
print 'Using MySelf2: ', type(c), c
:
Using MySelf: <type 'int'> 31957664
Using MySelf2: <type 'Point'> (2, 5)
int, . , TPoint, DelphiWrapper.
, Demo8 "AddMethod". ! .