mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-11 10:40:41 +01:00
TApplication now sets FindGlobalComponent always
git-svn-id: trunk@7497 -
This commit is contained in:
parent
a7cd638873
commit
f747f8fec6
@ -670,6 +670,7 @@ begin
|
||||
DoFinishReading;
|
||||
finally
|
||||
UnregisterFindGlobalComponentProc(@MyFindGlobalComponent);
|
||||
Application.FindGlobalComponentEnabled:=true;
|
||||
if DestroyDriver then Reader.Driver.Free;
|
||||
Reader.Free;
|
||||
end;
|
||||
@ -697,6 +698,7 @@ begin
|
||||
Reader:=CreateLRSReader(BinStream,DestroyDriver);
|
||||
MyFindGlobalComponentProc:=@OnFindGlobalComponent;
|
||||
RegisterFindGlobalComponentProc(@MyFindGlobalComponent);
|
||||
Application.FindGlobalComponentEnabled:=false;
|
||||
|
||||
{$IFDEF VerboseJITForms}
|
||||
writeln('[TJITComponentList.InitReading] A');
|
||||
@ -867,6 +869,7 @@ begin
|
||||
DoFinishReading;
|
||||
finally
|
||||
UnregisterFindGlobalComponentProc(@MyFindGlobalComponent);
|
||||
Application.FindGlobalComponentEnabled:=true;
|
||||
if DestroyDriver then Reader.Driver.Free;
|
||||
Reader.Free;
|
||||
end;
|
||||
|
||||
@ -857,6 +857,7 @@ type
|
||||
private
|
||||
FApplicationHandlers: array[TApplicationHandlerType] of TMethodList;
|
||||
FCaptureExceptions: boolean;
|
||||
FFindGlobalComponentEnabled: boolean;
|
||||
FFlags: TApplicationFlags;
|
||||
FHint: string;
|
||||
FHintColor: TColor;
|
||||
@ -997,6 +998,8 @@ type
|
||||
procedure DoTabKey(AControl: TWinControl; var Key: Word;Shift: TShiftState);
|
||||
property CaptureExceptions: boolean read FCaptureExceptions
|
||||
write SetCaptureExceptions;
|
||||
property FindGlobalComponentEnabled: boolean read FFindGlobalComponentEnabled
|
||||
write FFindGlobalComponentEnabled;
|
||||
//property HelpSystem : IHelpSystem read FHelpSystem;
|
||||
property Hint: string read FHint write SetHint;
|
||||
property HintColor: TColor read FHintColor write SetHintColor;
|
||||
|
||||
@ -27,7 +27,10 @@ const
|
||||
|
||||
function FindApplicationComponent(const ComponentName: string): TComponent;
|
||||
begin
|
||||
Result:=Application.FindComponent(ComponentName);
|
||||
if Application.FindGlobalComponentEnabled then
|
||||
Result:=Application.FindComponent(ComponentName)
|
||||
else
|
||||
Result:=nil;
|
||||
end;
|
||||
|
||||
function GetHintControl(Control: TControl): TControl;
|
||||
@ -93,6 +96,8 @@ begin
|
||||
ApplicationActionComponent:=Self;
|
||||
OnMenuPopupHandler:=@MenuPopupHandler;
|
||||
|
||||
FFindGlobalComponentEnabled:=true;
|
||||
RegisterFindGlobalComponentProc(@FindApplicationComponent);
|
||||
|
||||
inherited Create(AOwner);
|
||||
CaptureExceptions:=true;
|
||||
@ -132,6 +137,9 @@ begin
|
||||
for HandlerType:=Low(TApplicationHandlerType) to High(TApplicationHandlerType)
|
||||
do
|
||||
FreeThenNil(FApplicationHandlers[HandlerType]);
|
||||
|
||||
UnregisterFindGlobalComponentProc(@FindApplicationComponent);
|
||||
|
||||
inherited Destroy;
|
||||
|
||||
Include(FFlags,AppDoNotReleaseComponents);
|
||||
@ -1414,7 +1422,6 @@ begin
|
||||
// events and constructors can refer to it
|
||||
TComponent(Reference) := Instance;
|
||||
|
||||
RegisterFindGlobalComponentProc(@FindApplicationComponent);
|
||||
ok:=false;
|
||||
try
|
||||
Instance.Create(Self);
|
||||
@ -1422,7 +1429,6 @@ begin
|
||||
finally
|
||||
if not ok then
|
||||
TComponent(Reference) := nil;
|
||||
UnregisterFindGlobalComponentProc(@FindApplicationComponent);
|
||||
end;
|
||||
|
||||
if (Instance is TForm) then begin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user