File tree 1 file changed +18
-6
lines changed
1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,11 @@ interface
9
9
SysUtils,
10
10
PythonEngine,
11
11
Types,
12
- WrapDelphi;
12
+ WrapDelphi
13
+ { $IFDEF DELPHI10_OR_HIGHER}
14
+ , System.UITypes
15
+ { $ENDIF DELPHI10_OR_HIGHER}
16
+ ;
13
17
14
18
type
15
19
TPyDelphiPoint = class (TPyObject)
@@ -95,14 +99,14 @@ TPyDelphiSize = class(TPyObject)
95
99
function CheckRectAttribute (AAttribute : PPyObject; const AAttributeName : string; out AValue : TRect) : Boolean;
96
100
function CheckSizeAttribute (AAttribute : PPyObject; const AAttributeName : string; out AValue : TSize) : Boolean;
97
101
102
+ { $IFDEF DELPHI10_OR_HIGHER}
103
+ function MouseButtonToPython (const AMouseButton: TMouseButton): PPyObject;
104
+ { $ENDIF DELPHI10_OR_HIGHER}
105
+
98
106
implementation
99
107
100
108
uses
101
- Math
102
- { $IFDEF DELPHI10_OR_HIGHER}
103
- , System.UITypes
104
- { $ENDIF DELPHI10_OR_HIGHER}
105
- ;
109
+ Math, Rtti;
106
110
107
111
{ Register the wrappers, the globals and the constants }
108
112
type
@@ -158,6 +162,14 @@ procedure TTypesRegistration.RegisterWrappers(APyDelphiWrapper: TPyDelphiWrapper
158
162
APyDelphiWrapper.RegisterHelperType(TPyDelphiSize);
159
163
end ;
160
164
165
+ { $IFDEF DELPHI10_OR_HIGHER}
166
+ function MouseButtonToPython (const AMouseButton: TMouseButton): PPyObject;
167
+ begin
168
+ Result := GetPythonEngine.PyUnicodeFromString(
169
+ TRttiEnumerationType.GetName<TMouseButton>(AMouseButton));
170
+ end ;
171
+ { $ENDIF DELPHI10_OR_HIGHER}
172
+
161
173
{ Helper functions }
162
174
163
175
function WrapPoint (APyDelphiWrapper : TPyDelphiWrapper; const APoint : TPoint) : PPyObject;
You can’t perform that action at this time.
0 commit comments