IDE: source editor command: fixed check focus in sourcenotebook or mainidebar, issue #27165

git-svn-id: branches/fixes_1_4@48097 -
This commit is contained in:
mattias 2015-03-02 18:13:08 +00:00
parent 0cd40f99e8
commit cf25add3fa

View File

@ -12715,11 +12715,12 @@ begin
begin
CurFocusControl:=FindOwnerControl(GetFocus);
while (CurFocusControl<>nil) and (CurFocusControl<>MainIDEBar)
and not (CurFocusControl is TSourceNotebook) do
and not (CurFocusControl is TCustomForm) do
CurFocusControl:=CurFocusControl.Parent;
end;
if Assigned(CurFocusControl) then
begin // MainIDEBar or SourceNotebook has focus -> find active source editor
if (CurFocusControl is TSourceNotebook) or (CurFocusControl=MainIDEBar) then
begin
// MainIDEBar or SourceNotebook has focus -> find active source editor
GetCurrentUnit(ActiveSourceEditor,ActiveUnitInfo);
if Assigned(ActiveSourceEditor) then begin
ActiveSourceEditor.DoEditorExecuteCommand(EditorCommand); // pass the command