lcl: call Application.OnDeactivate when widgetset interface asking LCL about this

git-svn-id: trunk@23884 -
This commit is contained in:
paul 2010-03-09 08:13:30 +00:00
parent 82e7ef7f8f
commit b2d37865b0
2 changed files with 10 additions and 11 deletions

View File

@ -1227,7 +1227,7 @@ type
const Handler: TMethod);
procedure RunLoop;
procedure Activate;
procedure Deactivate(Data: PtrInt = 0);
procedure Deactivate(Force: Boolean = False);
protected
function GetConsoleApplication: boolean; override;
procedure NotifyIdleHandler(var Done: Boolean);

View File

@ -1338,21 +1338,20 @@ end;
procedure TApplication.Activate;
begin
if AppActive in FFlags then exit;
Include(FFlags,AppActive);
Include(FFlags, AppActive);
NotifyActivateHandler;
end;
procedure TApplication.Deactivate(Data: PtrInt);
procedure TApplication.Deactivate(Force: Boolean = False);
begin
if (AppDestroying in FFlags) then exit;
if (AppDestroying in FFlags) or (not (AppActive in FFlags)) then Exit;
if (not (AppActive in FFlags)) then exit;
if (FindControl(GetFocus)<>nil) then begin
// another control of this application has got the focus
exit;
// widgetset has passed deactivate or no control of this application has got the focus
if Force or not Assigned(FindControl(GetFocus)) then
begin
Exclude(FFlags, AppActive);
NotifyDeactivateHandler;
end;
Exclude(FFlags,AppActive);
NotifyDeactivateHandler;
end;
{------------------------------------------------------------------------------}
@ -1839,7 +1838,7 @@ end;
procedure TApplication.IntfAppDeactivate;
begin
Deactivate;
Deactivate(True);
end;
{------------------------------------------------------------------------------