* revised TComponent class. There was a lot of outdated, bad, maybe also old code. Tested also with Lazarus.

git-svn-id: trunk@13297 -
This commit is contained in:
ivost 2009-06-19 00:07:59 +00:00
parent becf7df747
commit 8b7167e538
2 changed files with 252 additions and 293 deletions

View File

@ -1510,7 +1510,7 @@ type
procedure WriteTop(Writer: TWriter); procedure WriteTop(Writer: TWriter);
protected protected
FComponentStyle: TComponentStyle; FComponentStyle: TComponentStyle;
procedure ChangeName(const NewName: TComponentName); //procedure ChangeName(const NewName: TComponentName);
procedure DefineProperties(Filer: TFiler); override; procedure DefineProperties(Filer: TFiler); override;
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); dynamic; procedure GetChildren(Proc: TGetChildProc; Root: TComponent); dynamic;
function GetChildOwner: TComponent; dynamic; function GetChildOwner: TComponent; dynamic;

View File

@ -15,137 +15,126 @@
{* TComponent *} {* TComponent *}
{****************************************************************************} {****************************************************************************}
Function TComponent.GetComponent(AIndex: Integer): TComponent; function TComponent.GetComponent(AIndex: Integer): TComponent;
begin begin
If not assigned(FComponents) then if Assigned(FComponents) then
Result:=Nil Result := TComponent(FComponents.Items[Aindex])
else else
Result:=TComponent(FComponents.Items[Aindex]); Result := nil;
end; end;
function TComponent.IsImplementorOf (const Intf:IInterface):boolean;
var ref : IInterfaceComponentReference; function TComponent.IsImplementorOf(const Intf: IInterface):boolean;
var
ref: IInterfaceComponentReference;
begin begin
result:=assigned(intf) and supports(intf,IInterfaceComponentReference,ref); result := Assigned(intf) and Supports(intf,IInterfaceComponentReference,ref) and (ref.getcomponent=self);
if result then
result:=ref.getcomponent=self;
end; end;
procedure TComponent.ReferenceInterface(const intf:IInterface;op:TOperation);
var ref : IInterfaceComponentReference; procedure TComponent.ReferenceInterface(const intf: IInterface; op: TOperation);
comp : TComponent; var
ref: IInterfaceComponentReference;
comp: TComponent;
begin begin
if assigned(intf) and supports(intf,IInterfaceComponentReference,ref) then if assigned(intf) and supports(intf,IInterfaceComponentReference,ref) then
begin begin
comp:=ref.getcomponent; comp := ref.getcomponent;
comp.notification(self,op); comp.notification(self,op);
end; end;
end; end;
Function TComponent.GetComponentCount: Integer;
function TComponent.GetComponentCount: Integer;
begin begin
If not assigned(FComponents) then if assigned(FComponents) then
result:=0 Result := FComponents.Count
else else
Result:=FComponents.Count; Result := 0;
end; end;
Function TComponent.GetComponentIndex: Integer; function TComponent.GetComponentIndex: Integer;
begin begin
If Assigned(FOwner) and Assigned(FOwner.FComponents) then if Assigned(FOwner) and Assigned(FOwner.FComponents) then
Result:=FOWner.FComponents.IndexOf(Self) Result := FOwner.FComponents.IndexOf(Self)
else else
Result:=-1; Result := -1;
end; end;
Procedure TComponent.Insert(AComponent: TComponent); procedure TComponent.Insert(AComponent: TComponent);
begin begin
If not assigned(FComponents) then if not Assigned(FComponents) then
FComponents:=TList.Create; FComponents := TList.Create;
FComponents.Add(AComponent); FComponents.Add(AComponent);
AComponent.FOwner:=Self; AComponent.FOwner := Self;
end; end;
Procedure TComponent.ReadLeft(Reader: TReader); procedure TComponent.ReadLeft(Reader: TReader);
begin begin
LongRec(FDesignInfo).Lo:=Reader.ReadInteger; LongRec(FDesignInfo).Lo := Reader.ReadInteger;
end; end;
Procedure TComponent.ReadTop(Reader: TReader); procedure TComponent.ReadTop(Reader: TReader);
begin begin
LongRec(FDesignInfo).Hi:=Reader.ReadInteger; LongRec(FDesignInfo).Hi := Reader.ReadInteger;
end; end;
Procedure TComponent.Remove(AComponent: TComponent); procedure TComponent.Remove(AComponent: TComponent);
begin begin
AComponent.FOwner:=Nil; AComponent.FOwner := nil;
If assigned(FCOmponents) then if Assigned(FCOmponents) then
begin begin
FComponents.Remove(AComponent); FComponents.Remove(AComponent);
IF FComponents.Count=0 then iF FComponents.Count = 0 then
begin FreeAndNil(FComponents);
FComponents.Free; end;
FComponents:=Nil;
end;
end;
end; end;
Procedure TComponent.RemoveNotification(AComponent: TComponent); procedure TComponent.RemoveNotification(AComponent: TComponent);
begin begin
if FFreeNotifies<>nil then if Assigned(FFreeNotifies) then
begin begin
FFreeNotifies.Remove(AComponent); FFreeNotifies.Remove(AComponent);
if FFreeNotifies.Count=0 then if FFreeNotifies.Count=0 then
begin
FFreeNotifies.Free;
FFreeNotifies:=nil;
Exclude(FComponentState,csFreeNotification);
end;
end;
end;
Procedure TComponent.SetComponentIndex(Value: Integer);
Var Temp,Count : longint;
begin
If Not assigned(Fowner) then exit;
Temp:=getcomponentindex;
If temp<0 then exit;
If value<0 then value:=0;
Count:=Fowner.FComponents.Count;
If Value>=Count then value:=count-1;
If Value<>Temp then
begin begin
FOWner.FComponents.Delete(Temp); FreeAndNil(FFreeNotifies);
FOwner.FComponents.Insert(Value,Self); Exclude(FComponentState,csFreeNotification);
end; end;
end;
end; end;
Procedure TComponent.SetReference(Enable: Boolean); procedure TComponent.SetComponentIndex(Value: Integer);
var
OldIndex, Count: Integer;
begin
if not Assigned(FOwner) then Exit;
OldIndex := GetComponentIndex;
if OldIndex < 0 then Exit;
if Value < 0 then Value := 0;
Count := FOwner.FComponents.Count;
if Value >= Count then Value := Count-1;
if Value <> OldIndex then
begin
FOwner.FComponents.Delete(OldIndex);
FOwner.FComponents.Insert(Value, Self);
end;
end;
procedure TComponent.SetReference(Enable: Boolean);
var var
Field: ^TComponent; Field: ^TComponent;
begin begin
if Assigned(Owner) then if Assigned(FOwner) then
begin begin
Field := Owner.FieldAddress(Name); Field := FOwner.FieldAddress(Name);
if Assigned(Field) then if Assigned(Field) then
if Enable then if Enable then
Field^ := Self Field^ := Self
@ -155,35 +144,31 @@ begin
end; end;
Procedure TComponent.WriteLeft(Writer: TWriter); procedure TComponent.WriteLeft(Writer: TWriter);
begin begin
Writer.WriteInteger(LongRec(FDesignInfo).Lo); Writer.WriteInteger(LongRec(FDesignInfo).Lo);
end; end;
Procedure TComponent.WriteTop(Writer: TWriter); procedure TComponent.WriteTop(Writer: TWriter);
begin begin
Writer.WriteInteger(LongRec(FDesignInfo).Hi); Writer.WriteInteger(LongRec(FDesignInfo).Hi);
end; end;
Procedure TComponent.ChangeName(const NewName: TComponentName); {procedure TComponent.ChangeName(const NewName: TComponentName);
begin begin
FName:=NewName; FName := NewName;
end; end;}
Procedure TComponent.DefineProperties(Filer: TFiler); procedure TComponent.DefineProperties(Filer: TFiler);
var
Var Ancestor : TComponent; Ancestor: TComponent;
Temp : longint; Temp: Longint;
begin begin
Temp:=0; Temp := 0;
Ancestor:=TComponent(Filer.Ancestor); Ancestor := TComponent(Filer.Ancestor);
If Assigned(Ancestor) then Temp:=Ancestor.FDesignInfo; If Assigned(Ancestor) then Temp:=Ancestor.FDesignInfo;
Filer.Defineproperty('left',@readleft,@writeleft, Filer.Defineproperty('left',@readleft,@writeleft,
(longrec(FDesignInfo).Lo<>Longrec(temp).Lo)); (longrec(FDesignInfo).Lo<>Longrec(temp).Lo));
@ -192,383 +177,355 @@ begin
end; end;
Procedure TComponent.GetChildren(Proc: TGetChildProc; Root: TComponent); procedure TComponent.GetChildren(Proc: TGetChildProc; Root: TComponent);
begin begin
// Does nothing. // Does nothing.
end; end;
Function TComponent.GetChildOwner: TComponent; function TComponent.GetChildOwner: TComponent;
begin begin
Result:=Nil; Result := nil;
end; end;
Function TComponent.GetChildParent: TComponent; function TComponent.GetChildParent: TComponent;
begin begin
Result:=Self; Result := Self;
end; end;
Function TComponent.GetNamePath: string; function TComponent.GetNamePath: string;
begin begin
Result:=FName; Result := FName;
end; end;
Function TComponent.GetOwner: TPersistent; function TComponent.GetOwner: TPersistent;
begin begin
Result:=FOwner; Result := FOwner;
end; end;
Procedure TComponent.Loaded; procedure TComponent.Loaded;
begin begin
Exclude(FComponentState,csLoading); Exclude(FComponentState,csLoading);
end; end;
Procedure TComponent.Loading;
procedure TComponent.Loading;
begin begin
Include(FComponentState,csLoading); Include(FComponentState,csLoading);
end; end;
Procedure TComponent.Notification(AComponent: TComponent; procedure TComponent.Notification(AComponent: TComponent; Operation: TOperation);
Operation: TOperation); var
Runner: Integer;
Var Runner : Longint;
begin begin
If (Operation=opRemove) and Assigned(FFreeNotifies) then if (Operation=opRemove) and Assigned(FFreeNotifies) then
begin begin
FFreeNotifies.Remove(AComponent); FFreeNotifies.Remove(AComponent);
If FFreeNotifies.Count=0 then if FFreeNotifies.Count=0 then
begin begin
FFreeNotifies.Free; FreeAndNil(FFreeNotifies);
FFreenotifies:=Nil; Exclude(FComponentState,csFreeNotification);
end;
end; end;
If assigned(FComponents) then end;
For Runner:=0 To FComponents.Count-1 do
TComponent(FComponents.Items[Runner]).Notification(AComponent,Operation); if Assigned(FComponents) then
for Runner := 0 To FComponents.Count-1 do
TComponent(FComponents.List^[Runner]).Notification(AComponent,Operation);
end; end;
procedure TComponent.PaletteCreated; procedure TComponent.PaletteCreated;
begin begin
end; end;
Procedure TComponent.ReadState(Reader: TReader); procedure TComponent.ReadState(Reader: TReader);
begin begin
Reader.ReadData(Self); Reader.ReadData(Self);
end; end;
Procedure TComponent.SetAncestor(Value: Boolean); procedure TComponent.SetAncestor(Value: Boolean);
var
Var Runner : Longint; Runner: Integer;
begin begin
If Value then if Value then
Include(FComponentState,csAncestor) Include(FComponentState,csAncestor)
else else
Exclude(FCOmponentState,csAncestor); Exclude(FCOmponentState,csAncestor);
if Assigned(FComponents) then if Assigned(FComponents) then
For Runner:=0 To FComponents.Count-1 do For Runner := 0 To FComponents.Count-1 do
TComponent(FComponents.Items[Runner]).SetAncestor(Value); TComponent(FComponents.List^[Runner]).SetAncestor(Value);
end; end;
Procedure TComponent.SetDesigning(Value: Boolean; SetChildren : Boolean = True); procedure TComponent.SetDesigning(Value: Boolean; SetChildren : Boolean = True);
var
Var Runner : Longint; Runner: Integer;
begin begin
If Value then if Value then
Include(FComponentState,csDesigning) Include(FComponentState,csDesigning)
else else
Exclude(FComponentState,csDesigning); Exclude(FComponentState,csDesigning);
if Assigned(FComponents) and SetChildren then if Assigned(FComponents) and SetChildren then
For Runner:=0 To FComponents.Count - 1 do For Runner := 0 To FComponents.Count - 1 do
TComponent(FComponents.items[Runner]).SetDesigning(Value); TComponent(FComponents.List^[Runner]).SetDesigning(Value);
end; end;
Procedure TComponent.SetDesignInstance(Value: Boolean);
procedure TComponent.SetDesignInstance(Value: Boolean);
begin begin
If Value then if Value then
Include(FComponentState,csDesignInstance) Include(FComponentState,csDesignInstance)
else else
Exclude(FComponentState,csDesignInstance); Exclude(FComponentState,csDesignInstance);
end; end;
Procedure TComponent.SetInline(Value: Boolean);
procedure TComponent.SetInline(Value: Boolean);
begin begin
If Value then if Value then
Include(FComponentState,csInline) Include(FComponentState,csInline)
else else
Exclude(FComponentState,csInline); Exclude(FComponentState,csInline);
end; end;
Procedure TComponent.SetName(const NewName: TComponentName); procedure TComponent.SetName(const NewName: TComponentName);
begin begin
If FName=NewName then exit; if FName=NewName then Exit;
If (NewName<>'') and not IsValidIdent(NewName) then if (NewName<>'') and not IsValidIdent(NewName) then
Raise EComponentError.CreateFmt(SInvalidName,[NewName]); raise EComponentError.CreateFmt(SInvalidName,[NewName]);
If Assigned(FOwner) Then
if Assigned(FOwner) Then
FOwner.ValidateRename(Self,FName,NewName) FOwner.ValidateRename(Self,FName,NewName)
else else
ValidateRename(Nil,FName,NewName); ValidateRename(Nil,FName,NewName);
SetReference(False); SetReference(False);
ChangeName(NewName); //ChangeName(NewName);
FName := NewName;
Setreference(True); Setreference(True);
end; end;
Procedure TComponent.SetChildOrder(Child: TComponent; Order: Integer); procedure TComponent.SetChildOrder(Child: TComponent; Order: Integer);
begin begin
// does nothing // does nothing
end; end;
Procedure TComponent.SetParentComponent(Value: TComponent); procedure TComponent.SetParentComponent(Value: TComponent);
begin begin
// Does nothing // Does nothing
end; end;
Procedure TComponent.Updating; procedure TComponent.Updating;
begin begin
Include (FComponentState,csUpdating); Include (FComponentState,csUpdating);
end; end;
Procedure TComponent.Updated; procedure TComponent.Updated;
begin begin
Exclude(FComponentState,csUpdating); Exclude(FComponentState,csUpdating);
end; end;
class Procedure TComponent.UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); class procedure TComponent.UpdateRegistry(Register: Boolean; const ClassID, ProgID: string);
begin begin
// For compatibility only. // For compatibility only.
end; end;
Procedure TComponent.ValidateRename(AComponent: TComponent; procedure TComponent.ValidateRename(AComponent: TComponent;
const CurName, NewName: string); const CurName, NewName: string);
begin begin
//!! This contradicts the Delphi manual. //!! This contradicts the Delphi manual.
If (AComponent<>Nil) and (CompareText(CurName,NewName)<>0) and (AComponent.Owner = Self) and if Assigned(AComponent) and (CompareText(CurName,NewName)<>0) and
(FindComponent(NewName)<>Nil) then (AComponent.Owner = Self) and Assigned(FindComponent(NewName)) then
raise EComponentError.Createfmt(SDuplicateName,[newname]); raise EComponentError.Createfmt(SDuplicateName,[newname]);
If (csDesigning in FComponentState) and (FOwner<>Nil) then
if (csDesigning in FComponentState) and Assigned(FOwner) then
FOwner.ValidateRename(AComponent,Curname,Newname); FOwner.ValidateRename(AComponent,Curname,Newname);
end; end;
Procedure TComponent.ValidateContainer(AComponent: TComponent); procedure TComponent.ValidateContainer(AComponent: TComponent);
begin begin
AComponent.ValidateInsert(Self); AComponent.ValidateInsert(Self);
end; end;
Procedure TComponent.ValidateInsert(AComponent: TComponent); procedure TComponent.ValidateInsert(AComponent: TComponent);
begin begin
// Does nothing. // Does nothing.
end; end;
Procedure TComponent.WriteState(Writer: TWriter); procedure TComponent.WriteState(Writer: TWriter);
begin begin
Writer.WriteComponentData(Self); Writer.WriteComponentData(Self);
end; end;
Constructor TComponent.Create(AOwner: TComponent); constructor TComponent.Create(AOwner: TComponent);
begin begin
FComponentStyle:=[csInheritable]; FComponentStyle := [csInheritable];
If Assigned(AOwner) then AOwner.InsertComponent(Self); if Assigned(AOwner) then
AOwner.InsertComponent(Self);
end; end;
Destructor TComponent.Destroy; destructor TComponent.Destroy;
var
C: TComponent;
begin
while Assigned(FFreeNotifies) and (FFreeNotifies.Count > 0) do
begin
C := TComponent(FFreeNotifies.List^[0]);
FFreeNotifies.Delete(0);
C.Notification(Self, opRemove);
end;
FreeAndNil(FFreeNotifies);
Exclude(FComponentState,csFreeNotification);
Var DestroyComponents;
I : Integer; if Assigned(FOwner) then
C : TComponent; FOwner.RemoveComponent(Self);
inherited Destroy;
end;
procedure TComponent.BeforeDestruction;
begin begin
Destroying; Destroying;
If Assigned(FFreeNotifies) then
begin
I:=FFreeNotifies.Count-1;
While (I>=0) do
begin
C:=TComponent(FFreeNotifies.Items[I]);
// Delete, so one component is not notified twice, if it is owned.
FFreeNotifies.Delete(I);
C.Notification (self,opRemove);
If (FFreeNotifies=Nil) then
I:=0
else if (I>FFreeNotifies.Count) then
I:=FFreeNotifies.Count;
dec(i);
end;
FreeAndNil(FFreeNotifies);
end;
DestroyComponents;
If FOwner<>Nil Then FOwner.RemoveComponent(Self);
inherited destroy;
end; end;
Procedure TComponent.BeforeDestruction; procedure TComponent.DestroyComponents;
var
acomponent: TComponent;
begin begin
if not(csDestroying in FComponentstate) then while assigned(FComponents) do
Destroying; begin
end; aComponent := TComponent(FComponents.Last);
Procedure TComponent.DestroyComponents;
Var acomponent: TComponent;
begin
While assigned(FComponents) do
begin
aComponent:=TComponent(FComponents.Last);
Remove(aComponent); Remove(aComponent);
Acomponent.Destroy; Acomponent.Free;
end; end;
end; end;
Procedure TComponent.Destroying; procedure TComponent.Destroying;
var
Var Runner : longint; Runner: Integer;
begin begin
If csDestroying in FComponentstate Then Exit; if csDestroying in FComponentstate then Exit;
include (FComponentState,csDestroying); Include(FComponentState,csDestroying);
If Assigned(FComponents) then if Assigned(FComponents) then
for Runner:=0 to FComponents.Count-1 do for Runner := 0 to FComponents.Count-1 do
TComponent(FComponents.Items[Runner]).Destroying; TComponent(FComponents.List^[Runner]).Destroying;
end; end;
function TComponent.ExecuteAction(Action: TBasicAction): Boolean; function TComponent.ExecuteAction(Action: TBasicAction): Boolean;
begin begin
if Action.HandlesTarget(Self) then if Action.HandlesTarget(Self) then
begin begin
Action.ExecuteTarget(Self); Action.ExecuteTarget(Self);
Result := True; Result := True;
end end else
else Result := False;
Result := False;
end; end;
Function TComponent.FindComponent(const AName: string): TComponent; function TComponent.FindComponent(const AName: string): TComponent;
var
Var I : longint; I: Integer;
begin begin
Result:=Nil; Result := nil;
If (AName='') or Not assigned(FComponents) then exit; if (AName='') or not Assigned(FComponents) then
For i:=0 to FComponents.Count-1 do Exit;
if (CompareText(TComponent(FComponents[I]).Name,AName)=0) then
begin
Result:=TComponent(FComponents.Items[I]);
exit;
end;
end;
for I := 0 to FComponents.Count-1 do
Procedure TComponent.FreeNotification(AComponent: TComponent); if (CompareText(TComponent(FComponents.List^[I]).Name,AName)=0) then
begin
If (Owner<>Nil) and (AComponent=Owner) then exit;
if csDestroying in ComponentState then
AComponent.Notification(Self,opRemove)
else
begin begin
If not (Assigned(FFreeNotifies)) then Result := TComponent(FComponents.List^[I]);
FFreeNotifies:=TList.Create; Exit;
If FFreeNotifies.IndexOf(AComponent)=-1 then
begin
FFreeNotifies.Add(AComponent);
AComponent.FreeNotification (self);
end;
end; end;
end; end;
procedure TComponent.FreeNotification(AComponent: TComponent);
begin
if Assigned(Owner) and (AComponent=Owner) then
Exit;
if not (csDestroying in ComponentState) then
begin
if not Assigned(FFreeNotifies) then
begin
FFreeNotifies := TList.Create;
Include(FComponentState,csFreeNotification);
end;
if FFreeNotifies.IndexOf(AComponent)=-1 then
begin
FFreeNotifies.Add(AComponent);
AComponent.FreeNotification(Self);
end;
end else
AComponent.Notification(Self,opRemove)
end;
procedure TComponent.RemoveFreeNotification(AComponent: TComponent); procedure TComponent.RemoveFreeNotification(AComponent: TComponent);
begin begin
RemoveNotification(AComponent); RemoveNotification(AComponent);
AComponent.RemoveNotification (self); AComponent.RemoveNotification(Self);
end; end;
Procedure TComponent.FreeOnRelease; procedure TComponent.FreeOnRelease;
begin begin
// Delphi compatibility only at the moment. // Delphi compatibility only at the moment.
end; end;
Function TComponent.GetParentComponent: TComponent; function TComponent.GetParentComponent: TComponent;
begin begin
Result:=Nil; Result := nil;
end; end;
Function TComponent.HasParent: Boolean; function TComponent.HasParent: Boolean;
begin begin
Result:=False; Result := False;
end; end;
Procedure TComponent.InsertComponent(AComponent: TComponent); procedure TComponent.InsertComponent(AComponent: TComponent);
begin begin
AComponent.ValidateContainer(Self); AComponent.ValidateContainer(Self);
ValidateRename(AComponent,'',AComponent.FName); ValidateRename(AComponent,'',AComponent.FName);
Insert(AComponent); Insert(AComponent);
AComponent.SetReference(True); AComponent.SetReference(True);
If csDesigning in FComponentState then if csDesigning in FComponentState then
AComponent.SetDesigning(true); AComponent.SetDesigning(true);
Notification(AComponent,opInsert); Notification(AComponent,opInsert);
end; end;
Procedure TComponent.RemoveComponent(AComponent: TComponent); procedure TComponent.RemoveComponent(AComponent: TComponent);
begin begin
Notification(AComponent,opRemove); Notification(AComponent,opRemove);
AComponent.SetReference(False); AComponent.SetReference(False);
@ -578,13 +535,13 @@ begin
end; end;
Function TComponent.SafeCallException(ExceptObject: TObject; function TComponent.SafeCallException(ExceptObject: TObject;
ExceptAddr: Pointer): Integer; ExceptAddr: Pointer): Integer;
begin begin
SafeCallException:=0; SafeCallException := 0;
end; end;
procedure TComponent.SetSubComponent(ASubComponent: Boolean); procedure TComponent.SetSubComponent(ASubComponent: Boolean);
begin begin
if ASubComponent then if ASubComponent then
@ -597,34 +554,36 @@ end;
function TComponent.UpdateAction(Action: TBasicAction): Boolean; function TComponent.UpdateAction(Action: TBasicAction): Boolean;
begin begin
if Action.HandlesTarget(Self) then if Action.HandlesTarget(Self) then
begin begin
Action.UpdateTarget(Self); Action.UpdateTarget(Self);
Result := True; Result := True;
end end else
else
Result := False; Result := False;
end; end;
function TComponent.QueryInterface(const IID: TGUID; out Obj): HResult;stdcall; function TComponent.QueryInterface(const IID: TGUID; out Obj): HResult;stdcall;
begin begin
if GetInterface(IID, Obj) then if GetInterface(IID, Obj) then
result:=S_OK Result := S_OK
else else
result:=E_NOINTERFACE; Result := E_NOINTERFACE;
end; end;
function TComponent._AddRef: Integer;stdcall; function TComponent._AddRef: Integer;stdcall;
begin begin
result:=-1; Result := -1;
end; end;
function TComponent._Release: Integer;stdcall; function TComponent._Release: Integer;stdcall;
begin begin
result:=-1; Result := -1;
end; end;
function TComponent.iicrGetComponent: TComponent; function TComponent.iicrGetComponent: TComponent;
begin begin
result:=self; Result := self;
end; end;