LeakView: Minor improvements to the dialog. Issue #28425, patch from Alexey Torgashin.

git-svn-id: trunk@49585 -
This commit is contained in:
juha 2015-08-01 10:00:54 +00:00
parent e8bd482fe1
commit b7c800ae6d
2 changed files with 75 additions and 72 deletions

View File

@ -1,22 +1,25 @@
object HeapTrcViewForm: THeapTrcViewForm
Left = 440
Left = 677
Height = 516
Top = 302
Top = 155
Width = 689
BorderIcons = [biSystemMenu, biMaximize]
Caption = 'HeapTrcViewForm'
ClientHeight = 516
ClientWidth = 689
FormStyle = fsStayOnTop
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '1.1'
Position = poScreenCenter
LCLVersion = '1.5'
object lblTrcFile: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = edtTrcFileName
AnchorSideTop.Side = asrCenter
Left = 6
Height = 14
Top = 9
Width = 35
Height = 17
Top = 14
Width = 47
BorderSpacing.Left = 6
Caption = '.trc file'
ParentColor = False
@ -25,58 +28,61 @@ object HeapTrcViewForm: THeapTrcViewForm
AnchorSideLeft.Control = Owner
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Height = 29
Top = 40
Width = 61
Width = 62
AutoSize = True
BorderSpacing.Left = 6
BorderSpacing.Top = 12
Caption = 'Update'
OnClick = btnUpdateClick
TabOrder = 0
TabOrder = 2
end
object chkStayOnTop: TCheckBox
AnchorSideTop.Control = btnUpdate
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 609
Height = 17
Top = 43
Width = 74
Left = 581
Height = 24
Top = 42
Width = 102
Anchors = [akTop, akRight]
BorderSpacing.Right = 6
Caption = 'Stay on top'
OnChange = chkStayOnTopChange
TabOrder = 1
TabOrder = 6
end
object btnBrowse: TButton
AnchorSideTop.Side = asrCenter
Left = 645
Height = 20
Top = 9
Width = 38
Anchors = [akTop, akRight]
AnchorSideTop.Control = edtTrcFileName
AnchorSideBottom.Control = edtTrcFileName
AnchorSideBottom.Side = asrBottom
Left = 616
Height = 29
Top = 8
Width = 67
Anchors = [akTop, akRight, akBottom]
BorderSpacing.Left = 6
BorderSpacing.Right = 6
Caption = '...'
OnClick = btnBrowseClick
TabOrder = 2
TabOrder = 1
end
object chkUseRaw: TCheckBox
AnchorSideLeft.Control = BtnResolve
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnUpdate
AnchorSideTop.Side = asrCenter
Left = 266
Height = 17
Top = 43
Width = 86
Left = 293
Height = 24
Top = 42
Width = 119
BorderSpacing.Left = 6
Caption = 'Raw leak data'
Checked = True
OnChange = chkUseRawChange
State = cbChecked
TabOrder = 3
TabOrder = 5
end
object ctrlPanel: TPanel
AnchorSideLeft.Control = Owner
@ -87,24 +93,23 @@ object HeapTrcViewForm: THeapTrcViewForm
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 441
Top = 69
Height = 435
Top = 75
Width = 677
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
BevelOuter = bvNone
ClientHeight = 441
ClientHeight = 435
ClientWidth = 677
TabOrder = 4
TabOrder = 7
object trvTraceInfo: TTreeView
AnchorSideTop.Side = asrBottom
Left = 0
Height = 349
Height = 343
Top = 6
Width = 677
Align = alClient
BorderSpacing.Top = 6
DefaultItemHeight = 16
ReadOnly = True
TabOrder = 0
OnDblClick = trvTraceInfoDblClick
@ -113,7 +118,7 @@ object HeapTrcViewForm: THeapTrcViewForm
object memoSummary: TMemo
Left = 0
Height = 81
Top = 360
Top = 354
Width = 677
Align = alBottom
ReadOnly = True
@ -124,7 +129,7 @@ object HeapTrcViewForm: THeapTrcViewForm
Cursor = crVSplit
Left = 0
Height = 5
Top = 355
Top = 349
Width = 677
Align = alBottom
ResizeAnchor = akBottom
@ -134,43 +139,47 @@ object HeapTrcViewForm: THeapTrcViewForm
AnchorSideLeft.Control = btnUpdate
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnUpdate
Left = 73
Height = 23
Left = 74
Height = 29
Top = 40
Width = 101
Width = 120
AutoSize = True
BorderSpacing.Left = 6
Caption = 'Paste Clipboard'
OnClick = btnClipboardClick
TabOrder = 5
TabOrder = 3
end
object edtTrcFileName: TComboBox
AnchorSideLeft.Control = lblTrcFile
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = btnBrowse
Left = 47
Height = 21
Left = 59
Height = 29
Top = 8
Width = 592
Width = 551
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Right = 6
ItemHeight = 13
TabOrder = 6
BorderSpacing.Around = 6
ItemHeight = 0
TabOrder = 0
end
object BtnResolve: TButton
AnchorSideLeft.Control = btnClipboard
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnUpdate
AnchorSideTop.Side = asrCenter
Left = 180
Height = 23
Left = 200
Height = 29
Top = 40
Width = 80
Width = 87
AutoSize = True
BorderSpacing.Left = 6
Caption = 'BtnResolve'
OnClick = BtnResolveClick
TabOrder = 7
TabOrder = 4
end
object OpenDialog: TOpenDialog
Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing, ofViewDetail]
left = 579
top = 142
end
end

View File

@ -26,6 +26,7 @@ type
lblTrcFile: TLabel;
ctrlPanel: TPanel;
memoSummary: TMemo;
OpenDialog: TOpenDialog;
splitter: TSplitter;
trvTraceInfo: TTreeView;
procedure btnClipboardClick(Sender: TObject);
@ -86,7 +87,8 @@ resourcestring
schkRaw = 'Raw leak data';
schkTop = 'Stay on top';
sfrmCap = 'Leaks and Traces - HeapTrc and GDB backtrace output viewer';
sfrmSelectFileWithDebugInfo = 'Select File with debug info';
sfrmSelectFileWithDebugInfo = 'Select file with debug info';
sfrmSelectTrcFile = 'Select file with trace log';
var
HeapTrcViewForm: THeapTrcViewForm = nil;
@ -126,36 +128,28 @@ begin
end;
procedure THeapTrcViewForm.BtnResolveClick(Sender: TObject);
var
OpenDialog : TOpenDialog;
begin
if Finfo = nil then exit;
OpenDialog := TOpenDialog.Create(nil);
try
OpenDialog.Title := sfrmSelectFileWithDebugInfo;
if not OpenDialog.Execute then Exit;
OpenDialog.FileName := '';
OpenDialog.Filter := '';
OpenDialog.Title := sfrmSelectFileWithDebugInfo;
if not OpenDialog.Execute then Exit;
Finfo.ResolveLeakInfo(OpenDialog.FileName, fItems);
ChangeTreeText;
finally
OpenDialog.Free;
end;
Finfo.ResolveLeakInfo(OpenDialog.FileName, fItems);
ChangeTreeText;
end;
procedure THeapTrcViewForm.btnBrowseClick(Sender: TObject);
var
OpenDialog : TOpenDialog;
begin
OpenDialog := TOpenDialog.Create(nil);
try
if not OpenDialog.Execute then Exit;
edtTrcFileName.Text := OpenDialog.FileName;
DoUpdateLeaks;
AddFileToList(edtTrcFileName.Text);
finally
OpenDialog.Free;
end;
OpenDialog.FileName := '';
OpenDialog.Filter := slblTrace + '|*.trc';
OpenDialog.Title := sfrmSelectTrcFile;
if not OpenDialog.Execute then Exit;
edtTrcFileName.Text := OpenDialog.FileName;
DoUpdateLeaks;
AddFileToList(edtTrcFileName.Text);
end;
procedure THeapTrcViewForm.chkStayOnTopChange(Sender: TObject);