* Add IsUniqueGlobalComponentName

This commit is contained in:
Michaël Van Canneyt 2024-02-20 11:01:35 +01:00
parent 6f25cccda9
commit 8f8ce13b41
2 changed files with 15 additions and 2 deletions

View File

@ -1462,6 +1462,14 @@ function FindGlobalComponent(const Name: string): TComponent;
end;
end;
function IsUniqueGlobalComponentName(const aName: string): Boolean;
begin
if Assigned(IsUniqueGlobalComponentNameProc) then
Result:=IsUniqueGlobalComponentNameProc(aName)
else
Result:=Not Assigned(FindGlobalComponent(aName));
end;
procedure RegisterInitComponentHandler(ComponentClass: TComponentClass; Handler: TInitComponentHandler);
Var

View File

@ -2829,9 +2829,13 @@ procedure RegisterNoIcon(ComponentClasses: array of TComponentClass);
procedure RegisterNonActiveX(ComponentClasses: array of TComponentClass;
AxRegType: TActiveXRegType);
Type
TIsUniqueGlobalComponentName = function(const Name: string): Boolean;
var
GlobalNameSpace: IReadWriteSync;
IsUniqueGlobalComponentNameProc: TIsUniqueGlobalComponentName;
{ Object filing routines }
type
@ -2844,7 +2848,7 @@ type
TIntToIdent = function(Int: Longint; var Ident: string): Boolean;
TFindGlobalComponent = function(const Name: string): TComponent;
TInitComponentHandler = function(Instance: TComponent; RootAncestor : TClass): boolean;
var
MainThreadID: TThreadID;
@ -2858,6 +2862,7 @@ function FindIdentToInt(AIntegerType: Pointer): TIdentToInt;
procedure RegisterFindGlobalComponentProc(AFindGlobalComponent: TFindGlobalComponent);
procedure UnregisterFindGlobalComponentProc(AFindGlobalComponent: TFindGlobalComponent);
function FindGlobalComponent(const Name: string): TComponent;
function IsUniqueGlobalComponentName(const aName: string): Boolean;
function InitInheritedComponent(Instance: TComponent; RootAncestor: TClass): Boolean;
function InitComponentRes(const ResName: string; Instance: TComponent): Boolean;