DBG, SourceEditor: Prevent moving focus for auto continue breakpoints

git-svn-id: trunk@31101 -
This commit is contained in:
martin 2011-06-05 18:34:11 +00:00
parent 7b9af3aeac
commit 97caca8832
2 changed files with 91 additions and 64 deletions

View File

@ -14876,6 +14876,8 @@ begin
exit;
end;
SourceEditorManager.BeginAutoFocusLock;
try
if (ActiveSrcEdit=nil) or (ActiveUnitInfo=nil) then
GetCurrentUnit(ActiveSrcEdit,ActiveUnitInfo);
@ -14941,6 +14943,9 @@ begin
SourceEditorManager.ShowActiveWindowOnTop(True);
UpdateSourceNames;
Result:=mrOk;
finally
SourceEditorManager.EndAutoFocusLock;
end;
end;
{-------------------------------------------------------------------------------

View File

@ -822,6 +822,7 @@ type
FSourceWindowByFocusList: TFPList;
FUpdateLock: Integer;
FActiveEditorLock: Integer;
FAutoFocusLock: Integer;
FUpdateFlags: set of (ufMgrActiveEditorChanged, ufShowWindowOnTop, ufShowWindowOnTopFocus);
procedure FreeSourceWindows;
function GetActiveSourceWindowIndex: integer;
@ -843,6 +844,9 @@ type
function GetUniqueSourceEditors(Index: integer): TSourceEditorInterface; override;
function GetMarklingProducers(Index: integer): TSourceMarklingProducer; override;
public
procedure BeginAutoFocusLock;
procedure EndAutoFocusLock;
function HasAutoFocusLock: Boolean;
// Windows
function SourceWindowWithEditor(const AEditor: TSourceEditorInterface): TSourceEditorWindowInterface;
override;
@ -6965,7 +6969,9 @@ Begin
TempEditor.EditorComponent.CaretXY := CaretXY;
TempEditor.EditorComponent.TopLine := TopLine;
end;
if (fAutoFocusLock=0) and (Screen.ActiveCustomForm=GetParentForm(Self)) then
if (fAutoFocusLock=0) and (Screen.ActiveCustomForm=GetParentForm(Self)) and
not(Manager.HasAutoFocusLock)
then
begin
{$IFDEF VerboseFocus}
debugln('TSourceNotebook.NotebookPageChanged BEFORE SetFocus ',
@ -7826,6 +7832,21 @@ begin
Result:=TSourceMarklingProducer(fProducers[Index]);
end;
procedure TSourceEditorManagerBase.BeginAutoFocusLock;
begin
inc(FAutoFocusLock);
end;
procedure TSourceEditorManagerBase.EndAutoFocusLock;
begin
dec(FAutoFocusLock);
end;
function TSourceEditorManagerBase.HasAutoFocusLock: Boolean;
begin
Result := FAutoFocusLock > 0;
end;
function TSourceEditorManagerBase.GetActiveCompletionPlugin: TSourceEditorCompletionPlugin;
begin
Result := FActiveCompletionPlugin;
@ -7955,6 +7976,7 @@ var
h: TSrcEditMangerHandlerType;
begin
FUpdateFlags := [];
FAutoFocusLock := 0;
for i := low(TsemChangeReason) to high(TsemChangeReason) do
FChangeNotifyLists[i] := TMethodList.Create;
for h:=low(FHandlers) to high(FHandlers) do