DBG: Store/Restore column size (debug dialogs). issue #0018035

git-svn-id: trunk@33270 -
This commit is contained in:
martin 2011-11-03 17:53:46 +00:00
parent 6ec44d6b2c
commit ed780f4ced
20 changed files with 676 additions and 98 deletions

1
.gitattributes vendored
View File

@ -2827,6 +2827,7 @@ debugger/debugeventsform.lfm svneol=native#text/plain
debugger/debugeventsform.pp svneol=native#text/pascal
debugger/debugger.pp svneol=native#text/pascal
debugger/debuggerdlg.pp svneol=native#text/pascal
debugger/debuggerstrconst.pp svneol=native#text/pascal
debugger/debugoutputform.lfm svneol=native#text/plain
debugger/debugoutputform.pp svneol=native#text/pascal
debugger/debugutils.pp svneol=native#text/pascal

View File

@ -6,6 +6,7 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
IDEWindowIntf, IDEOptionDefs,
ComCtrls, StdCtrls, Grids, ExtCtrls, LclType, LCLIntf, DebuggerDlg, Debugger,
BaseDebugManager, EditorOptions, Maps, Math, types, LCLProc, Menus, Clipbrd, ActnList,
IDECommands, IDEImagesIntf, CodeToolManager, CodeCache, SourceEditor;
@ -162,6 +163,9 @@ implementation
uses
LazarusIDEStrConsts;
var
AsmWindowCreator: TIDEWindowCreator;
{ TAssemblerDlg }
procedure TAssemblerDlg.ClearLineMap(AState: TAsmDlgLineMapState = lmsUnknown);
@ -1191,5 +1195,10 @@ begin
end;
end;
initialization
AsmWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwAssembler]);
AsmWindowCreator.OnCreateFormProc := @CreateDebugDialog;
end.

View File

@ -2,7 +2,7 @@ inherited BreakpointsDlg: TBreakpointsDlg
Left = 344
Height = 205
Top = 153
Width = 773
Width = 560
HelpType = htKeyword
HorzScrollBar.Page = 559
VertScrollBar.Page = 204
@ -10,14 +10,14 @@ inherited BreakpointsDlg: TBreakpointsDlg
BorderStyle = bsSizeToolWin
Caption = 'Breakpoint list'
ClientHeight = 205
ClientWidth = 773
ClientWidth = 560
OnCreate = BreakpointsDlgCREATE
Visible = True
object lvBreakPoints: TListView[0]
Left = 0
Height = 179
Top = 26
Width = 773
Width = 560
HelpType = htKeyword
Align = alClient
Columns = <
@ -65,7 +65,7 @@ inherited BreakpointsDlg: TBreakpointsDlg
Left = 0
Height = 26
Top = 0
Width = 773
Width = 560
Caption = 'ToolBar1'
ParentShowHint = False
ShowHint = True

View File

@ -39,6 +39,7 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
IDEWindowIntf, IDEOptionDefs, DebuggerStrConst,
Buttons, Menus, ComCtrls, IDEProcs, Debugger, DebuggerDlg, lclType, ActnList, MainBase,
IDEImagesIntf, SourceEditor, MainIntf;
@ -152,6 +153,8 @@ type
procedure DoBeginUpdate; override;
procedure DoEndUpdate; override;
procedure DisableAllActions;
function ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
procedure ColSizeSetter(AColId: Integer; ASize: Integer);
public
constructor Create(AOwner: TComponent); override;
public
@ -166,10 +169,34 @@ function GetBreakPointActionsDescription(ABreakpoint: TBaseBreakpoint): string;
implementation
{$R *.lfm}
uses
LazarusIDEStrConsts, BaseDebugManager;
var
BreakPointDlgWindowCreator: TIDEWindowCreator;
const
COL_BREAK_STATE = 1;
COL_BREAK_FILE = 2;
COL_BREAK_LINE = 3;
COL_BREAK_CONDITION = 4;
COL_BREAK_ACTION = 5;
COL_BREAK_PASS = 6;
COL_BREAK_GROUP = 7;
function BreakPointDlgColSizeGetter(AForm: TCustomForm; AColId: Integer; var ASize: Integer): Boolean;
begin
Result := AForm is TBreakPointsDlg;
if Result then
Result := TBreakPointsDlg(AForm).ColSizeGetter(AColId, ASize);
end;
procedure BreakPointDlgColSizeSetter(AForm: TCustomForm; AColId: Integer; ASize: Integer);
begin
if AForm is TBreakPointsDlg then
TBreakPointsDlg(AForm).ColSizeSetter(AColId, ASize);
end;
function GetBreakPointStateDescription(ABreakpoint: TBaseBreakpoint): string;
const
// enabled valid
@ -787,6 +814,35 @@ begin
actAddWatchPoint.Enabled := True;
end;
function TBreakPointsDlg.ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
begin
Result := True;
case AColId of
COL_BREAK_STATE: ASize := lvBreakPoints.Column[0].Width;
COL_BREAK_FILE: ASize := lvBreakPoints.Column[1].Width;
COL_BREAK_LINE: ASize := lvBreakPoints.Column[2].Width;
COL_BREAK_CONDITION: ASize := lvBreakPoints.Column[3].Width;
COL_BREAK_ACTION: ASize := lvBreakPoints.Column[4].Width;
COL_BREAK_PASS: ASize := lvBreakPoints.Column[5].Width;
COL_BREAK_GROUP: ASize := lvBreakPoints.Column[6].Width;
else
Result := False;
end;
end;
procedure TBreakPointsDlg.ColSizeSetter(AColId: Integer; ASize: Integer);
begin
case AColId of
COL_BREAK_STATE: lvBreakPoints.Column[0].Width := ASize;
COL_BREAK_FILE: lvBreakPoints.Column[1].Width := ASize;
COL_BREAK_LINE: lvBreakPoints.Column[2].Width := ASize;
COL_BREAK_CONDITION: lvBreakPoints.Column[3].Width := ASize;
COL_BREAK_ACTION: lvBreakPoints.Column[4].Width := ASize;
COL_BREAK_PASS: lvBreakPoints.Column[5].Width := ASize;
COL_BREAK_GROUP: lvBreakPoints.Column[6].Width := ASize;
end;
end;
procedure TBreakPointsDlg.UpdateItem(const AnItem: TListItem;
const ABreakpoint: TIDEBreakPoint);
var
@ -965,5 +1021,19 @@ begin
DisableAllActions;
end;
initialization
BreakPointDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwBreakPoints]);
BreakPointDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
BreakPointDlgWindowCreator.OnSetDividerSize := @BreakPointDlgColSizeSetter;
BreakPointDlgWindowCreator.OnGetDividerSize := @BreakPointDlgColSizeGetter;
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakState', COL_BREAK_STATE, drsColWidthState);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakFile', COL_BREAK_FILE, drsBreakPointColWidthFile);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakLine', COL_BREAK_LINE, drsBreakPointColWidthLine);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakCondition', COL_BREAK_CONDITION, drsBreakPointColWidthCondition);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakAction', COL_BREAK_ACTION, drsBreakPointColWidthAction);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakPassCnt', COL_BREAK_PASS, drsBreakPointColWidthPassCount);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakGroup', COL_BREAK_GROUP, drsBreakPointColWidthGroup);
end.

View File

@ -37,6 +37,7 @@ interface
uses
SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
IDEWindowIntf, IDEOptionDefs, DebuggerStrConst,
ComCtrls, Debugger, DebuggerDlg, Menus, ClipBrd, ExtCtrls, StdCtrls, Spin,
ActnList, MainIntf, MainBase, IDEImagesIntf, IDECommands;
@ -130,6 +131,8 @@ type
procedure BreakPointChanged(const ASender: TIDEBreakPoints; const ABreakpoint: TIDEBreakPoint);
procedure CallStackChanged(Sender: TObject);
procedure CallStackCurrent(Sender: TObject);
function ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
procedure ColSizeSetter(AColId: Integer; ASize: Integer);
public
constructor Create(AOwner: TComponent); override;
property BreakPoints;
@ -151,6 +154,28 @@ var
imgSourceLine: Integer;
imgNoSourceLine: Integer;
CallStackDlgWindowCreator: TIDEWindowCreator;
const
COL_STACK_BRKPOINT = 1;
COL_STACK_INDEX = 2;
COL_STACK_SOURCE = 3;
COL_STACK_LINE = 4;
COL_STACK_FUNC = 5;
function CallStackDlgColSizeGetter(AForm: TCustomForm; AColId: Integer; var ASize: Integer): Boolean;
begin
Result := AForm is TCallStackDlg;
if Result then
Result := TCallStackDlg(AForm).ColSizeGetter(AColId, ASize);
end;
procedure CallStackDlgColSizeSetter(AForm: TCustomForm; AColId: Integer; ASize: Integer);
begin
if AForm is TCallStackDlg then
TCallStackDlg(AForm).ColSizeSetter(AColId, ASize);
end;
{ TCallStackDlg }
constructor TCallStackDlg.Create(AOwner: TComponent);
@ -189,6 +214,31 @@ begin
UpdateView;
end;
function TCallStackDlg.ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
begin
Result := True;
case AColId of
COL_STACK_BRKPOINT: ASize := lvCallStack.Column[0].Width;
COL_STACK_INDEX: ASize := lvCallStack.Column[1].Width;
COL_STACK_SOURCE: ASize := lvCallStack.Column[2].Width;
COL_STACK_LINE: ASize := lvCallStack.Column[3].Width;
COL_STACK_FUNC: ASize := lvCallStack.Column[4].Width;
else
Result := False;
end;
end;
procedure TCallStackDlg.ColSizeSetter(AColId: Integer; ASize: Integer);
begin
case AColId of
COL_STACK_BRKPOINT: lvCallStack.Column[0].Width := ASize;
COL_STACK_INDEX: lvCallStack.Column[1].Width := ASize;
COL_STACK_SOURCE: lvCallStack.Column[2].Width := ASize;
COL_STACK_LINE: lvCallStack.Column[3].Width := ASize;
COL_STACK_FUNC: lvCallStack.Column[4].Width := ASize;
end;
end;
function TCallStackDlg.GetImageIndex(Entry: TCallStackEntry): Integer;
function GetBreakPoint(Entry: TCallStackEntry): TIDEBreakPoint; inline;
@ -757,5 +807,17 @@ begin
end;
initialization
CallStackDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwCallStack]);
CallStackDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
CallStackDlgWindowCreator.OnSetDividerSize := @CallStackDlgColSizeSetter;
CallStackDlgWindowCreator.OnGetDividerSize := @CallStackDlgColSizeGetter;
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackBrkPoint', COL_STACK_BRKPOINT, drsColWidthBrkPointImg);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackIndex', COL_STACK_INDEX, drsColWidthIndex);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackSource', COL_STACK_SOURCE, drsColWidthSource);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackLine', COL_STACK_LINE, drsColWidthLine);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackFunc', COL_STACK_FUNC, drsColWidthFunc);
end.

View File

@ -34,6 +34,7 @@ interface
uses
Classes, SysUtils, Forms, Controls, Graphics, ExtCtrls, ComCtrls, ActnList,
IDEWindowIntf, IDEOptionDefs,
StdActns, ClipBrd, Menus, Dialogs, FileUtil, Debugger, DebuggerDlg,
LazarusIDEStrConsts, EnvironmentOpts, InputHistory, IDEOptionsIntf,
IDEImagesIntf, LazIDEIntf, debugger_eventlog_options;
@ -82,6 +83,9 @@ implementation
{$R *.lfm}
var
EventsDlgWindowCreator: TIDEWindowCreator;
type
TCustomTreeViewAccess = class(TCustomTreeView);
@ -307,5 +311,10 @@ begin
end;
end;
initialization
EventsDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwDbgEvents]);
EventsDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
end.

View File

@ -109,12 +109,21 @@ type
var
OnProcessCommand: procedure(Sender: TObject; Command: word; var Handled: boolean) of object;
procedure CreateDebugDialog(Sender: TObject; aFormName: string;
var AForm: TCustomForm; DoDisableAutoSizing: boolean);
implementation
var
BrkImgIdxInitialized: Boolean;
ImgBreakPoints: Array [0..8] of Integer;
procedure CreateDebugDialog(Sender: TObject; aFormName: string; var AForm: TCustomForm;
DoDisableAutoSizing: boolean);
begin
DebugBoss.CreateDebugDialog(Sender, aFormName, AForm, DoDisableAutoSizing);
end;
{ TDebuggerDlg }
procedure TDebuggerDlg.BeginUpdate;

View File

@ -0,0 +1,74 @@
{
/***************************************************************************
DebuggerStrConst.pp
-----------------------
This unit contains resource strings for the generic parts of the debugger
***************************************************************************/
***************************************************************************
* *
* This source is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************
}
{
Note: All resource strings should be prefixed with 'drs' (Debugger Resource String)
}
unit DebuggerStrConst;
{$mode objfpc}{$H+}
interface
resourcestring
drsColWidthName = 'Name column';
drsColWidthExpression = 'Expression column';
drsColWidthValue = 'Value column';
drsColWidthState = 'State column';
drsColWidthIndex = 'Index column';
drsColWidthSource = 'Source column';
drsColWidthLine = 'Line column';
drsColWidthFunc = 'Function name column';
drsColWidthBrkPointImg = 'Break indication column';
drsBreakPointColWidthFile = 'File/address column';
drsBreakPointColWidthLine = 'Line column';
drsBreakPointColWidthCondition = 'Condition column';
drsBreakPointColWidthAction = 'Action column';
drsBreakPointColWidthPassCount = 'Pass-count column';
drsBreakPointColWidthGroup = 'Group column';
drsHistoryColWidthCurrent = 'Current column';
drsHistoryColWidthTime = 'Time column';
drsHistoryColWidthLocation = 'Location column';
drsInspectColWidthDataName = 'Data name column';
drsInspectColWidthDataType = 'Data type column';
drsInspectColWidthDataValue = 'Data value column';
drsInspectColWidthMethName = 'Method name column';
drsInspectColWidthMethType = 'Method type column';
drsInspectColWidthMethReturns = 'Method returns column';
drsInspectColWidthMethAddress = 'Method address column';
implementation
end.

View File

@ -44,6 +44,7 @@ interface
uses
Classes, Graphics, Controls, Forms, Dialogs, Clipbrd,
IDEWindowIntf, IDEOptionDefs,
Buttons, StdCtrls, Menus, ExtCtrls, DebuggerDlg
{$IFDEF DBG_WITH_DEBUGGER_DEBUG}
, BaseDebugManager, GDBMIDebugger, CmdLineDebugger
@ -87,6 +88,9 @@ implementation
uses
LazarusIDEStrConsts;
var
DbgOutputDlgWindowCreator: TIDEWindowCreator;
procedure TDbgOutputForm.AddText(const AText: String);
begin
txtOutput.Lines.Add(AText);
@ -174,4 +178,9 @@ begin
Clipboard.AsText := txtOutput.Text;
end;
initialization
DbgOutputDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwDbgOutput]);
DbgOutputDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
end.

View File

@ -38,7 +38,8 @@ interface
uses
Classes, SysUtils, LCLType, Forms, Controls, Graphics, Dialogs,
ComCtrls, StdCtrls, DebuggerDlg, BaseDebugManager, IDEWindowIntf,
IDEWindowIntf, IDEOptionDefs,
ComCtrls, StdCtrls, DebuggerDlg, BaseDebugManager,
InputHistory, Debugger;
type
@ -87,6 +88,9 @@ implementation
uses
IDEImagesIntf, LazarusIDEStrConsts;
var
EvaluateDlgWindowCreator: TIDEWindowCreator;
{ TEvaluateDlg }
constructor TEvaluateDlg.Create(TheOwner:TComponent);
@ -248,6 +252,11 @@ begin
DebugBoss.ViewDebugDialog(ddtWatches);
end;
initialization
EvaluateDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwEvaluate]);
EvaluateDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
end.

View File

@ -5,7 +5,8 @@ unit HistoryDlg;
interface
uses
Classes, SysUtils, ComCtrls, Debugger, DebuggerDlg, LazarusIDEStrConsts,
Classes, SysUtils, ComCtrls, Debugger, DebuggerDlg, LazarusIDEStrConsts, Forms,
IDEWindowIntf, IDEOptionDefs, DebuggerStrConst,
BaseDebugManager, MainBase, IDEImagesIntf, Clipbrd, Dialogs;
type
@ -46,6 +47,9 @@ type
FEnabledImgIdx, FDisabledIdx: Integer;
procedure SnapshotChanged(Sender: TObject);
procedure UpdateToolbar;
protected
function ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
procedure ColSizeSetter(AColId: Integer; ASize: Integer);
public
{ public declarations }
constructor Create(TheOwner: TComponent); override;
@ -56,6 +60,27 @@ implementation
{$R *.lfm}
var
HistoryDlgWindowCreator: TIDEWindowCreator;
const
COL_HISTORY_CUR = 1;
COL_HISTORY_TIME = 2;
COL_HISTORY_LOC = 3;
function HistoryDlgColSizeGetter(AForm: TCustomForm; AColId: Integer; var ASize: Integer): Boolean;
begin
Result := AForm is THistoryDialog;
if Result then
Result := THistoryDialog(AForm).ColSizeGetter(AColId, ASize);
end;
procedure HistoryDlgColSizeSetter(AForm: TCustomForm; AColId: Integer; ASize: Integer);
begin
if AForm is THistoryDialog then
THistoryDialog(AForm).ColSizeSetter(AColId, ASize);
end;
{ THistoryDialog }
procedure THistoryDialog.lvHistoryDblClick(Sender: TObject);
@ -263,6 +288,27 @@ begin
tbRemove.Enabled := lvHistory.Selected <> nil;
end;
function THistoryDialog.ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
begin
Result := True;
case AColId of
COL_HISTORY_CUR: ASize := lvHistory.Column[0].Width;
COL_HISTORY_TIME: ASize := lvHistory.Column[1].Width;
COL_HISTORY_LOC: ASize := lvHistory.Column[2].Width;
else
Result := False;
end;
end;
procedure THistoryDialog.ColSizeSetter(AColId: Integer; ASize: Integer);
begin
case AColId of
COL_HISTORY_CUR: lvHistory.Column[0].Width := ASize;
COL_HISTORY_TIME: lvHistory.Column[1].Width := ASize;
COL_HISTORY_LOC: lvHistory.Column[2].Width := ASize;
end;
end;
constructor THistoryDialog.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
@ -313,5 +359,15 @@ begin
tbHistorySelectedClick(nil);
end;
initialization
HistoryDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiHistory]);
HistoryDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
HistoryDlgWindowCreator.OnSetDividerSize := @HistoryDlgColSizeSetter;
HistoryDlgWindowCreator.OnGetDividerSize := @HistoryDlgColSizeGetter;
HistoryDlgWindowCreator.DividerTemplate.Add('HistoryColCur', COL_HISTORY_CUR, drsHistoryColWidthCurrent);
HistoryDlgWindowCreator.DividerTemplate.Add('HistoryColTime', COL_HISTORY_TIME, drsHistoryColWidthTime);
HistoryDlgWindowCreator.DividerTemplate.Add('HistoryColLocation', COL_HISTORY_LOC, drsHistoryColWidthLocation);
end.

View File

@ -29,8 +29,9 @@ interface
uses
Classes, SysUtils, TypInfo, FileUtil, Forms, Controls, Graphics,
IDEWindowIntf, IDEOptionDefs, DebuggerStrConst,
Dialogs, ComCtrls, ObjectInspector, PropEdits, Debugger, DebuggerDlg, BaseDebugManager,
LazarusIDEStrConsts, IDEWindowIntf, LCLProc, LCLType, Grids, StdCtrls;
LazarusIDEStrConsts, LCLProc, LCLType, Grids, StdCtrls;
type
@ -55,12 +56,12 @@ type
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
FDataGridHook,
FPropertiesGridHook,
FMethodsGridHook: TPropertyEditorHook;
FDataGrid,
FPropertiesGrid,
FMethodsGrid: TOIDBGGrid;
//FDataGridHook,
//FPropertiesGridHook,
//FMethodsGridHook: TPropertyEditorHook;
//FDataGrid,
//FPropertiesGrid,
//FMethodsGrid: TOIDBGGrid;
FExpression: ansistring;
FHumanReadable: ansistring;
FDBGInfo: TDBGType;
@ -74,12 +75,14 @@ type
procedure InspectEnum;
procedure InspectSet;
procedure InspectPointer;
procedure GridDataSetup;
procedure GridMethodsSetup;
procedure GridDataSetup(Initial: Boolean = False);
procedure GridMethodsSetup(Initial: Boolean = False);
procedure ShowDataFields;
procedure ShowMethodsFields;
procedure Clear;
protected
function ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
procedure ColSizeSetter(AColId: Integer; ASize: Integer);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -91,6 +94,31 @@ implementation
{$R *.lfm}
var
InspectDlgWindowCreator: TIDEWindowCreator;
const
COL_INSPECT_DNAME = 1;
COL_INSPECT_DTYPE = 2;
COL_INSPECT_DVALUE = 3;
COL_INSPECT_MNAME = 11;
COL_INSPECT_MTYPE = 12;
COL_INSPECT_MRETURNS = 13;
COL_INSPECT_MADDRESS = 14;
function InspectDlgColSizeGetter(AForm: TCustomForm; AColId: Integer; var ASize: Integer): Boolean;
begin
Result := AForm is TIDEInspectDlg;
if Result then
Result := TIDEInspectDlg(AForm).ColSizeGetter(AColId, ASize);
end;
procedure InspectDlgColSizeSetter(AForm: TCustomForm; AColId: Integer; ASize: Integer);
begin
if AForm is TIDEInspectDlg then
TIDEInspectDlg(AForm).ColSizeSetter(AColId, ASize);
end;
{ TIDEInspectDlg }
procedure TIDEInspectDlg.FormClose(Sender: TObject; var CloseAction: TCloseAction);
@ -124,12 +152,12 @@ begin
EditInspected.Text:=FExpression+' : Class '+FDBGInfo.TypeName+' inherits from '+FDBGInfo.Ancestor;
GridDataSetup;
ShowDataFields;
FGridData.AutoSizeColumn(1);
FGridData.AutoSizeColumn(2);
//FGridData.AutoSizeColumn(1);
//FGridData.AutoSizeColumn(2);
GridMethodsSetup;
ShowMethodsFields;
FGridMethods.AutoSizeColumn(1);
FGridMethods.AutoSizeColumn(3);
//FGridMethods.AutoSizeColumn(1);
//FGridMethods.AutoSizeColumn(3);
end;
procedure TIDEInspectDlg.InspectVariant;
@ -143,7 +171,7 @@ begin
FGridData.Cells[0,1]:=FExpression;
FGridData.Cells[1,1]:='Variant';
FGridData.Cells[2,1]:=FDBGInfo.Value.AsString;
FGridData.AutoSizeColumn(1);
//FGridData.AutoSizeColumn(1);
end;
procedure TIDEInspectDlg.InspectRecord;
@ -157,7 +185,7 @@ begin
EditInspected.Text:=FExpression+' : '+FDBGInfo.TypeName;
GridDataSetup;
ShowDataFields;
FGridData.AutoSizeColumn(2);
//FGridData.AutoSizeColumn(2);
end;
procedure TIDEInspectDlg.InspectSimple;
@ -171,7 +199,7 @@ begin
FGridData.Cells[0,1]:=FExpression;
FGridData.Cells[1,1]:=FDBGInfo.TypeName;
FGridData.Cells[2,1]:=FDBGInfo.Value.AsString;
FGridData.AutoSizeColumn(2);
//FGridData.AutoSizeColumn(2);
end;
procedure TIDEInspectDlg.InspectEnum;
@ -188,7 +216,7 @@ begin
then FGridData.Cells[1,1] := FGridData.Cells[1,1] + ' = ';
FGridData.Cells[1,1] := FGridData.Cells[1,1] + FDBGInfo.TypeDeclaration;
FGridData.Cells[2,1]:=FDBGInfo.Value.AsString;
FGridData.AutoSizeColumn(2);
//FGridData.AutoSizeColumn(2);
end;
procedure TIDEInspectDlg.InspectSet;
@ -205,7 +233,7 @@ begin
then FGridData.Cells[1,1] := FGridData.Cells[1,1] + ' = ';
FGridData.Cells[1,1] := FGridData.Cells[1,1] + FDBGInfo.TypeDeclaration;
FGridData.Cells[2,1]:=FDBGInfo.Value.AsString;
FGridData.AutoSizeColumn(2);
//FGridData.AutoSizeColumn(2);
end;
procedure TIDEInspectDlg.InspectPointer;
@ -221,56 +249,65 @@ begin
then FGridData.Cells[1,1]:='Pointer to '+copy(FDBGInfo.TypeName, 2, length(FDBGInfo.TypeName))
else FGridData.Cells[1,1]:=FDBGInfo.TypeName;
FGridData.Cells[2,1]:=format('$%x',[PtrUInt(FDBGInfo.Value.AsPointer)]);
FGridData.AutoSizeColumn(2);
//FGridData.AutoSizeColumn(2);
end;
procedure TIDEInspectDlg.GridDataSetup;
procedure TIDEInspectDlg.GridDataSetup(Initial: Boolean = False);
begin
with FGridData do begin
Clear;
BorderStyle:=bsNone;
BorderWidth:=0;
DefaultColWidth:=100;
Options:=[goColSizing,goDblClickAutoSize,goDrawFocusSelected,
goVertLine,goHorzLine,goFixedHorzLine,goSmoothScroll,
goTabs,goScrollKeepVisible,goRowSelect];
Align:=alClient;
TitleFont.Style:=[fsBold];
ExtendedSelect:=false;
RowCount:=2;
FixedRows:=1;
FixedCols:=0;
ColCount:=3;
Cols[0].Text:='Name';
Cols[1].Text:='Type';
Cols[2].Text:='Value';
Color:=clBtnFace;
end;
if Initial then
with FGridData do begin
Clear;
BorderStyle:=bsNone;
BorderWidth:=0;
DefaultColWidth:=100;
Options:=[goColSizing,goDblClickAutoSize,goDrawFocusSelected,
goVertLine,goHorzLine,goFixedHorzLine,goSmoothScroll,
goTabs,goScrollKeepVisible,goRowSelect];
Align:=alClient;
TitleFont.Style:=[fsBold];
ExtendedSelect:=false;
RowCount:=2;
FixedRows:=1;
FixedCols:=0;
ColCount:=3;
Cols[0].Text:='Name';
Cols[1].Text:='Type';
Cols[2].Text:='Value';
Color:=clBtnFace;
end;
FGridData.RowCount:=1;
FGridData.RowCount:=2;
FGridData.FixedRows:=1;
FGridData.Visible := True;
end;
procedure TIDEInspectDlg.GridMethodsSetup;
procedure TIDEInspectDlg.GridMethodsSetup(Initial: Boolean = False);
begin
with FGridMethods do begin
Clear;
BorderStyle:=bsNone;
BorderWidth:=0;
DefaultColWidth:=100;
Options:=[goColSizing,goDblClickAutoSize,goDrawFocusSelected,
goVertLine,goHorzLine,goFixedHorzLine,goSmoothScroll,
goTabs,goScrollKeepVisible,goRowSelect];
Align:=alClient;
TitleFont.Style:=[fsBold];
ExtendedSelect:=false;
RowCount:=2;
FixedRows:=1;
FixedCols:=0;
ColCount:=4;
Cols[0].Text:='Name';
Cols[1].Text:='Type';
Cols[2].Text:='Returns';
Cols[3].Text:='Address';
Color:=clBtnFace;
end;
if Initial then
with FGridMethods do begin
Clear;
BorderStyle:=bsNone;
BorderWidth:=0;
DefaultColWidth:=100;
Options:=[goColSizing,goDblClickAutoSize,goDrawFocusSelected,
goVertLine,goHorzLine,goFixedHorzLine,goSmoothScroll,
goTabs,goScrollKeepVisible,goRowSelect];
Align:=alClient;
TitleFont.Style:=[fsBold];
ExtendedSelect:=false;
RowCount:=2;
FixedRows:=1;
FixedCols:=0;
ColCount:=4;
Cols[0].Text:='Name';
Cols[1].Text:='Type';
Cols[2].Text:='Returns';
Cols[3].Text:='Address';
Color:=clBtnFace;
end;
FGridMethods.RowCount:=1;
FGridMethods.RowCount:=2;
FGridMethods.FixedRows:=1;
end;
procedure TIDEInspectDlg.ShowDataFields;
@ -390,11 +427,41 @@ begin
DataPage.TabVisible:=false;
PropertiesPage.TabVisible:=false;
MethodsPage.TabVisible:=false;
FGridData.Clear;
GridDataSetup;
FGridData.Visible := False;
FreeAndNil(FDBGInfo);
EditInspected.Text:='';
end;
function TIDEInspectDlg.ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
begin
Result := True;
case AColId of
COL_INSPECT_DNAME: ASize := FGridData.ColWidths[0];
COL_INSPECT_DTYPE: ASize := FGridData.ColWidths[1];
COL_INSPECT_DVALUE: ASize := FGridData.ColWidths[2];
COL_INSPECT_MNAME: ASize := FGridMethods.ColWidths[0];
COL_INSPECT_MTYPE: ASize := FGridMethods.ColWidths[1];
COL_INSPECT_MRETURNS: ASize := FGridMethods.ColWidths[2];
COL_INSPECT_MADDRESS: ASize := FGridMethods.ColWidths[3];
else
Result := False;
end;
end;
procedure TIDEInspectDlg.ColSizeSetter(AColId: Integer; ASize: Integer);
begin
case AColId of
COL_INSPECT_DNAME: FGridData.ColWidths[0]:= ASize;
COL_INSPECT_DTYPE: FGridData.ColWidths[1]:= ASize;
COL_INSPECT_DVALUE: FGridData.ColWidths[2]:= ASize;
COL_INSPECT_MNAME: FGridMethods.ColWidths[0]:= ASize;
COL_INSPECT_MTYPE: FGridMethods.ColWidths[1]:= ASize;
COL_INSPECT_MRETURNS: FGridMethods.ColWidths[2]:= ASize;
COL_INSPECT_MADDRESS: FGridMethods.ColWidths[3]:= ASize;
end;
end;
constructor TIDEInspectDlg.Create(AOwner: TComponent);
function NewGrid(AName: String; AParent: TWinControl; AHook: TPropertyEditorHook): TOIDBGGrid;
@ -411,31 +478,34 @@ constructor TIDEInspectDlg.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FDataGridHook := TPropertyEditorHook.Create;
FDataGrid := NewGrid('DataGrid', DataPage, FDataGridHook);
FPropertiesGridHook := TPropertyEditorHook.Create;
FPropertiesGrid := NewGrid('PropertiesGrid', PropertiesPage, FPropertiesGridHook);
FMethodsGridHook := TPropertyEditorHook.Create;
FMethodsGrid := NewGrid('MethodsGrid', MethodsPage, FMethodsGridHook);
//FDataGridHook := TPropertyEditorHook.Create;
//FDataGrid := NewGrid('DataGrid', DataPage, FDataGridHook);
//
//FPropertiesGridHook := TPropertyEditorHook.Create;
//FPropertiesGrid := NewGrid('PropertiesGrid', PropertiesPage, FPropertiesGridHook);
//
//FMethodsGridHook := TPropertyEditorHook.Create;
//FMethodsGrid := NewGrid('MethodsGrid', MethodsPage, FMethodsGridHook);
Localize;
FGridData:=TStringGrid.Create(DataPage);
DataPage.InsertControl(FGridData);
GridDataSetup;
GridDataSetup(True);
FGridMethods:=TStringGrid.Create(MethodsPage);
MethodsPage.InsertControl(FGridMethods);
GridMethodsSetup;
GridMethodsSetup(True);
Clear;
end;
destructor TIDEInspectDlg.Destroy;
begin
FreeAndNil(FDBGInfo);
FreeAndNil(FDataGridHook);
FreeAndNil(FPropertiesGridHook);
FreeAndNil(FMethodsGridHook);
//FreeAndNil(FDataGridHook);
//FreeAndNil(FPropertiesGridHook);
//FreeAndNil(FMethodsGridHook);
inherited Destroy;
end;
@ -480,5 +550,20 @@ begin
end;
initialization
InspectDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwInspect]);
InspectDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
InspectDlgWindowCreator.OnSetDividerSize := @InspectDlgColSizeSetter;
InspectDlgWindowCreator.OnGetDividerSize := @InspectDlgColSizeGetter;
InspectDlgWindowCreator.DividerTemplate.Add('InspectDataName', COL_INSPECT_DNAME, drsInspectColWidthDataName);
InspectDlgWindowCreator.DividerTemplate.Add('InspectDataType', COL_INSPECT_DTYPE, drsInspectColWidthDataType);
InspectDlgWindowCreator.DividerTemplate.Add('InspectDataValue', COL_INSPECT_DVALUE, drsInspectColWidthDataValue);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethName', COL_INSPECT_MNAME, drsInspectColWidthMethName);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethType', COL_INSPECT_MTYPE, drsInspectColWidthMethType);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethReturns', COL_INSPECT_MRETURNS, drsInspectColWidthMethReturns);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethAddress', COL_INSPECT_MADDRESS, drsInspectColWidthMethAddress);
end.

View File

@ -37,6 +37,7 @@ interface
uses
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ClipBrd, LCLProc,
IDEWindowIntf, IDEOptionDefs, DebuggerStrConst,
ComCtrls, ActnList, Menus, BaseDebugManager, Debugger, DebuggerDlg;
type
@ -74,6 +75,8 @@ type
protected
procedure DoBeginUpdate; override;
procedure DoEndUpdate; override;
function ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
procedure ColSizeSetter(AColId: Integer; ASize: Integer);
public
constructor Create(AOwner: TComponent); override;
property LocalsMonitor;
@ -89,7 +92,27 @@ implementation
uses
LazarusIDEStrConsts;
var
LocalsDlgWindowCreator: TIDEWindowCreator;
const
COL_LOCALS_NAME = 1;
COL_LOCALS_VALUE = 2;
function LocalsDlgColSizeGetter(AForm: TCustomForm; AColId: Integer; var ASize: Integer): Boolean;
begin
Result := AForm is TLocalsDlg;
if Result then
Result := TLocalsDlg(AForm).ColSizeGetter(AColId, ASize);
end;
procedure LocalsDlgColSizeSetter(AForm: TCustomForm; AColId: Integer; ASize: Integer);
begin
if AForm is TLocalsDlg then
TLocalsDlg(AForm).ColSizeSetter(AColId, ASize);
end;
{ TLocalsDlg }
constructor TLocalsDlg.Create(AOwner: TComponent);
@ -310,5 +333,33 @@ begin
lvLocals.EndUpdate;
end;
function TLocalsDlg.ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
begin
Result := True;
case AColId of
COL_LOCALS_NAME: ASize := lvLocals.Column[0].Width;
COL_LOCALS_VALUE: ASize := lvLocals.Column[1].Width;
else
Result := False;
end;
end;
procedure TLocalsDlg.ColSizeSetter(AColId: Integer; ASize: Integer);
begin
case AColId of
COL_LOCALS_NAME: lvLocals.Column[0].Width := ASize;
COL_LOCALS_VALUE: lvLocals.Column[1].Width := ASize;
end;
end;
initialization
LocalsDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwLocals]);
LocalsDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
LocalsDlgWindowCreator.OnSetDividerSize := @LocalsDlgColSizeSetter;
LocalsDlgWindowCreator.OnGetDividerSize := @LocalsDlgColSizeGetter;
LocalsDlgWindowCreator.DividerTemplate.Add('LocalsName', COL_LOCALS_NAME, drsColWidthName);
LocalsDlgWindowCreator.DividerTemplate.Add('LocalsValue', COL_LOCALS_VALUE, drsColWidthValue);
end.

View File

@ -6,6 +6,7 @@ interface
uses
Classes, SysUtils, FileUtil,
IDEWindowIntf, IDEOptionDefs,
Forms, Controls, Graphics, Dialogs, StdCtrls, DebuggerDlg, BaseDebugManager;
type
@ -31,6 +32,9 @@ var
implementation
var
PseudeoTerminalDlgWindowCreator: TIDEWindowCreator;
{ TPseudoConsoleDlg }
procedure TPseudoConsoleDlg.Edit1KeyPress(Sender: TObject; var Key: char);
@ -61,6 +65,10 @@ end;
{$R *.lfm}
initialization
PseudeoTerminalDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwPseudoTerminal]);
PseudeoTerminalDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
end.

View File

@ -37,6 +37,7 @@ interface
uses
SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
IDEWindowIntf, IDEOptionDefs, DebuggerStrConst,
ComCtrls, ActnList, Menus, Debugger, DebuggerDlg,
LazarusIDEStrConsts, IDEImagesIntf;
@ -74,6 +75,8 @@ type
protected
procedure DoBeginUpdate; override;
procedure DoEndUpdate; override;
function ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
procedure ColSizeSetter(AColId: Integer; ASize: Integer);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -86,6 +89,26 @@ implementation
{$R *.lfm}
var
RegisterDlgWindowCreator: TIDEWindowCreator;
const
COL_REGISTER_NAME = 1;
COL_REGISTER_VALUE = 2;
function RegisterDlgColSizeGetter(AForm: TCustomForm; AColId: Integer; var ASize: Integer): Boolean;
begin
Result := AForm is TRegistersDlg;
if Result then
Result := TRegistersDlg(AForm).ColSizeGetter(AColId, ASize);
end;
procedure RegisterDlgColSizeSetter(AForm: TCustomForm; AColId: Integer; ASize: Integer);
begin
if AForm is TRegistersDlg then
TRegistersDlg(AForm).ColSizeSetter(AColId, ASize);
end;
{ TRegistersDlg }
constructor TRegistersDlg.Create(AOwner: TComponent);
@ -317,5 +340,33 @@ begin
lvRegisters.EndUpdate;
end;
function TRegistersDlg.ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
begin
Result := True;
case AColId of
COL_REGISTER_NAME: ASize := lvRegisters.Column[0].Width;
COL_REGISTER_VALUE: ASize := lvRegisters.Column[1].Width;
else
Result := False;
end;
end;
procedure TRegistersDlg.ColSizeSetter(AColId: Integer; ASize: Integer);
begin
case AColId of
COL_REGISTER_NAME: lvRegisters.Column[0].Width := ASize;
COL_REGISTER_VALUE: lvRegisters.Column[1].Width := ASize;
end;
end;
initialization
RegisterDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwRegisters]);
RegisterDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
RegisterDlgWindowCreator.OnSetDividerSize := @RegisterDlgColSizeSetter;
RegisterDlgWindowCreator.OnGetDividerSize := @RegisterDlgColSizeGetter;
RegisterDlgWindowCreator.DividerTemplate.Add('RegisterName', COL_REGISTER_NAME, drsColWidthName);
RegisterDlgWindowCreator.DividerTemplate.Add('RegisterValue', COL_REGISTER_VALUE, drsColWidthValue);
end.

View File

@ -5,7 +5,8 @@ unit ThreadDlg;
interface
uses
Classes, SysUtils, ComCtrls, LCLProc, Debugger, DebuggerDlg, LazarusIDEStrConsts,
Classes, SysUtils, ComCtrls, LCLProc, Debugger, DebuggerDlg, Forms, LazarusIDEStrConsts,
IDEWindowIntf, IDEOptionDefs, DebuggerStrConst,
BaseDebugManager, MainIntf, MainBase, IDEImagesIntf;
type
@ -28,6 +29,8 @@ type
protected
procedure DoEndUpdate; override;
procedure ThreadsChanged(Sender: TObject);
function ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
procedure ColSizeSetter(AColId: Integer; ASize: Integer);
public
{ public declarations }
constructor Create(TheOwner: TComponent); override;
@ -39,6 +42,31 @@ implementation
{$R *.lfm}
var
ThreadDlgWindowCreator: TIDEWindowCreator;
const
COL_THREAD_BRKPOINT = 1;
COL_THREAD_INDEX = 2;
COL_THREAD_NAME = 3;
COL_THREAD_STATE = 4;
COL_THREAD_SOURCE = 5;
COL_THREAD_LINE = 6;
COL_THREAD_FUNC = 7;
function ThreadsDlgColSizeGetter(AForm: TCustomForm; AColId: Integer; var ASize: Integer): Boolean;
begin
Result := AForm is TThreadsDlg;
if Result then
Result := TThreadsDlg(AForm).ColSizeGetter(AColId, ASize);
end;
procedure ThreadsDlgColSizeSetter(AForm: TCustomForm; AColId: Integer; ASize: Integer);
begin
if AForm is TThreadsDlg then
TThreadsDlg(AForm).ColSizeSetter(AColId, ASize);
end;
{ TThreadsDlg }
procedure TThreadsDlg.ThreadsChanged(Sender: TObject);
@ -122,6 +150,35 @@ begin
end;
end;
function TThreadsDlg.ColSizeGetter(AColId: Integer; var ASize: Integer): Boolean;
begin
Result := True;
case AColId of
COL_THREAD_BRKPOINT: ASize := lvThreads.Column[0].Width;
COL_THREAD_INDEX: ASize := lvThreads.Column[1].Width;
COL_THREAD_NAME: ASize := lvThreads.Column[2].Width;
COL_THREAD_STATE: ASize := lvThreads.Column[3].Width;
COL_THREAD_SOURCE: ASize := lvThreads.Column[4].Width;
COL_THREAD_LINE: ASize := lvThreads.Column[5].Width;
COL_THREAD_FUNC: ASize := lvThreads.Column[6].Width;
else
Result := False;
end;
end;
procedure TThreadsDlg.ColSizeSetter(AColId: Integer; ASize: Integer);
begin
case AColId of
COL_THREAD_BRKPOINT: lvThreads.Column[0].Width := ASize;
COL_THREAD_INDEX: lvThreads.Column[1].Width := ASize;
COL_THREAD_NAME: lvThreads.Column[2].Width := ASize;
COL_THREAD_STATE: lvThreads.Column[3].Width := ASize;
COL_THREAD_SOURCE: lvThreads.Column[4].Width := ASize;
COL_THREAD_LINE: lvThreads.Column[5].Width := ASize;
COL_THREAD_FUNC: lvThreads.Column[6].Width := ASize;
end;
end;
procedure TThreadsDlg.tbCurrentClick(Sender: TObject);
var
Item: TListItem;
@ -199,5 +256,19 @@ begin
lvThreads.SmallImages := IDEImages.Images_16;
end;
initialization
ThreadDlgWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwThreads]);
ThreadDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
ThreadDlgWindowCreator.OnSetDividerSize := @ThreadsDlgColSizeSetter;
ThreadDlgWindowCreator.OnGetDividerSize := @ThreadsDlgColSizeGetter;
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadBrkPoint', COL_THREAD_BRKPOINT, drsColWidthBrkPointImg);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadIndex', COL_THREAD_INDEX, drsColWidthIndex);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadName', COL_THREAD_NAME, drsColWidthName);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadState', COL_THREAD_STATE, drsColWidthState);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadSource', COL_THREAD_SOURCE, drsColWidthSource);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadLine', COL_THREAD_LINE, drsColWidthLine);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadFunc', COL_THREAD_FUNC, drsColWidthFunc);
end.

View File

@ -41,7 +41,8 @@ uses
Classes, SysUtils, LCLProc, Forms, Controls, Graphics, Dialogs, math,
IDEWindowIntf, IDEOptionDefs,
StdCtrls, Buttons, Menus, ComCtrls, LCLType, ActnList, IDEImagesIntf,
EnvironmentOpts, LazarusIDEStrConsts, Debugger, DebuggerDlg, BaseDebugManager;
EnvironmentOpts, LazarusIDEStrConsts, DebuggerStrConst,
Debugger, DebuggerDlg, BaseDebugManager;
type
@ -764,10 +765,11 @@ end;
initialization
WatchWindowCreator := IDEWindowCreators.Add(NonModalIDEWindowNames[nmiwWatches]);
WatchWindowCreator.OnCreateFormProc := @CreateDebugDialog;
WatchWindowCreator.OnSetDividerSize := @WatchesDlgColSizeSetter;
WatchWindowCreator.OnGetDividerSize := @WatchesDlgColSizeGetter;
WatchWindowCreator.DividerTemplate.Add('ColumnWatchExpr', COL_WATCH_EXPR, dbgLCWatchExpression);
WatchWindowCreator.DividerTemplate.Add('ColumnWatchValue', COL_WATCH_VALUE, dbgLCWatchValue);
WatchWindowCreator.DividerTemplate.Add('ColumnWatchExpr', COL_WATCH_EXPR, drsColWidthExpression);
WatchWindowCreator.DividerTemplate.Add('ColumnWatchValue', COL_WATCH_VALUE, drsColWidthValue);
end.

View File

@ -171,6 +171,9 @@ type
function ShowBreakPointProperties(const ABreakpoint: TIDEBreakPoint): TModalresult; virtual; abstract;
function ShowWatchProperties(const AWatch: TCurrentWatch; AWatchExpression: String = ''): TModalresult; virtual; abstract;
// Dialog routines
procedure CreateDebugDialog(Sender: TObject; aFormName: string;
var AForm: TCustomForm; DoDisableAutoSizing: boolean); virtual;
procedure ViewDebugDialog(const ADialogType: TDebugDialogType;
BringToFront: Boolean = True; Show: Boolean = true;
DoDisableAutoSizing: boolean = false); virtual; abstract;
@ -234,6 +237,12 @@ begin
else Result := TDebuggerClass(MDebuggerClasses.Objects[idx]);
end;
procedure TBaseDebugManager.CreateDebugDialog(Sender: TObject; aFormName: string;
var AForm: TCustomForm; DoDisableAutoSizing: boolean);
begin
//
end;
function TBaseDebugManager.GetDebuggerClass(const AIndex: Integer): TDebuggerClass;
begin
Result := TDebuggerClass(MDebuggerClasses.Objects[AIndex]);

View File

@ -130,8 +130,6 @@ type
var ASrcEdit: TSourceEditor);
// Dialog routines
procedure CreateDebugDialog(Sender: TObject; aFormName: string;
var AForm: TCustomForm; DoDisableAutoSizing: boolean);
procedure DestroyDebugDialog(const ADialogType: TDebugDialogType);
procedure InitDebugOutputDlg;
procedure InitDebugEventsDlg;
@ -227,6 +225,9 @@ type
function ShowBreakPointProperties(const ABreakpoint: TIDEBreakPoint): TModalresult; override;
function ShowWatchProperties(const AWatch: TCurrentWatch; AWatchExpression: String = ''): TModalresult; override;
// Dialog routines
procedure CreateDebugDialog(Sender: TObject; aFormName: string;
var AForm: TCustomForm; DoDisableAutoSizing: boolean); override;
procedure ViewDebugDialog(const ADialogType: TDebugDialogType; BringToFront: Boolean = true; Show: Boolean = true; DoDisableAutoSizing: boolean = false); override;
procedure ViewDisassembler(AnAddr: TDBGPtr;
BringToFront: Boolean = True; Show: Boolean = true;
@ -1680,11 +1681,6 @@ begin
// TODO: add capacibilities to DebuggerClass
// and disable unsuported items
end;
for DlgType:=Low(TDebugDialogType) to High(TDebugDialogType) do
if not (DlgType in [ddtWatches]) then
IDEWindowCreators.Add(NonModalIDEWindowNames[DebugDlgIDEWindow[DlgType]],
nil,@CreateDebugDialog,'','','','');
end;
procedure TDebugManager.ConnectSourceNotebookEvents;

View File

@ -5365,9 +5365,6 @@ resourcestring
lisDiscardChangesAndQuit = 'Discard changes and quit';
dbgBreakPropertyGroupNotFound = 'Some groups in the Enable/Disable list do not exist.%0:s'
+'Create them?%0:s%0:s%1:s';
dbgLCWatchExpression = 'Watch Expression';
dbgLCWatchValue = 'Watch Value';
implementation