EditorMacros / PascalScript: more properties (Point())

git-svn-id: trunk@38413 -
This commit is contained in:
martin 2012-08-28 01:08:18 +00:00
parent 3e43c2a56d
commit 9bd1e7a1d6
2 changed files with 18 additions and 1 deletions

View File

@ -10,6 +10,9 @@ interface
uses
Classes, SysUtils, SynEdit, SynEditTypes, Clipbrd, uPSCompiler, uPSRuntime;
procedure CompRegisterBasics(AComp: TPSPascalCompiler);
procedure ExecRegisterBasics(AExec: TPSExec);
procedure CompRegisterTSynEdit(AComp: TPSPascalCompiler);
procedure ExecRegisterTSynEdit(cl: TPSRuntimeClassImporter);
@ -18,6 +21,19 @@ procedure ExecRegisterTClipboard(cl: TPSRuntimeClassImporter; AExec: TPSExec);
implementation
procedure CompRegisterBasics(AComp: TPSPascalCompiler);
begin
AComp.AddTypeS('TPoint', 'record x,y: Longint; end;');
AComp.AddDelphiFunction('function Point(X, Y: Integer): TPoint;');
end;
procedure ExecRegisterBasics(AExec: TPSExec);
begin
AExec.RegisterDelphiFunction(@Classes.Point, 'POINT', cdRegister);
end;
{ SynEdit }
procedure TSynEdit_CaretXY_W(Self: TSynEdit; const P: TPoint);
begin Self.CaretXY := P; end;
procedure TSynEdit_CaretXY_R(Self: TSynEdit; var P: TPoint);
@ -78,7 +94,6 @@ end;
procedure CompRegisterTSynEdit(AComp: TPSPascalCompiler);
begin
AComp.AddTypeS('TPoint', 'record x,y: Longint; end;');
AComp.AddTypeS('TSynSelectionMode', '(smNormal, smLine, smColumn, smCurrent)');
AComp.AddTypeS('TSynSearchOption',
'(ssoMatchCase, ssoWholeWord, ssoBackwards, ssoEntireScope, ' +

View File

@ -116,6 +116,7 @@ begin
if Sender is TEMSPSPascalCompiler then
GetEditorCommandValues(@TEMSPSPascalCompiler(Sender).AddECFuncToCompEnum);
CompRegisterBasics(TheCompiler);
CompRegisterTSynEdit(TheCompiler);
Sender.AddFunction('function Caller: TSynEdit;');
CompRegisterTClipboard(TheCompiler);
@ -128,6 +129,7 @@ end;
procedure AddECFuncToExec;
begin
GetEditorCommandValues(@TheExec.AddECFuncToExecEnum);
ExecRegisterBasics(TheExec);
ExecRegisterTSynEdit(TheCLassImp);
TheExec.RegisterFunctionName('CALLER', @HandleGetCaller, TheExec, nil);
ExecRegisterTClipboard(TheCLassImp, TheExec);