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

View File

@ -1802,6 +1802,7 @@ const
);
var
CurDialog: TDebuggerDlg;
AW: HWND;
begin
if Destroying then exit;
if (ADialogType = ddtPseudoTerminal) and not HasConsoleSupport
@ -1868,7 +1869,10 @@ begin
if Show then
begin
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;
end;
end;

View File

@ -5332,6 +5332,7 @@ resourcestring
lisDebugOptionsFrmAutoCloseAsm = 'Automatically close the assembler window, after source not found';
lisDebugOptionsFrmAutoInstanceClass = 'Automatically set "use instance class type" for new watches';
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 '
+'type of debugger)';
lisDebugOptionsFrmEventLog = 'Event Log';

View File

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