LCL: TApplication.DispatchAction formatting by lagprogramming. Issue #26885

git-svn-id: trunk@46602 -
This commit is contained in:
juha 2014-10-19 09:15:32 +00:00
parent 885a085db5
commit 00fc7489c9

View File

@ -1444,13 +1444,9 @@ function TApplication.DispatchAction(Msg: Longint; Action: TBasicAction): Boolea
var
Form: TCustomForm;
begin
Result := False;
Form := Screen.ActiveForm;
if (Form <> nil) and (Form.Perform(Msg, 0, PtrInt(Action)) = 1) then
Result := True
else
if (MainForm <> Form) and (MainForm <> nil) and (MainForm.Perform(Msg, 0, PtrInt(Action)) = 1) then
Result := True;
Result := ((Form <> nil) and (Form.Perform(Msg, 0, PtrInt(Action)) = 1)) or
((MainForm <> Form) and (MainForm <> nil) and (MainForm.Perform(Msg, 0, PtrInt(Action)) = 1));
// Disable action if no "user" handler is available
if (not Result) and (Action is TCustomAction) and
TCustomAction(Action).Enabled and TCustomAction(Action).DisableIfNoHandler then