mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 01:49:25 +02:00
lcl: TScreen.UpdateLastActive: clear FLastActiveControl on destroy
This commit is contained in:
parent
5472c6d536
commit
bcb890ce27
@ -1210,6 +1210,8 @@ type
|
||||
function GetIconFont: TFont; virtual;
|
||||
function GetMenuFont: TFont; virtual;
|
||||
function GetSystemFont: TFont; virtual;
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation);
|
||||
override;
|
||||
property MagnetManager: TWindowMagnetManager read FMagnetManager;
|
||||
public
|
||||
constructor Create(AOwner : TComponent); override;
|
||||
|
@ -113,7 +113,7 @@ end;
|
||||
{------------------------------------------------------------------------------
|
||||
function TScreen.CustomFormIndex(AForm: TCustomForm): integer;
|
||||
------------------------------------------------------------------------------}
|
||||
function TScreen.CustomFormIndex(AForm: TCustomForm): integer;
|
||||
function TScreen.CustomFormIndex(AForm: TCustomForm): Integer;
|
||||
begin
|
||||
Result := FCustomForms.Count - 1;
|
||||
while (Result >= 0) and (CustomForms[Result] <> AForm) do
|
||||
@ -123,7 +123,7 @@ end;
|
||||
{------------------------------------------------------------------------------
|
||||
function TScreen.FormIndex(AForm: TForm): integer;
|
||||
------------------------------------------------------------------------------}
|
||||
function TScreen.FormIndex(AForm: TForm): integer;
|
||||
function TScreen.FormIndex(AForm: TForm): Integer;
|
||||
begin
|
||||
Result := FFormList.Count - 1;
|
||||
while (Result >= 0) and (Forms[Result] <> AForm) do
|
||||
@ -133,7 +133,7 @@ end;
|
||||
{------------------------------------------------------------------------------
|
||||
function TScreen.CustomFormZIndex(AForm: TCustomForm): integer;
|
||||
------------------------------------------------------------------------------}
|
||||
function TScreen.CustomFormZIndex(AForm: TCustomForm): integer;
|
||||
function TScreen.CustomFormZIndex(AForm: TCustomForm): Integer;
|
||||
begin
|
||||
Result:=FCustomFormsZOrdered.Count-1;
|
||||
while (Result >= 0) and (CustomFormsZOrdered[Result] <> AForm) do dec(Result);
|
||||
@ -890,6 +890,18 @@ begin
|
||||
Result := FSystemFont;
|
||||
end;
|
||||
|
||||
procedure TScreen.Notification(AComponent: TComponent; Operation: TOperation);
|
||||
begin
|
||||
inherited Notification(AComponent, Operation);
|
||||
if Operation=opRemove then
|
||||
begin
|
||||
if FLastActiveControl=AComponent then
|
||||
FLastActiveControl:=nil;
|
||||
if FLastActiveCustomForm=AComponent then
|
||||
FLastActiveCustomForm:=nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TScreen.GetHintFont: TFont;
|
||||
begin
|
||||
if (FHintFont = nil) then
|
||||
@ -1075,6 +1087,8 @@ begin
|
||||
if FLastActiveControl <> FActiveControl then
|
||||
begin
|
||||
FLastActiveControl := FActiveControl;
|
||||
if FLastActiveControl<>nil then
|
||||
FreeNotification(FLastActiveControl);
|
||||
NotifyOnActiveControlChanged;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user