mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-05 17:05:19 -05:00
9d6c4ee850
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@58 3f818213-9676-44b0-a9b4-5e4c4e03d09d
88 lines
2.6 KiB
ObjectPascal
88 lines
2.6 KiB
ObjectPascal
{ 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)
|
||
|
||
}
|
||
|
||
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
|
||
with Cl.AddClassN(nil, 'TObject') do
|
||
begin
|
||
RegisterMethod('constructor Create');
|
||
RegisterMethod('procedure Free');
|
||
end;
|
||
end;
|
||
|
||
procedure SIRegisterTPersistent(Cl: TPSPascalCompiler);
|
||
begin
|
||
with Cl.AddClassN(cl.FindClass('TObject'), 'TPersistent') do
|
||
begin
|
||
RegisterMethod('procedure Assign(Source: TPersistent)');
|
||
end;
|
||
end;
|
||
|
||
procedure SIRegisterTComponent(Cl: TPSPascalCompiler);
|
||
begin
|
||
with Cl.AddClassN(cl.FindClass('TPersistent'), 'TComponent') do
|
||
begin
|
||
RegisterMethod('function FindComponent(AName: String): TComponent;');
|
||
RegisterMethod('constructor Create(AOwner: TComponent); virtual;');
|
||
|
||
RegisterProperty('Owner', 'TComponent', iptRW);
|
||
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);
|
||
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.
|
||
|
||
|