2006-05-30 16:23:25 +02:00
|
|
|
|
{ Compiletime TObject, TPersistent and TComponent definitions }
|
|
|
|
|
unit uPSC_std;
|
|
|
|
|
{$I PascalScript.inc}
|
|
|
|
|
interface
|
|
|
|
|
uses
|
|
|
|
|
uPSCompiler, uPSUtils;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
Will register files from:
|
|
|
|
|
System
|
|
|
|
|
Classes (Only TComponent and TPersistent)
|
2008-12-05 13:15:22 +01:00
|
|
|
|
|
2006-05-30 16:23:25 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
procedure SIRegister_Std_TypesAndConsts(Cl: TPSPascalCompiler);
|
|
|
|
|
procedure SIRegisterTObject(CL: TPSPascalCompiler);
|
|
|
|
|
procedure SIRegisterTPersistent(Cl: TPSPascalCompiler);
|
|
|
|
|
procedure SIRegisterTComponent(Cl: TPSPascalCompiler);
|
|
|
|
|
|
|
|
|
|
procedure SIRegister_Std(Cl: TPSPascalCompiler);
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
procedure SIRegisterTObject(CL: TPSPascalCompiler);
|
|
|
|
|
begin
|
2008-12-05 13:15:22 +01:00
|
|
|
|
with Cl.AddClassN(nil, 'TObject') do
|
2006-05-30 16:23:25 +02:00
|
|
|
|
begin
|
|
|
|
|
RegisterMethod('constructor Create');
|
|
|
|
|
RegisterMethod('procedure Free');
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure SIRegisterTPersistent(Cl: TPSPascalCompiler);
|
|
|
|
|
begin
|
2008-12-05 13:15:22 +01:00
|
|
|
|
with Cl.AddClassN(cl.FindClass('TObject'), 'TPersistent') do
|
2006-05-30 16:23:25 +02:00
|
|
|
|
begin
|
|
|
|
|
RegisterMethod('procedure Assign(Source: TPersistent)');
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure SIRegisterTComponent(Cl: TPSPascalCompiler);
|
|
|
|
|
begin
|
2008-12-05 13:15:22 +01:00
|
|
|
|
with Cl.AddClassN(cl.FindClass('TPersistent'), 'TComponent') do
|
2006-05-30 16:23:25 +02:00
|
|
|
|
begin
|
2008-10-09 21:03:33 +02:00
|
|
|
|
RegisterMethod('function FindComponent(AName: String): TComponent;');
|
2006-05-30 16:23:25 +02:00
|
|
|
|
RegisterMethod('constructor Create(AOwner: TComponent); virtual;');
|
|
|
|
|
|
|
|
|
|
RegisterProperty('Owner', 'TComponent', iptRW);
|
2008-12-05 13:15:22 +01:00
|
|
|
|
RegisterMethod('procedure DestroyComponents');
|
|
|
|
|
RegisterMethod('procedure Destroying');
|
|
|
|
|
RegisterMethod('procedure FreeNotification(AComponent:TComponent)');
|
|
|
|
|
RegisterMethod('procedure InsertComponent(AComponent:TComponent)');
|
|
|
|
|
RegisterMethod('procedure RemoveComponent(AComponent:TComponent)');
|
|
|
|
|
RegisterProperty('Components', 'TComponent Integer', iptr);
|
|
|
|
|
RegisterProperty('ComponentCount', 'Integer', iptr);
|
|
|
|
|
RegisterProperty('ComponentIndex', 'Integer', iptrw);
|
|
|
|
|
RegisterProperty('ComponentState', 'Byte', iptr);
|
|
|
|
|
RegisterProperty('Designinfo', 'LongInt', iptrw);
|
|
|
|
|
RegisterProperty('Name', 'String', iptrw);
|
|
|
|
|
RegisterProperty('Tag', 'LongInt', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure SIRegister_Std_TypesAndConsts(Cl: TPSPascalCompiler);
|
|
|
|
|
begin
|
|
|
|
|
Cl.AddTypeS('TComponentStateE', '(csLoading, csReading, csWriting, csDestroying, csDesigning, csAncestor, csUpdating, csFixups, csFreeNotification, csInline, csDesignInstance)');
|
|
|
|
|
cl.AddTypeS('TComponentState', 'set of TComponentStateE');
|
|
|
|
|
Cl.AddTypeS('TRect', 'record Left, Top, Right, Bottom: Integer; end;');
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure SIRegister_Std(Cl: TPSPascalCompiler);
|
|
|
|
|
begin
|
|
|
|
|
SIRegister_Std_TypesAndConsts(Cl);
|
|
|
|
|
SIRegisterTObject(CL);
|
|
|
|
|
SIRegisterTPersistent(Cl);
|
|
|
|
|
SIRegisterTComponent(Cl);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
// PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End.
|
|
|
|
|
|
2008-12-05 13:15:22 +01:00
|
|
|
|
|