Skip to content

Commit 49c6d97

Browse files
committed
Using the TMouseButton wrapper instead of an integer
1 parent feb3550 commit 49c6d97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Source/fmx/WrapFmxTypes.pas

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ function CheckTouchAttribute(AAttribute: PPyObject; const AAttributeName: string
556556

557557
function TouchActionToPython(ATouchAction: TTouchAction): PPyObject;
558558
begin
559-
Result := GetPythonEngine.PyUnicodeFromString(TRttiEnumerationType.GetName(ATouchAction));
559+
Result := GetPythonEngine.PyUnicodeFromString(
560+
TRttiEnumerationType.GetName<TTouchAction>(ATouchAction));
560561
end;
561562

562563
{ TPyDelphiFmxObject }
@@ -1219,7 +1220,7 @@ procedure TMouseEventHandler.DoEvent(Sender: TObject; Button: TMouseButton;
12191220
if Assigned(Callable) and PythonOK then
12201221
with GetPythonEngine do begin
12211222
LPyObject := PyDelphiWrapper.Wrap(Sender);
1222-
LPyButton := PyLong_FromLong(Ord(Button));
1223+
LPyButton := MouseButtonToPython(Button);
12231224
LPyX := PyFloat_FromDouble(X);
12241225
LPyY := PyFloat_FromDouble(Y);
12251226
LPyTuple := PyTuple_New(5);

0 commit comments

Comments
 (0)