mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 00:02:03 +02:00
DBG: Allow adding watches by paste (from clipboard) into watches window. Part of Issue #0023368
git-svn-id: trunk@39342 -
This commit is contained in:
parent
6344d6ba56
commit
8b2d6d862c
@ -10,7 +10,9 @@ inherited WatchesDlg: TWatchesDlg
|
||||
Caption = 'Watch list'
|
||||
ClientHeight = 200
|
||||
ClientWidth = 500
|
||||
KeyPreview = True
|
||||
OnDestroy = FormDestroy
|
||||
OnKeyDown = FormKeyDown
|
||||
OnShow = FormShow
|
||||
object lvWatches: TListView[0]
|
||||
Left = 0
|
||||
@ -143,8 +145,8 @@ inherited WatchesDlg: TWatchesDlg
|
||||
object Page1: TPage
|
||||
object InspectMemo: TMemo
|
||||
Left = 0
|
||||
Height = 157
|
||||
Top = 17
|
||||
Height = 159
|
||||
Top = 15
|
||||
Width = 200
|
||||
Align = alClient
|
||||
ReadOnly = True
|
||||
@ -154,7 +156,7 @@ inherited WatchesDlg: TWatchesDlg
|
||||
end
|
||||
object InspectLabel: TLabel
|
||||
Left = 0
|
||||
Height = 17
|
||||
Height = 15
|
||||
Top = 0
|
||||
Width = 200
|
||||
Align = alTop
|
||||
|
@ -39,7 +39,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, Forms, Controls, math, sysutils, LazLoggerBase, Clipbrd,
|
||||
IDEWindowIntf, Menus, ComCtrls, ActnList, ExtCtrls, StdCtrls, IDEImagesIntf,
|
||||
IDEWindowIntf, Menus, ComCtrls, ActnList, ExtCtrls, StdCtrls, LCLType, IDEImagesIntf,
|
||||
LazarusIDEStrConsts, DebuggerStrConst, Debugger, DebuggerDlg,
|
||||
BaseDebugManager;
|
||||
|
||||
@ -118,6 +118,7 @@ type
|
||||
procedure actPowerExecute(Sender: TObject);
|
||||
procedure actToggleInspectSiteExecute(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure lvWatchesDblClick(Sender: TObject);
|
||||
procedure lvWatchesSelectItem(Sender: TObject; AItem: TListItem; Selected: Boolean);
|
||||
@ -417,6 +418,28 @@ begin
|
||||
//DebugLn('TWatchesDlg.FormDestroy ',DbgSName(Self));
|
||||
end;
|
||||
|
||||
procedure TWatchesDlg.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
var
|
||||
s: String;
|
||||
NewWatch: TCurrentWatch;
|
||||
begin
|
||||
if (Shift * [ssShift, ssAlt, ssAltGr, ssCtrl] = [ssCtrl]) and (Key = VK_V)
|
||||
then begin
|
||||
Key := 0;
|
||||
s := Clipboard.AsText;
|
||||
if s <> '' then begin
|
||||
NewWatch := DebugBoss.Watches.CurrentWatches.Add(s);
|
||||
NewWatch.DisplayFormat := wdfDefault;
|
||||
NewWatch.EvaluateFlags := [defClassAutoCast];
|
||||
NewWatch.Enabled := True;
|
||||
end;
|
||||
|
||||
exit;
|
||||
end;
|
||||
|
||||
inherited FormKeyDown(Sender, Key, Shift);
|
||||
end;
|
||||
|
||||
procedure TWatchesDlg.FormShow(Sender: TObject);
|
||||
begin
|
||||
UpdateAll;
|
||||
|
Loading…
Reference in New Issue
Block a user