LCL: improved TCustomForm.DoExecuteAction, do not execute actions in design mode or if form is not visible

git-svn-id: trunk@14866 -
This commit is contained in:
vincents 2008-04-17 13:14:54 +00:00
parent 3b3a8da73c
commit 0c78a3c622

View File

@ -1054,6 +1054,10 @@ function TCustomForm.DoExecuteAction(ExeAction: TBasicAction): boolean;
end;
begin
// don't execute action while designing or when form is not visible
if (csDesigning in ComponentState) or not Visible then
exit(false);
// assume it gets handled somewhere
Result := true;
if assigned(ActiveControl) and ActiveControl.ExecuteAction(ExeAction)