mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-26 12:08:16 +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}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF VerboseFocus}
|
{$IFDEF VerboseFocus}
|
||||||
Debugln(['TCustomForm.SetActiveControl ',DbgSName(Self),' FActive=',DbgS(FActive),' OldActiveControl=',DbgSName(FActiveControl),' NewActiveControl=',DbgSName(AWinControl)]);
|
Debugln(['TCustomForm.SetActiveControl ',DbgSName(Self),' FActive=',DbgS(FActive),' OldActiveControl=',DbgSName(FActiveControl),' NewActiveControl=',DbgSName(AWinControl)]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
if Assigned(FActiveControl) and not (FActiveControl is TCustomForm) then
|
||||||
|
FLastActiveControl := FActiveControl
|
||||||
|
else
|
||||||
|
FLastActiveControl:=nil;
|
||||||
FActiveControl := AWinControl;
|
FActiveControl := AWinControl;
|
||||||
if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
|
if Assigned(FActiveControl) then
|
||||||
FLastActiveControl := FActiveControl;
|
FreeNotification(FActiveControl);
|
||||||
if Assigned(FActiveControl) then FreeNotification(FActiveControl);
|
|
||||||
if ([csLoading, csDestroying] * ComponentState = []) then
|
if ([csLoading, csDestroying] * ComponentState = []) then
|
||||||
begin
|
begin
|
||||||
if FActive then
|
if FActive then
|
||||||
@ -2544,9 +2546,11 @@ begin
|
|||||||
{$IFDEF VerboseFocus}
|
{$IFDEF VerboseFocus}
|
||||||
debugln(['TCustomForm.SetFocusedControl ',DbgSName(Self),' OldActiveControl=',DbgSName(FActiveControl),' New=',DbgSName(Control)]);
|
debugln(['TCustomForm.SetFocusedControl ',DbgSName(Self),' OldActiveControl=',DbgSName(FActiveControl),' New=',DbgSName(Control)]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
if Assigned(FActiveControl) and not (FActiveControl is TCustomForm) then
|
||||||
|
FLastActiveControl := FActiveControl
|
||||||
|
else
|
||||||
|
FLastActiveControl := nil;
|
||||||
FActiveControl := Control;
|
FActiveControl := Control;
|
||||||
if (FActiveControl<>nil) and not (FActiveControl is TCustomForm) then
|
|
||||||
FLastActiveControl := FActiveControl;
|
|
||||||
if Assigned(FActiveControl) then
|
if Assigned(FActiveControl) then
|
||||||
FreeNotification(FActiveControl);
|
FreeNotification(FActiveControl);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user