mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-22 15:19:15 +02:00
* Added IInterface to TComponent
This commit is contained in:
parent
17ff9cfaf5
commit
355818cd00
@ -516,7 +516,7 @@ type
|
|||||||
property Current: TComponent read GetCurrent;
|
property Current: TComponent read GetCurrent;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TComponent = class(TPersistent)
|
TComponent = class(TPersistent, IInterface)
|
||||||
private
|
private
|
||||||
FOwner: TComponent;
|
FOwner: TComponent;
|
||||||
FName: TComponentName;
|
FName: TComponentName;
|
||||||
@ -555,12 +555,16 @@ type
|
|||||||
procedure ValidateRename(AComponent: TComponent; const CurName, NewName: string); virtual;
|
procedure ValidateRename(AComponent: TComponent; const CurName, NewName: string); virtual;
|
||||||
procedure ValidateContainer(AComponent: TComponent); virtual;
|
procedure ValidateContainer(AComponent: TComponent); virtual;
|
||||||
procedure ValidateInsert(AComponent: TComponent); virtual;
|
procedure ValidateInsert(AComponent: TComponent); virtual;
|
||||||
|
protected
|
||||||
|
function _AddRef: Integer;
|
||||||
|
function _Release: Integer;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); virtual; reintroduce;
|
constructor Create(AOwner: TComponent); virtual; reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure BeforeDestruction; override;
|
procedure BeforeDestruction; override;
|
||||||
procedure DestroyComponents;
|
procedure DestroyComponents;
|
||||||
procedure Destroying;
|
procedure Destroying;
|
||||||
|
function QueryInterface(const IID: TGUID; out Obj): integer; virtual;
|
||||||
// function ExecuteAction(Action: TBasicAction): Boolean; virtual;
|
// function ExecuteAction(Action: TBasicAction): Boolean; virtual;
|
||||||
function FindComponent(const AName: string): TComponent;
|
function FindComponent(const AName: string): TComponent;
|
||||||
procedure FreeNotification(AComponent: TComponent);
|
procedure FreeNotification(AComponent: TComponent);
|
||||||
@ -3528,6 +3532,16 @@ begin
|
|||||||
if AComponent=nil then ;
|
if AComponent=nil then ;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TComponent._AddRef: Integer;
|
||||||
|
begin
|
||||||
|
Result:=-1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TComponent._Release: Integer;
|
||||||
|
begin
|
||||||
|
Result:=-1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Constructor TComponent.Create(AOwner: TComponent);
|
Constructor TComponent.Create(AOwner: TComponent);
|
||||||
|
|
||||||
@ -3601,6 +3615,15 @@ begin
|
|||||||
TComponent(FComponents.Items[Runner]).Destroying;
|
TComponent(FComponents.Items[Runner]).Destroying;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TComponent.QueryInterface(const IID: TGUID; out Obj): integer;
|
||||||
|
begin
|
||||||
|
if GetInterface(IID, Obj) then
|
||||||
|
Result := S_OK
|
||||||
|
else
|
||||||
|
Result := E_NOINTERFACE;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TComponent.FindComponent(const AName: string): TComponent;
|
Function TComponent.FindComponent(const AName: string): TComponent;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user