IDE: Focus active source editor before executing menu command, did not work with anchordocking. Issue # 22114, modified from patch by Takeda Matsuki

git-svn-id: trunk@37422 -
This commit is contained in:
juha 2012-05-26 07:25:27 +00:00
parent 5fd2bc261d
commit 48d4107e26

View File

@ -1297,14 +1297,16 @@ var
ActEdit: TSourceEditor;
r: Boolean;
begin
if (SourceEditorManager = nil) or (Sender = nil) or not(Sender is TIDEMenuCommand) then
exit;
if SourceEditorManager = nil then exit;
if not (Sender is TIDEMenuCommand) then exit;
if TIDEMenuCommand(Sender).Command = nil then exit;
ActEdit := SourceEditorManager.ActiveEditor;
if (ActEdit = nil) or (TIDEMenuCommand(Sender).Command = nil) then
exit;
r := TIDEMenuCommand(Sender).Command.OnExecuteProc = @ExecuteIdeMenuClick;
if ActEdit = nil then exit;
r := TIDEMenuCommand(Sender).Command.OnExecuteProc = @ExecuteIdeMenuClick;
if r then
TIDEMenuCommand(Sender).Command.OnExecuteProc := nil;
// Commands may not work without focusing when anchordocking is installed
ActEdit.FocusEditor;
ActEdit.DoEditorExecuteCommand(TIDEMenuCommand(Sender).Command.Command);
if r then
TIDEMenuCommand(Sender).Command.OnExecuteProc := @ExecuteIdeMenuClick;