Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fc96036

Browse filesBrowse files
committed
Improve previous commit.
1 parent fc9f417 commit fc96036
Copy full SHA for fc96036

File tree

2 files changed

+11
-11
lines changed
Filter options

2 files changed

+11
-11
lines changed

‎Source/WrapDelphi.pas

Copy file name to clipboardExpand all lines: Source/WrapDelphi.pas
+2
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,8 @@ TPyDelphiWrapper = class(TEngineClient, IFreeNotificationSubscriber)
991991
{$IFDEF EXTENDED_RTTI}
992992
function CreateVarParam(PyDelphiWrapper : TPyDelphiWrapper;
993993
const AValue: TValue) : PPyObject; overload;
994+
function SimpleValueToPython(const Value: TValue;
995+
out ErrMsg: string): PPyObject;
994996
function TValueToPyObject(const Value: TValue;
995997
DelphiWrapper: TPyDelphiWrapper; out ErrMsg: string): PPyObject;
996998
function PyObjectToTValue(PyArg : PPyObject; ArgType: TRttiType;

‎Source/vcl/WrapVclComCtrls.pas

Copy file name to clipboardExpand all lines: Source/vcl/WrapVclComCtrls.pas
+9-11
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,7 @@ TPyDelphiListView = class(TPyDelphiCustomListView)
731731

732732
function CustomDrawTargetToPython(const ACustomDrawTarget: TCustomDrawTarget): PPyObject;
733733
function CustomDrawStageToPython(const ACustomDrawStage: TCustomDrawStage): PPyObject;
734-
function CustomDrawStateToPython(const ACustomDrawState: TCustomDrawState;
735-
DelphiWrapper: TPyDelphiWrapper): PPyObject;
734+
function CustomDrawStateToPython(const ACustomDrawState: TCustomDrawState): PPyObject;
736735

737736
function ItemChangeToPython(const AItemChange: TItemChange): PPyObject;
738737
function ItemStateToPython(const AItemState: TItemState): PPyObject;
@@ -783,14 +782,13 @@ function CustomDrawStageToPython(const ACustomDrawStage: TCustomDrawStage): PPyO
783782
Ord(ACustomDrawStage)));
784783
end;
785784

786-
function CustomDrawStateToPython(const ACustomDrawState: TCustomDrawState;
787-
DelphiWrapper: TPyDelphiWrapper): PPyObject;
785+
function CustomDrawStateToPython(const ACustomDrawState: TCustomDrawState): PPyObject;
788786
var
789787
ErrMsg: string;
790788
Value: TValue;
791789
begin
792790
Value := TValue.From(ACustomDrawState);
793-
Result := TValueToPyObject(Value, DelphiWrapper, ErrMsg);
791+
Result := SimpleValueToPython(Value, ErrMsg);
794792
end;
795793

796794
function ItemChangeToPython(const AItemChange: TItemChange): PPyObject;
@@ -2189,7 +2187,7 @@ procedure TTVCustomDrawItemEventHandler.DoEvent(Sender: TCustomTreeView;
21892187
LPyTuple := PyTuple_New(4);
21902188
PyTuple_SetItem(LPyTuple, 0, LPyObject);
21912189
PyTuple_SetItem(LPyTuple, 1, LPyNode);
2192-
PyTuple_SetItem(LPyTuple, 2, CustomDrawStateToPython(State, PyDelphiWrapper));
2190+
PyTuple_SetItem(LPyTuple, 2, CustomDrawStateToPython(State));
21932191
PyTuple_SetItem(LPyTuple, 3, LPyDefaultDraw);
21942192
try
21952193
LPyResult := PyObject_CallObject(Callable, LPyTuple);
@@ -2292,7 +2290,7 @@ procedure TTVAdvancedCustomDrawItemEventHandler.DoEvent(Sender: TCustomTreeView;
22922290
LPyTuple := PyTuple_New(6);
22932291
PyTuple_SetItem(LPyTuple, 0, LPyObject);
22942292
PyTuple_SetItem(LPyTuple, 1, LPyNode);
2295-
PyTuple_SetItem(LPyTuple, 2, CustomDrawStateToPython(State, PyDelphiWrapper));
2293+
PyTuple_SetItem(LPyTuple, 2, CustomDrawStateToPython(State));
22962294
PyTuple_SetItem(LPyTuple, 3, CustomDrawStageToPython(Stage));
22972295
PyTuple_SetItem(LPyTuple, 4, LPyPaintImages);
22982296
PyTuple_SetItem(LPyTuple, 5, LPyDefaultDraw);
@@ -3084,7 +3082,7 @@ procedure TLVCustomDrawItemEventHandler.DoEvent(Sender: TCustomListView;
30843082
LPyTuple := PyTuple_New(4);
30853083
PyTuple_SetItem(LPyTuple, 0, LPyObject);
30863084
PyTuple_SetItem(LPyTuple, 1, LPyItem);
3087-
PyTuple_SetItem(LPyTuple, 2, CustomDrawStateToPython(State, PyDelphiWrapper));
3085+
PyTuple_SetItem(LPyTuple, 2, CustomDrawStateToPython(State));
30883086
PyTuple_SetItem(LPyTuple, 3, LPyDefaultDraw);
30893087
try
30903088
LPyResult := PyObject_CallObject(Callable, LPyTuple);
@@ -3136,7 +3134,7 @@ procedure TLVCustomDrawSubItemEventHandler.DoEvent(Sender: TCustomListView;
31363134
PyTuple_SetItem(LPyTuple, 0, LPyObject);
31373135
PyTuple_SetItem(LPyTuple, 1, LPyItem);
31383136
PyTuple_SetItem(LPyTuple, 2, PyLong_FromLong(SubItem));
3139-
PyTuple_SetItem(LPyTuple, 3, CustomDrawStateToPython(State, PyDelphiWrapper));
3137+
PyTuple_SetItem(LPyTuple, 3, CustomDrawStateToPython(State));
31403138
PyTuple_SetItem(LPyTuple, 4, LPyDefaultDraw);
31413139
try
31423140
LPyResult := PyObject_CallObject(Callable, LPyTuple);
@@ -3237,7 +3235,7 @@ procedure TLVAdvancedCustomDrawItemEventHandler.DoEvent(Sender: TCustomListView;
32373235
LPyTuple := PyTuple_New(5);
32383236
PyTuple_SetItem(LPyTuple, 0, LPyObject);
32393237
PyTuple_SetItem(LPyTuple, 1, LPyItem);
3240-
PyTuple_SetItem(LPyTuple, 2, CustomDrawStateToPython(State, PyDelphiWrapper));
3238+
PyTuple_SetItem(LPyTuple, 2, CustomDrawStateToPython(State));
32413239
PyTuple_SetItem(LPyTuple, 3, CustomDrawStageToPython(Stage));
32423240
PyTuple_SetItem(LPyTuple, 4, LPyDefaultDraw);
32433241
try
@@ -3290,7 +3288,7 @@ procedure TLVAdvancedCustomDrawSubItemEventHandler.DoEvent(
32903288
PyTuple_SetItem(LPyTuple, 0, LPyObject);
32913289
PyTuple_SetItem(LPyTuple, 1, LPyItem);
32923290
PyTuple_SetItem(LPyTuple, 2, PyLong_FromLong(SubItem));
3293-
PyTuple_SetItem(LPyTuple, 3, CustomDrawStateToPython(State, PyDelphiWrapper));
3291+
PyTuple_SetItem(LPyTuple, 3, CustomDrawStateToPython(State));
32943292
PyTuple_SetItem(LPyTuple, 4, CustomDrawStageToPython(Stage));
32953293
PyTuple_SetItem(LPyTuple, 5, LPyDefaultDraw);
32963294
try

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.