Ide, Debugger: Always bring Watches, Locals to front (not focus) if items are added (optional) Issue #40771

This commit is contained in:
Martin 2024-02-17 13:46:13 +01:00
parent 3aa483c0c0
commit d019706897
4 changed files with 12 additions and 1 deletions

View File

@ -93,6 +93,7 @@ begin
gcbDebuggerGeneralOptions.Checked[3] := DebuggerAutoCloseAsm; gcbDebuggerGeneralOptions.Checked[3] := DebuggerAutoCloseAsm;
gcbDebuggerGeneralOptions.Checked[4] := DebuggerAutoSetInstanceFromClass; gcbDebuggerGeneralOptions.Checked[4] := DebuggerAutoSetInstanceFromClass;
gcbDebuggerGeneralOptions.Checked[5] := DebuggerAllowFunctionCalls; gcbDebuggerGeneralOptions.Checked[5] := DebuggerAllowFunctionCalls;
gcbDebuggerGeneralOptions.Checked[6] := DebuggerOptions.AlwaysBringDbgDialogsToFront;
end; end;
txtAdditionalPath.Text:=EnvironmentOptions.GetParsedDebuggerSearchPath; txtAdditionalPath.Text:=EnvironmentOptions.GetParsedDebuggerSearchPath;
end; end;
@ -117,6 +118,7 @@ begin
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmAutoCloseAsm); // 3 auto close asm gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmAutoCloseAsm); // 3 auto close asm
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmAutoInstanceClass); // 4 auto set class-from-instance gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmAutoInstanceClass); // 4 auto set class-from-instance
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmAllowFunctionCalls); // 5 allow function calls gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmAllowFunctionCalls); // 5 allow function calls
gcbDebuggerGeneralOptions.Items.Add(lisDebugOptionsFrmDialogsToFront); // 6 bring dialogs to front
end; end;
procedure TDebuggerGeneralOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions); procedure TDebuggerGeneralOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
@ -141,6 +143,7 @@ begin
DebuggerAutoCloseAsm := gcbDebuggerGeneralOptions.Checked[3]; DebuggerAutoCloseAsm := gcbDebuggerGeneralOptions.Checked[3];
DebuggerAutoSetInstanceFromClass := gcbDebuggerGeneralOptions.Checked[4]; DebuggerAutoSetInstanceFromClass := gcbDebuggerGeneralOptions.Checked[4];
DebuggerAllowFunctionCalls := gcbDebuggerGeneralOptions.Checked[5]; DebuggerAllowFunctionCalls := gcbDebuggerGeneralOptions.Checked[5];
DebuggerOptions.AlwaysBringDbgDialogsToFront := gcbDebuggerGeneralOptions.Checked[6];
end; end;
end; end;

View File

@ -1802,6 +1802,7 @@ const
); );
var var
CurDialog: TDebuggerDlg; CurDialog: TDebuggerDlg;
AW: HWND;
begin begin
if Destroying then exit; if Destroying then exit;
if (ADialogType = ddtPseudoTerminal) and not HasConsoleSupport if (ADialogType = ddtPseudoTerminal) and not HasConsoleSupport
@ -1868,7 +1869,10 @@ begin
if Show then if Show then
begin begin
CurDialog.BeginUpdate; CurDialog.BeginUpdate;
IDEWindowCreators.ShowForm(CurDialog,BringToFront,vmOnlyMoveOffScreenToVisible); AW := GetActiveWindow;
IDEWindowCreators.ShowForm(CurDialog,BringToFront or DebuggerOptions.AlwaysBringDbgDialogsToFront,vmOnlyMoveOffScreenToVisible);
if (not BringToFront) and DebuggerOptions.AlwaysBringDbgDialogsToFront then
SetActiveWindow(AW);
CurDialog.EndUpdate; CurDialog.EndUpdate;
end; end;
end; end;

View File

@ -5332,6 +5332,7 @@ resourcestring
lisDebugOptionsFrmAutoCloseAsm = 'Automatically close the assembler window, after source not found'; lisDebugOptionsFrmAutoCloseAsm = 'Automatically close the assembler window, after source not found';
lisDebugOptionsFrmAutoInstanceClass = 'Automatically set "use instance class type" for new watches'; lisDebugOptionsFrmAutoInstanceClass = 'Automatically set "use instance class type" for new watches';
lisDebugOptionsFrmAllowFunctionCalls = 'BETA: Allow function calls in watches (if supported by backend)'; lisDebugOptionsFrmAllowFunctionCalls = 'BETA: Allow function calls in watches (if supported by backend)';
lisDebugOptionsFrmDialogsToFront = 'Always bring debug-windows (watches, locals) to front when adding items';
lisDebugOptionsFrmDebuggerSpecific = 'Debugger specific options (depends on ' lisDebugOptionsFrmDebuggerSpecific = 'Debugger specific options (depends on '
+'type of debugger)'; +'type of debugger)';
lisDebugOptionsFrmEventLog = 'Event Log'; lisDebugOptionsFrmEventLog = 'Event Log';

View File

@ -121,6 +121,7 @@ type
*) *)
DebuggerOptsVersionFpDebugUpdate = 1; DebuggerOptsVersionFpDebugUpdate = 1;
private private
FAlwaysBringDbgDialogsToFront: boolean;
FBreakpointsDialogShowTree: TBreakpointsDialogShowTreeType; FBreakpointsDialogShowTree: TBreakpointsDialogShowTreeType;
FFilename: string; FFilename: string;
FFileVersion: integer; FFileVersion: integer;
@ -175,6 +176,7 @@ type
published published
property SetupCheckIgnoreNoDefault: Boolean read FSetupCheckIgnoreNoDefault write FSetupCheckIgnoreNoDefault; property SetupCheckIgnoreNoDefault: Boolean read FSetupCheckIgnoreNoDefault write FSetupCheckIgnoreNoDefault;
property BreakpointsDialogShowTree: TBreakpointsDialogShowTreeType read FBreakpointsDialogShowTree write FBreakpointsDialogShowTree default bstBrkGroup; property BreakpointsDialogShowTree: TBreakpointsDialogShowTreeType read FBreakpointsDialogShowTree write FBreakpointsDialogShowTree default bstBrkGroup;
property AlwaysBringDbgDialogsToFront: boolean read FAlwaysBringDbgDialogsToFront write FAlwaysBringDbgDialogsToFront default true;
end; end;
TCurrentDebuggerSetupResult = ( TCurrentDebuggerSetupResult = (
@ -835,6 +837,7 @@ procedure TDebuggerOptions.Init;
begin begin
// Init for all published values // Init for all published values
FBreakpointsDialogShowTree := bstBrkGroup; FBreakpointsDialogShowTree := bstBrkGroup;
FAlwaysBringDbgDialogsToFront := True;
end; end;
procedure TDebuggerOptions.Load; procedure TDebuggerOptions.Load;