mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 04:39:36 +02:00
LCL: Fix TForm.LastActiveControl behavior. Issue #40774, patch by Bernd Jung.
This commit is contained in:
parent
51a6c3d25c
commit
16e2f677e2
@ -1880,14 +1880,16 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
{$IFDEF VerboseFocus}
|
||||
Debugln(['TCustomForm.SetActiveControl ',DbgSName(Self),' FActive=',DbgS(FActive),' OldActiveControl=',DbgSName(FActiveControl),' NewActiveControl=',DbgSName(AWinControl)]);
|
||||
{$ENDIF}
|
||||
if Assigned(FActiveControl) and not (FActiveControl is TCustomForm) then
|
||||
FLastActiveControl := FActiveControl
|
||||
else
|
||||
FLastActiveControl:=nil;
|
||||
FActiveControl := AWinControl;
|
||||
if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
|
||||
FLastActiveControl := FActiveControl;
|
||||
if Assigned(FActiveControl) then FreeNotification(FActiveControl);
|
||||
if Assigned(FActiveControl) then
|
||||
FreeNotification(FActiveControl);
|
||||
if ([csLoading, csDestroying] * ComponentState = []) then
|
||||
begin
|
||||
if FActive then
|
||||
@ -2544,9 +2546,11 @@ begin
|
||||
{$IFDEF VerboseFocus}
|
||||
debugln(['TCustomForm.SetFocusedControl ',DbgSName(Self),' OldActiveControl=',DbgSName(FActiveControl),' New=',DbgSName(Control)]);
|
||||
{$ENDIF}
|
||||
if Assigned(FActiveControl) and not (FActiveControl is TCustomForm) then
|
||||
FLastActiveControl := FActiveControl
|
||||
else
|
||||
FLastActiveControl := nil;
|
||||
FActiveControl := Control;
|
||||
if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
|
||||
FLastActiveControl := FActiveControl;
|
||||
if Assigned(FActiveControl) then
|
||||
FreeNotification(FActiveControl);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user