Debugger: Fix attach dialog. Issue #0034028 Patch by Cyrax

git-svn-id: trunk@58638 -
This commit is contained in:
martin 2018-07-26 11:53:23 +00:00
parent 6700ae635e
commit 98304b2635
2 changed files with 21 additions and 23 deletions

View File

@ -11,13 +11,13 @@ object DebugAttachDialogForm: TDebugAttachDialogForm
Constraints.MinWidth = 400
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '1.3'
LCLVersion = '1.9.0.0'
object labelRunningProcesses: TLabel
AnchorSideTop.Control = Owner
Left = 8
Height = 13
Height = 17
Top = 6
Width = 90
Width = 123
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Running Processes'
@ -31,8 +31,8 @@ object DebugAttachDialogForm: TDebugAttachDialogForm
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = btnRefresh
Left = 6
Height = 475
Top = 25
Height = 467
Top = 29
Width = 388
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
@ -43,27 +43,27 @@ object DebugAttachDialogForm: TDebugAttachDialogForm
end
item
Caption = 'PID'
Width = 150
Width = 165
end>
OwnerData = True
ReadOnly = True
RowSelect = True
TabOrder = 0
ViewStyle = vsReport
OnChange = lvProcessesChange
OnColumnClick = lvProcessesColumnClick
OnData = lvProcessesData
OnDblClick = lvProcessesDblClick
OnKeyDown = lvProcessesKeyDown
OnSelectItem = lvProcessesSelectItem
end
object btnRefresh: TButton
AnchorSideLeft.Control = Owner
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 23
Top = 506
Width = 64
Height = 27
Top = 502
Width = 61
Anchors = [akLeft, akBottom]
AutoSize = True
BorderSpacing.Left = 6
@ -77,10 +77,10 @@ object DebugAttachDialogForm: TDebugAttachDialogForm
AnchorSideLeft.Side = asrBottom
AnchorSideBottom.Control = btnRefresh
AnchorSideBottom.Side = asrBottom
Left = 76
Height = 23
Top = 506
Width = 58
Left = 73
Height = 27
Top = 502
Width = 52
Anchors = [akLeft, akBottom]
AutoSize = True
BorderSpacing.Left = 6
@ -94,10 +94,10 @@ object DebugAttachDialogForm: TDebugAttachDialogForm
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = btnRefresh
AnchorSideBottom.Side = asrBottom
Left = 336
Height = 23
Top = 506
Width = 58
Left = 340
Height = 27
Top = 502
Width = 54
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 6

View File

@ -30,13 +30,12 @@ type
lvProcesses: TListView;
procedure btnRefreshClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure lvProcessesChange(Sender: TObject; Item: TListItem;
{%H-}Change: TItemChange);
procedure lvProcessesColumnClick(Sender: TObject; Column: TListColumn);
procedure lvProcessesData(Sender: TObject; Item: TListItem);
procedure lvProcessesDblClick(Sender: TObject);
procedure lvProcessesKeyDown(Sender: TObject; var Key: Word;
{%H-}Shift: TShiftState);
procedure lvProcessesSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
private
FPidString: string;
FList: TRunningProcessInfoList;
@ -282,12 +281,11 @@ begin
end;
end;
procedure TDebugAttachDialogForm.lvProcessesChange(Sender: TObject;
Item: TListItem; Change: TItemChange);
procedure TDebugAttachDialogForm.lvProcessesSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
var
info: TRunningProcessInfo;
begin
if Item.Index <> -1 then
if (Item.Index <> -1) And Selected then
begin
info := TRunningProcessInfo(FList.Items[Item.Index]);
FPidString := IntToStr(info.PID);