anchordocking: more debugging for focus

git-svn-id: trunk@26325 -
This commit is contained in:
mattias 2010-06-29 15:23:07 +00:00
parent ed6697dfdf
commit ae014f642c
2 changed files with 14 additions and 8 deletions

View File

@ -35,7 +35,7 @@ interface
uses uses
Math, Classes, SysUtils, LCLProc, Forms, Controls, FileUtil, Dialogs, Math, Classes, SysUtils, LCLProc, Forms, Controls, FileUtil, Dialogs,
LazConfigStorage, XMLCfg, XMLPropStorage, StdCtrls, LazConfigStorage, XMLCfg, XMLPropStorage, StdCtrls, LCLIntf,
BaseIDEIntf, ProjectIntf, MacroIntf, IDEDialogs, MenuIntf, LazIDEIntf, BaseIDEIntf, ProjectIntf, MacroIntf, IDEDialogs, MenuIntf, LazIDEIntf,
IDEWindowIntf, IDEOptionsIntf, IDEWindowIntf, IDEOptionsIntf,
AnchorDockStr, AnchorDocking, AnchorDockOptionsDlg; AnchorDockStr, AnchorDocking, AnchorDockOptionsDlg;
@ -417,16 +417,20 @@ begin
AForm.EnableAlign; AForm.EnableAlign;
if BringToFront then begin if BringToFront then begin
if (OldActiveControl=nil)
or (not OldActiveControl.HandleAllocated)
or (FindControl(GetFocus)<>OldActiveControl) then begin
Parent:=GetParentForm(AForm); Parent:=GetParentForm(AForm);
if Parent<>nil then
Parent.ShowOnTop; Parent.ShowOnTop;
if OldActiveControl<>nil then if OldActiveControl<>nil then
AForm.ActiveControl:=OldActiveControl; Parent.ActiveControl:=OldActiveControl;
debugln(['TIDEAnchorDockMaster.ShowForm AAA1 AForm.Active=',AForm.Active]);
AForm.SetFocus; AForm.SetFocus;
debugln(['TIDEAnchorDockMaster.ShowForm AForm.ActiveControl=',dbgsname(AForm.ActiveControl)]); debugln(['TIDEAnchorDockMaster.ShowForm AForm.ActiveControl=',dbgsname(AForm.ActiveControl),' ',DbgSName(Parent.ActiveControl),' ',DbgSName(FindControl(GetFocus))]);
end; end;
end; end;
//debugln(['TIDEAnchorDockMaster.ShowForm END ',DbgSName(AForm),' ',dbgs(AForm.BoundsRect)]); end;
debugln(['TIDEAnchorDockMaster.ShowForm END ',DbgSName(AForm),' ',dbgs(AForm.BoundsRect),' ',DbgSName(FindControl(GetFocus))]);
end; end;
procedure TIDEAnchorDockMaster.CloseAll; procedure TIDEAnchorDockMaster.CloseAll;

View File

@ -1499,6 +1499,8 @@ begin
//debugln(GetStackTrace(true)); //debugln(GetStackTrace(true));
{$ENDIF} {$ENDIF}
Manager.DeactivateCompletionForm; Manager.DeactivateCompletionForm;
if Manager.ActiveEditor<>nil then
Manager.ActiveEditor.FocusEditor;
end; end;
procedure TSourceEditCompletion.ccComplete(var Value: string; procedure TSourceEditCompletion.ccComplete(var Value: string;