* reverted 13297

git-svn-id: trunk@13298 -
This commit is contained in:
ivost 2009-06-19 09:03:51 +00:00
parent 8b7167e538
commit 91430b6837
2 changed files with 291 additions and 250 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,126 +15,137 @@
{* TComponent *} {* TComponent *}
{****************************************************************************} {****************************************************************************}
function TComponent.GetComponent(AIndex: Integer): TComponent; Function TComponent.GetComponent(AIndex: Integer): TComponent;
begin begin
if Assigned(FComponents) then If not assigned(FComponents) then
Result := TComponent(FComponents.Items[Aindex]) Result:=Nil
else else
Result := nil; Result:=TComponent(FComponents.Items[Aindex]);
end; end;
function TComponent.IsImplementorOf (const Intf:IInterface):boolean;
function TComponent.IsImplementorOf(const Intf: IInterface):boolean; var ref : IInterfaceComponentReference;
var
ref: IInterfaceComponentReference;
begin begin
result := Assigned(intf) and Supports(intf,IInterfaceComponentReference,ref) and (ref.getcomponent=self); result:=assigned(intf) and supports(intf,IInterfaceComponentReference,ref);
if result then
result:=ref.getcomponent=self;
end; end;
procedure TComponent.ReferenceInterface(const intf:IInterface;op:TOperation);
procedure TComponent.ReferenceInterface(const intf: IInterface; op: TOperation); var ref : IInterfaceComponentReference;
var comp : TComponent;
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 assigned(FComponents) then If not assigned(FComponents) then
Result := FComponents.Count result:=0
else else
Result := 0; Result:=FComponents.Count;
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
FreeAndNil(FComponents); begin
end; FComponents.Free;
FComponents:=Nil;
end;
end;
end; end;
procedure TComponent.RemoveNotification(AComponent: TComponent); Procedure TComponent.RemoveNotification(AComponent: TComponent);
begin begin
if Assigned(FFreeNotifies) then if FFreeNotifies<>nil then
begin begin
FFreeNotifies.Remove(AComponent); FFreeNotifies.Remove(AComponent);
if FFreeNotifies.Count=0 then if FFreeNotifies.Count=0 then
begin begin
FreeAndNil(FFreeNotifies); FFreeNotifies.Free;
FFreeNotifies:=nil;
Exclude(FComponentState,csFreeNotification); Exclude(FComponentState,csFreeNotification);
end;
end; end;
end;
end; end;
procedure TComponent.SetComponentIndex(Value: Integer); Procedure TComponent.SetComponentIndex(Value: Integer);
var
OldIndex, Count: Integer; Var Temp,Count : longint;
begin begin
if not Assigned(FOwner) then Exit; If Not assigned(Fowner) then exit;
OldIndex := GetComponentIndex; Temp:=getcomponentindex;
if OldIndex < 0 then Exit; If temp<0 then exit;
if Value < 0 then Value := 0; If value<0 then value:=0;
Count := FOwner.FComponents.Count; Count:=Fowner.FComponents.Count;
if Value >= Count then Value := Count-1; If Value>=Count then value:=count-1;
if Value <> OldIndex then If Value<>Temp then
begin begin
FOwner.FComponents.Delete(OldIndex); FOWner.FComponents.Delete(Temp);
FOwner.FComponents.Insert(Value, Self); FOwner.FComponents.Insert(Value,Self);
end; end;
end; end;
procedure TComponent.SetReference(Enable: Boolean); Procedure TComponent.SetReference(Enable: Boolean);
var var
Field: ^TComponent; Field: ^TComponent;
begin begin
if Assigned(FOwner) then if Assigned(Owner) then
begin begin
Field := FOwner.FieldAddress(Name); Field := Owner.FieldAddress(Name);
if Assigned(Field) then if Assigned(Field) then
if Enable then if Enable then
Field^ := Self Field^ := Self
@ -144,31 +155,35 @@ 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
Ancestor: TComponent; Var 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));
@ -177,355 +192,383 @@ 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; Operation: TOperation); Procedure TComponent.Notification(AComponent: TComponent;
var Operation: TOperation);
Runner: Integer;
begin
if (Operation=opRemove) and Assigned(FFreeNotifies) then
begin
FFreeNotifies.Remove(AComponent);
if FFreeNotifies.Count=0 then
begin
FreeAndNil(FFreeNotifies);
Exclude(FComponentState,csFreeNotification);
end;
end;
if Assigned(FComponents) then Var Runner : Longint;
for Runner := 0 To FComponents.Count-1 do
TComponent(FComponents.List^[Runner]).Notification(AComponent,Operation); begin
If (Operation=opRemove) and Assigned(FFreeNotifies) then
begin
FFreeNotifies.Remove(AComponent);
If FFreeNotifies.Count=0 then
begin
FFreeNotifies.Free;
FFreenotifies:=Nil;
end;
end;
If assigned(FComponents) then
For Runner:=0 To FComponents.Count-1 do
TComponent(FComponents.Items[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
Runner: Integer; Var Runner : Longint;
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.List^[Runner]).SetAncestor(Value); TComponent(FComponents.Items[Runner]).SetAncestor(Value);
end; end;
procedure TComponent.SetDesigning(Value: Boolean; SetChildren : Boolean = True); Procedure TComponent.SetDesigning(Value: Boolean; SetChildren : Boolean = True);
var
Runner: Integer; Var Runner : Longint;
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.List^[Runner]).SetDesigning(Value); TComponent(FComponents.items[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
if FName=NewName then Exit;
if (NewName<>'') and not IsValidIdent(NewName) then
raise EComponentError.CreateFmt(SInvalidName,[NewName]);
if Assigned(FOwner) Then begin
If FName=NewName then exit;
If (NewName<>'') and not IsValidIdent(NewName) then
Raise EComponentError.CreateFmt(SInvalidName,[NewName]);
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 Assigned(AComponent) and (CompareText(CurName,NewName)<>0) and If (AComponent<>Nil) and (CompareText(CurName,NewName)<>0) and (AComponent.Owner = Self) and
(AComponent.Owner = Self) and Assigned(FindComponent(NewName)) then (FindComponent(NewName)<>Nil) 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 If Assigned(AOwner) then AOwner.InsertComponent(Self);
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);
DestroyComponents; Var
if Assigned(FOwner) then I : Integer;
FOwner.RemoveComponent(Self); C : TComponent;
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.DestroyComponents; Procedure TComponent.BeforeDestruction;
var
acomponent: TComponent;
begin begin
while assigned(FComponents) do if not(csDestroying in FComponentstate) then
begin Destroying;
aComponent := TComponent(FComponents.Last); end;
Procedure TComponent.DestroyComponents;
Var acomponent: TComponent;
begin
While assigned(FComponents) do
begin
aComponent:=TComponent(FComponents.Last);
Remove(aComponent); Remove(aComponent);
Acomponent.Free; Acomponent.Destroy;
end; end;
end; end;
procedure TComponent.Destroying; Procedure TComponent.Destroying;
var
Runner: Integer; Var Runner : longint;
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.List^[Runner]).Destroying; TComponent(FComponents.Items[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 else end
Result := False; else
Result := False;
end; end;
function TComponent.FindComponent(const AName: string): TComponent; Function TComponent.FindComponent(const AName: string): TComponent;
var
I: Integer;
begin
Result := nil;
if (AName='') or not Assigned(FComponents) then
Exit;
for I := 0 to FComponents.Count-1 do Var I : longint;
if (CompareText(TComponent(FComponents.List^[I]).Name,AName)=0) then
begin begin
Result := TComponent(FComponents.List^[I]); Result:=Nil;
Exit; If (AName='') or Not assigned(FComponents) then exit;
end; For i:=0 to FComponents.Count-1 do
if (CompareText(TComponent(FComponents[I]).Name,AName)=0) then
begin
Result:=TComponent(FComponents.Items[I]);
exit;
end;
end; end;
procedure TComponent.FreeNotification(AComponent: TComponent); Procedure TComponent.FreeNotification(AComponent: TComponent);
begin begin
if Assigned(Owner) and (AComponent=Owner) then If (Owner<>Nil) and (AComponent=Owner) then exit;
Exit; if csDestroying in ComponentState then
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) AComponent.Notification(Self,opRemove)
else
begin
If not (Assigned(FFreeNotifies)) then
FFreeNotifies:=TList.Create;
If FFreeNotifies.IndexOf(AComponent)=-1 then
begin
FFreeNotifies.Add(AComponent);
AComponent.FreeNotification (self);
end;
end;
end; 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);
@ -535,12 +578,12 @@ begin
end; end;
function TComponent.SafeCallException(ExceptObject: TObject; Function TComponent.SafeCallException(ExceptObject: TObject;
ExceptAddr: Pointer): Integer; ExceptAddr: Pointer): Integer;
begin
SafeCallException := 0;
end;
begin
SafeCallException:=0;
end;
procedure TComponent.SetSubComponent(ASubComponent: Boolean); procedure TComponent.SetSubComponent(ASubComponent: Boolean);
begin begin
@ -554,36 +597,34 @@ 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 else end
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;