mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 10:59:29 +02:00
EditorMacros / PascalScript: more properties (Point())
git-svn-id: trunk@38413 -
This commit is contained in:
parent
3e43c2a56d
commit
9bd1e7a1d6
@ -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, ' +
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user