Skip to content

WrapDelphi.CreateVarParam with object - a small helpful overload#321

Merged
pyscripter merged 2 commits intolmbelo:masterfrom
csmspl:feature/CreateVarParam-with-object
Sep 17, 2021
Merged

WrapDelphi.CreateVarParam with object - a small helpful overload#321
pyscripter merged 2 commits intolmbelo:masterfrom
csmspl:feature/CreateVarParam-with-object

Conversation

@mrcsms
Copy link
Copy Markdown
Contributor

@mrcsms mrcsms commented Aug 19, 2021

... function CreateVarParam(PyDelphiWrapper : TPyDelphiWrapper; AObject: TObject) : PPyObject; overload;

@pyscripter
Copy link
Copy Markdown
Collaborator

Could you please describe a use case or even better a unit test that should pass?

@mrcsms
Copy link
Copy Markdown
Contributor Author

mrcsms commented Aug 19, 2021

it's not very common - for example, TcxGrid from DevExpress has an event defined as:
TcxGridGetPropertiesEvent = procedure(Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; var AProperties: TcxCustomEditProperties) of object;
so event handler code use this case of CreateVarParam for passing AProperties to python side

@pyscripter
Copy link
Copy Markdown
Collaborator

I am happy to merge this, but is it unreasonable to ask to provide a unit test (in WrapDelphiTest.pas) before merging? This would serve as a documentation for users.

@mrcsms
Copy link
Copy Markdown
Contributor Author

mrcsms commented Aug 22, 2021

you are right, code should be covered by unit tests, I'll prepare sth

@mrcsms
Copy link
Copy Markdown
Contributor Author

mrcsms commented Sep 17, 2021

finally i added a test for this function - but to take a step forward, this test covers more general event handlers in p4d

@pyscripter pyscripter merged commit d45b048 into lmbelo:master Sep 17, 2021
@mrcsms mrcsms deleted the feature/CreateVarParam-with-object branch September 17, 2021 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants