added debugln for focus

git-svn-id: trunk@35139 -
This commit is contained in:
martin 2012-02-04 23:31:55 +00:00
parent b8c8be3925
commit c7eda00eb0
2 changed files with 53 additions and 3 deletions

View File

@ -565,6 +565,10 @@ end;
procedure TSynBaseCompletionForm.Deactivate;
begin
{$IFDEF VerboseFocus}
DebugLnEnter(['>> TSynBaseCompletionForm.Deactivate ']);
try
{$ENDIF}
// completion box lost focus
// this can happen when a hint window is clicked => ToDo
Visible := False;
@ -574,6 +578,11 @@ begin
if (FCurrentEditor<>nil) and (TCustomSynEdit(fCurrentEditor).HandleAllocated)
then
SetCaretRespondToFocus(TCustomSynEdit(FCurrentEditor).Handle,true);
{$IFDEF VerboseFocus}
finally
DebugLnExit(['<< TSynBaseCompletionForm.Deactivate ']);
end
{$ENDIF}
end;
destructor TSynBaseCompletionForm.Destroy;
@ -651,6 +660,10 @@ var
i: integer;
Handled: Boolean;
begin
{$IFDEF VerboseKeys}
DebugLnEnter(['TSynBaseCompletionForm.KeyDown ',Key,' Shift=',ssShift in Shift,' Ctrl=',ssCtrl in Shift,' Alt=',ssAlt in Shift]);
try
{$ENDIF}
//debugln('TSynBaseCompletionForm.KeyDown A Key=',dbgs(Key));
inherited KeyDown(Key,Shift);
if Key=VK_UNKNOWN then exit;
@ -707,6 +720,11 @@ begin
end;
if Handled then Key:=VK_UNKNOWN;
Invalidate;
{$IFDEF VerboseKeys}
finally
DebugLnExit(['TSynBaseCompletionForm.KeyDown ',Key,' Shift=',ssShift in Shift,' Ctrl=',ssCtrl in Shift,' Alt=',ssAlt in Shift]);
end;
{$ENDIF}
end;
procedure TSynBaseCompletionForm.KeyPress(var Key: char);
@ -844,6 +862,9 @@ end;
procedure TSynBaseCompletionForm.AppDeactivated(Sender: TObject);
begin
{$IFDEF VerboseFocus}
DebugLn(['>> TSynBaseCompletionForm.AppDeactivated ']);
{$ENDIF}
Deactivate;
end;
@ -902,7 +923,9 @@ end;
procedure TSynBaseCompletionForm.UTF8KeyPress(var UTF8Key: TUTF8Char);
begin
//debugln('TSynBaseCompletionForm.UTF8KeyPress A UTF8Key="',DbgStr(UTF8Key),'" ',dbgsName(TObject(TMethod(OnUTF8KeyPress).Data)));
{$IFDEF VerboseKeys}
debugln('TSynBaseCompletionForm.UTF8KeyPress A UTF8Key="',DbgStr(UTF8Key),'" ',dbgsName(TObject(TMethod(OnUTF8KeyPress).Data)));
{$ENDIF}
if UTF8Key=#8 then
begin
// backspace
@ -932,7 +955,9 @@ begin
UTF8Key := '';
end;
end;
{$IFDEF VerboseKeys}
debugln('TSynBaseCompletionForm.UTF8KeyPress END UTF8Key="',DbgStr(UTF8Key),'"');
{$ENDIF}
end;
procedure TSynBaseCompletionForm.SetCurrentString(const Value: string);

View File

@ -1607,10 +1607,17 @@ procedure TSourceEditCompletion.ccCancel(Sender: TObject);
// user cancels completion form
begin
{$IFDEF VerboseIDECompletionBox}
debugln(['TSourceNotebook.ccCancel START']);
DebugLnEnter(['TSourceNotebook.ccCancel START']);
try
//debugln(GetStackTrace(true));
{$ENDIF}
Manager.DeactivateCompletionForm;
{$IFDEF VerboseIDECompletionBox}
finally
DebugLnExit(['TSourceNotebook.ccCancel END']);
end;
//debugln(GetStackTrace(true));
{$ENDIF}
end;
procedure TSourceEditCompletion.ccComplete(var Value: string;
@ -1654,7 +1661,8 @@ var
OldCompletionType: TCompletionType;
Begin
{$IFDEF VerboseIDECompletionBox}
debugln(['TSourceNotebook.ccComplete START']);
DebugLnEnter(['TSourceNotebook.ccComplete START']);
try
{$ENDIF}
OldCompletionType:=CurrentCompletionType;
case CurrentCompletionType of
@ -1731,6 +1739,11 @@ Begin
SourceCompletionCaretXY:=Editor.CaretXY;
SourceCompletionTimer.AutoEnabled:=true;
end;
{$IFDEF VerboseIDECompletionBox}
finally
DebugLnExit(['TSourceNotebook.ccComplete END']);
end;
{$ENDIF}
end;
function TSourceEditCompletion.OnSynCompletionPaintItem(const AKey: string;
@ -8039,6 +8052,10 @@ procedure TSourceEditorManagerBase.DeactivateCompletionForm;
var
PluginFocused: Boolean;
begin
{$IFDEF VerboseIDECompletionBox}
DebugLnEnter(['>> TSourceEditorManagerBase.DeactivateCompletionForm']);
try
{$ENDIF}
if ActiveCompletionPlugin<>nil then begin
ActiveCompletionPlugin.Cancel;
FActiveCompletionPlugin:=nil;
@ -8051,6 +8068,9 @@ begin
// Do not move focus, if it was moved by user
PluginFocused := FDefaultCompletionForm.TheForm.Focused;
{$IFDEF VerboseIDECompletionBox}
DebugLn(['DeactivateCompletionForm PluginFocused=', dbgs(PluginFocused), ' ActiveEditor=', DbgSName(ActiveEditor)]);
{$ENDIF}
// clear the IdentifierList (otherwise it would try to update everytime
// the codetools are used)
@ -8075,6 +8095,11 @@ begin
*)
if PluginFocused and (ActiveEditor<>nil) then
TSourceEditor(ActiveEditor).FocusEditor;
{$IFDEF VerboseIDECompletionBox}
finally
DebugLnExit(['<< TSourceEditorManagerBase.DeactivateCompletionForm']);
end;
{$ENDIF}
end;
procedure TSourceEditorManagerBase.RegisterCompletionPlugin(