From f3f3521292cb2d22e44e67b2260b53dcadf6e015 Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 28 Nov 2012 21:53:32 +0000 Subject: [PATCH] EditorMacroScript: Workaround for Mac, prevent using edx in result for TPoint git-svn-id: trunk@39403 - --- components/macroscript/emscriptclasses.pas | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/components/macroscript/emscriptclasses.pas b/components/macroscript/emscriptclasses.pas index c74f3f28aa..78e2384a2b 100644 --- a/components/macroscript/emscriptclasses.pas +++ b/components/macroscript/emscriptclasses.pas @@ -22,7 +22,12 @@ procedure ExecRegisterTClipboard(cl: TPSRuntimeClassImporter; AExec: TPSExec); implementation -function Point(AX, AY: Integer): TPoint; +{$IFDEF darwin} +type + TPoint2 = record x,y,a,b,c: Longint; end; +{$ENDIF} + +function Point(AX, AY: Integer): {$IFDEF darwin}TPoint2{$ELSE}TPoint{$ENDIF}; begin with Result do begin @@ -59,7 +64,7 @@ const FuncInputQuery: function(const ACaption, APrompt: string; var Value : string): Boolean = @InputQuery; DeclPoint = 'function Point(AX, AY: Integer): TPoint;'; - FuncPoint: function(AX, AY: Integer): TPoint = @Point; // @Classes.Point; + FuncPoint: function(AX, AY: Integer): {$IFDEF darwin}TPoint2{$ELSE}TPoint{$ENDIF} = @Point; // @Classes.Point; Decltest_ord_mt = 'function test_ord_mt(AType: TMsgDlgType): Integer;'; Decltest_ord_mb = 'function test_ord_mb(ABtn: TMsgDlgBtn): Integer;'; @@ -73,7 +78,7 @@ procedure CompRegisterBasics(AComp: TPSPascalCompiler); end; begin - AComp.AddTypeS('TPoint', 'record x,y: Longint; end;'); + AComp.AddTypeS('TPoint', 'record x,y' {$IFDEF darwin} +',a,b,c'{$ENDIF} + ': Longint; end;'); AComp.AddDelphiFunction(DeclPoint); AddConst('mrNone', 'Integer', mrNone); @@ -145,7 +150,7 @@ procedure TSynEdit_LogicalCaretXY_R(Self: TSynEdit; var P: TPoint); begin P := Self.LogicalCaretXY; end; procedure TSynEdit_LogicalCaretX_W(Self: TSynEdit; const I: Integer); -begin Self.LogicalCaretXY := Point(I, Self.CaretY); end; +begin Self.LogicalCaretXY := Classes.Point(I, Self.CaretY); end; procedure TSynEdit_LogicalCaretX_R(Self: TSynEdit; var I: Integer); begin I := Self.LogicalCaretXY.X; end;