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

View File

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