debugger: add CopyAll to locals dialog. Issue #29467, patch by Cyrax

git-svn-id: trunk@51374 -
This commit is contained in:
ondrej 2016-01-22 08:35:11 +00:00
parent 5baa72597f
commit 4b5db67a88
2 changed files with 40 additions and 4 deletions

View File

@ -1,4 +1,4 @@
inherited LocalsDlg: TLocalsDlg object LocalsDlg: TLocalsDlg
Left = 359 Left = 359
Height = 200 Height = 200
Top = 126 Top = 126
@ -10,7 +10,8 @@ inherited LocalsDlg: TLocalsDlg
Caption = 'Locals' Caption = 'Locals'
ClientHeight = 200 ClientHeight = 200
ClientWidth = 500 ClientWidth = 500
object lvLocals: TListView[0] LCLVersion = '1.7'
object lvLocals: TListView
Left = 0 Left = 0
Height = 200 Height = 200
Top = 0 Top = 0
@ -32,7 +33,7 @@ inherited LocalsDlg: TLocalsDlg
TabOrder = 0 TabOrder = 0
ViewStyle = vsReport ViewStyle = vsReport
end end
object ActionList1: TActionList[1] object ActionList1: TActionList
left = 152 left = 152
top = 80 top = 80
object actInspect: TAction object actInspect: TAction
@ -68,8 +69,14 @@ inherited LocalsDlg: TLocalsDlg
OnExecute = actCopyValueExecute OnExecute = actCopyValueExecute
OnUpdate = actInspectUpdate OnUpdate = actInspectUpdate
end end
object actCopyAll: TAction
Category = 'copy'
Caption = 'actCopyAll'
OnExecute = actCopyAllExecute
OnUpdate = actCopyAllUpdate
end
end end
object PopupMenu1: TPopupMenu[2] object PopupMenu1: TPopupMenu
left = 38 left = 38
top = 75 top = 75
object MenuItem1: TMenuItem object MenuItem1: TMenuItem
@ -90,5 +97,8 @@ inherited LocalsDlg: TLocalsDlg
object MenuItem6: TMenuItem object MenuItem6: TMenuItem
Action = actCopyValue Action = actCopyValue
end end
object MenuItem7: TMenuItem
Action = actCopyAll
end
end end
end end

View File

@ -49,6 +49,7 @@ type
actEvaluate: TAction; actEvaluate: TAction;
actCopyName: TAction; actCopyName: TAction;
actCopyValue: TAction; actCopyValue: TAction;
actCopyAll: TAction;
actWath: TAction; actWath: TAction;
ActionList1: TActionList; ActionList1: TActionList;
lvLocals: TListView; lvLocals: TListView;
@ -58,7 +59,10 @@ type
MenuItem4: TMenuItem; MenuItem4: TMenuItem;
MenuItem5: TMenuItem; MenuItem5: TMenuItem;
MenuItem6: TMenuItem; MenuItem6: TMenuItem;
MenuItem7: TMenuItem;
PopupMenu1: TPopupMenu; PopupMenu1: TPopupMenu;
procedure actCopyAllExecute(Sender: TObject);
procedure actCopyAllUpdate(Sender: TObject);
procedure actCopyNameExecute(Sender: TObject); procedure actCopyNameExecute(Sender: TObject);
procedure actCopyValueExecute(Sender: TObject); procedure actCopyValueExecute(Sender: TObject);
procedure actEvaluateExecute(Sender: TObject); procedure actEvaluateExecute(Sender: TObject);
@ -135,6 +139,7 @@ begin
actEvaluate.Caption := lisEvaluateModify; actEvaluate.Caption := lisEvaluateModify;
actCopyName.Caption := lisLocalsDlgCopyName; actCopyName.Caption := lisLocalsDlgCopyName;
actCopyValue.Caption := lisLocalsDlgCopyValue; actCopyValue.Caption := lisLocalsDlgCopyValue;
actCopyAll.Caption := lisCopyAll;
for i := low(COL_WIDTHS) to high(COL_WIDTHS) do for i := low(COL_WIDTHS) to high(COL_WIDTHS) do
lvLocals.Column[i].Width := COL_WIDTHS[i]; lvLocals.Column[i].Width := COL_WIDTHS[i];
@ -176,6 +181,27 @@ begin
Clipboard.Close; Clipboard.Close;
end; end;
procedure TLocalsDlg.actCopyAllExecute(Sender: TObject);
Var
AStringList : TStringList;
I : Integer;
begin
if lvLocals.Items.Count > 0 then begin
AStringList := TStringList.Create;
for I := 0 to lvLocals.Items.Count - 1 do
AStringList.Values[lvLocals.Items[I].Caption] := lvLocals.Items[I].SubItems[0];
Clipboard.Open;
Clipboard.AsText := AStringList.Text;
Clipboard.Close;
FreeAndNil(AStringList);
end;
end;
procedure TLocalsDlg.actCopyAllUpdate(Sender: TObject);
begin
(Sender as TAction).Enabled := lvLocals.Items.Count > 0;
end;
procedure TLocalsDlg.actCopyValueExecute(Sender: TObject); procedure TLocalsDlg.actCopyValueExecute(Sender: TObject);
begin begin
Clipboard.Open; Clipboard.Open;