ide, debugger: watches:

- allow Add watch always
  - if Add watch is called outside source editor then show the Add Watch dialog
  - pass expression under the cursor to the Add Watch dialog as a default value

git-svn-id: trunk@21974 -
This commit is contained in:
paul 2009-10-02 06:18:19 +00:00
parent ce5feafb1b
commit ec062ef3a0
5 changed files with 66 additions and 65 deletions

View File

@ -10,15 +10,15 @@ object WatchPropertyDlg: TWatchPropertyDlg
ClientHeight = 210 ClientHeight = 210
ClientWidth = 420 ClientWidth = 420
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '0.9.27' LCLVersion = '0.9.29'
object lblExpression: TLabel object lblExpression: TLabel
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideTop.Control = txtExpression AnchorSideTop.Control = txtExpression
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 13 Height = 14
Top = 11 Top = 9
Width = 65 Width = 57
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'Expression:' Caption = 'Expression:'
ParentColor = False ParentColor = False
@ -28,9 +28,9 @@ object WatchPropertyDlg: TWatchPropertyDlg
AnchorSideTop.Control = txtRepCount AnchorSideTop.Control = txtRepCount
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 13 Height = 14
Top = 40 Top = 36
Width = 80 Width = 72
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'Repeat Count:' Caption = 'Repeat Count:'
ParentColor = False ParentColor = False
@ -41,9 +41,9 @@ object WatchPropertyDlg: TWatchPropertyDlg
AnchorSideTop.Control = txtDigits AnchorSideTop.Control = txtDigits
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 171 Left = 171
Height = 13 Height = 14
Top = 40 Top = 36
Width = 35 Width = 31
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'Digits:' Caption = 'Digits:'
ParentColor = False ParentColor = False
@ -53,7 +53,7 @@ object WatchPropertyDlg: TWatchPropertyDlg
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 105 Left = 105
Height = 23 Height = 21
Top = 6 Top = 6
Width = 309 Width = 309
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
@ -65,8 +65,8 @@ object WatchPropertyDlg: TWatchPropertyDlg
AnchorSideTop.Control = txtExpression AnchorSideTop.Control = txtExpression
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 105 Left = 105
Height = 23 Height = 21
Top = 35 Top = 33
Width = 60 Width = 60
BorderSpacing.Top = 6 BorderSpacing.Top = 6
TabOrder = 2 TabOrder = 2
@ -77,9 +77,9 @@ object WatchPropertyDlg: TWatchPropertyDlg
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = txtExpression AnchorSideTop.Control = txtExpression
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 212 Left = 208
Height = 23 Height = 21
Top = 35 Top = 33
Width = 60 Width = 60
BorderSpacing.Left = 6 BorderSpacing.Left = 6
BorderSpacing.Top = 6 BorderSpacing.Top = 6
@ -90,9 +90,9 @@ object WatchPropertyDlg: TWatchPropertyDlg
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideTop.Control = chkAllowFunc AnchorSideTop.Control = chkAllowFunc
Left = 6 Left = 6
Height = 20 Height = 17
Top = 64 Top = 60
Width = 70 Width = 56
AllowGrayed = True AllowGrayed = True
BorderSpacing.Left = 6 BorderSpacing.Left = 6
Caption = 'Enabled' Caption = 'Enabled'
@ -102,9 +102,9 @@ object WatchPropertyDlg: TWatchPropertyDlg
AnchorSideTop.Control = txtRepCount AnchorSideTop.Control = txtRepCount
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 105 Left = 105
Height = 20 Height = 17
Top = 64 Top = 60
Width = 140 Width = 112
AllowGrayed = True AllowGrayed = True
BorderSpacing.Top = 6 BorderSpacing.Top = 6
Caption = 'Allow Function Calls' Caption = 'Allow Function Calls'
@ -118,7 +118,7 @@ object WatchPropertyDlg: TWatchPropertyDlg
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 6 Left = 6
Height = 78 Height = 78
Top = 90 Top = 83
Width = 408 Width = 408
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
AutoFill = True AutoFill = True
@ -134,7 +134,7 @@ object WatchPropertyDlg: TWatchPropertyDlg
ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 3 ChildSizing.ControlsPerLine = 3
ClientHeight = 61 ClientHeight = 60
ClientWidth = 404 ClientWidth = 404
Columns = 3 Columns = 3
ItemIndex = 7 ItemIndex = 7
@ -155,12 +155,10 @@ object WatchPropertyDlg: TWatchPropertyDlg
AnchorSideTop.Control = rgStyle AnchorSideTop.Control = rgStyle
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 30 Height = 37
Top = 174 Top = 167
Width = 408 Width = 408
Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
AutoSize = True
TabOrder = 6 TabOrder = 6
ShowButtons = [pbOK, pbCancel, pbHelp] ShowButtons = [pbOK, pbCancel, pbHelp]
ShowBevel = False ShowBevel = False

View File

@ -5,55 +5,54 @@ LazarusResources.Add('TWatchPropertyDlg','FORMDATA',[
+#210#0#3'Top'#3#184#0#5'Width'#3#164#1#13'ActiveControl'#7#12'chkAllowFunc' +#210#0#3'Top'#3#184#0#5'Width'#3#164#1#13'ActiveControl'#7#12'chkAllowFunc'
+#11'BorderIcons'#11#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Capti' +#11'BorderIcons'#11#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Capti'
+'on'#6#16'Watch Properties'#12'ClientHeight'#3#210#0#11'ClientWidth'#3#164#1 +'on'#6#16'Watch Properties'#12'ClientHeight'#3#210#0#11'ClientWidth'#3#164#1
+#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.27'#0#6'TLabel'#13 +#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.29'#0#6'TLabel'#13
+'lblExpression'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Contr' +'lblExpression'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Contr'
+'ol'#7#13'txtExpression'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2#6#6 +'ol'#7#13'txtExpression'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2#6#6
+'Height'#2#13#3'Top'#2#11#5'Width'#2'A'#18'BorderSpacing.Left'#2#6#7'Caption' +'Height'#2#14#3'Top'#2#9#5'Width'#2'9'#18'BorderSpacing.Left'#2#6#7'Caption'
+#6#11'Expression:'#11'ParentColor'#8#0#0#6'TLabel'#11'lblRepCount'#22'Anchor' +#6#11'Expression:'#11'ParentColor'#8#0#0#6'TLabel'#11'lblRepCount'#22'Anchor'
+'SideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#11'txtRepCount'#18 +'SideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#11'txtRepCount'#18
+'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2#6#6'Height'#2#13#3'Top'#2'('#5 +'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2#6#6'Height'#2#14#3'Top'#2'$'#5
+'Width'#2'P'#18'BorderSpacing.Left'#2#6#7'Caption'#6#13'Repeat Count:'#11'Pa' +'Width'#2'H'#18'BorderSpacing.Left'#2#6#7'Caption'#6#13'Repeat Count:'#11'Pa'
+'rentColor'#8#0#0#6'TLabel'#9'lblDigits'#22'AnchorSideLeft.Control'#7#11'txt' +'rentColor'#8#0#0#6'TLabel'#9'lblDigits'#22'AnchorSideLeft.Control'#7#11'txt'
+'RepCount'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7 +'RepCount'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7
+#9'txtDigits'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#3#171#0#6'Height' +#9'txtDigits'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#3#171#0#6'Height'
+#2#13#3'Top'#2'('#5'Width'#2'#'#18'BorderSpacing.Left'#2#6#7'Caption'#6#7'Di' +#2#14#3'Top'#2'$'#5'Width'#2#31#18'BorderSpacing.Left'#2#6#7'Caption'#6#7'Di'
+'gits:'#11'ParentColor'#8#0#0#5'TEdit'#13'txtExpression'#21'AnchorSideTop.Co' +'gits:'#11'ParentColor'#8#0#0#5'TEdit'#13'txtExpression'#21'AnchorSideTop.Co'
+'ntrol'#7#5'Owner'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight' +'ntrol'#7#5'Owner'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight'
+'.Side'#7#9'asrBottom'#4'Left'#2'i'#6'Height'#2#23#3'Top'#2#6#5'Width'#3'5'#1 +'.Side'#7#9'asrBottom'#4'Left'#2'i'#6'Height'#2#21#3'Top'#2#6#5'Width'#3'5'#1
+#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#6#19 +#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#6#19
+'BorderSpacing.Right'#2#6#8'TabOrder'#2#1#0#0#5'TEdit'#11'txtRepCount'#21'An' +'BorderSpacing.Right'#2#6#8'TabOrder'#2#1#0#0#5'TEdit'#11'txtRepCount'#21'An'
+'chorSideTop.Control'#7#13'txtExpression'#18'AnchorSideTop.Side'#7#9'asrBott' +'chorSideTop.Control'#7#13'txtExpression'#18'AnchorSideTop.Side'#7#9'asrBott'
+'om'#4'Left'#2'i'#6'Height'#2#23#3'Top'#2'#'#5'Width'#2'<'#17'BorderSpacing.' +'om'#4'Left'#2'i'#6'Height'#2#21#3'Top'#2'!'#5'Width'#2'<'#17'BorderSpacing.'
+'Top'#2#6#8'TabOrder'#2#2#4'Text'#6#1'0'#0#0#5'TEdit'#9'txtDigits'#22'Anchor' +'Top'#2#6#8'TabOrder'#2#2#4'Text'#6#1'0'#0#0#5'TEdit'#9'txtDigits'#22'Anchor'
+'SideLeft.Control'#7#9'lblDigits'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21 +'SideLeft.Control'#7#9'lblDigits'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21
+'AnchorSideTop.Control'#7#13'txtExpression'#18'AnchorSideTop.Side'#7#9'asrBo' +'AnchorSideTop.Control'#7#13'txtExpression'#18'AnchorSideTop.Side'#7#9'asrBo'
+'ttom'#4'Left'#3#212#0#6'Height'#2#23#3'Top'#2'#'#5'Width'#2'<'#18'BorderSpa' +'ttom'#4'Left'#3#208#0#6'Height'#2#21#3'Top'#2'!'#5'Width'#2'<'#18'BorderSpa'
+'cing.Left'#2#6#17'BorderSpacing.Top'#2#6#8'TabOrder'#2#4#4'Text'#6#1'0'#0#0 +'cing.Left'#2#6#17'BorderSpacing.Top'#2#6#8'TabOrder'#2#4#4'Text'#6#1'0'#0#0
+#9'TCheckBox'#10'chkEnabled'#22'AnchorSideLeft.Control'#7#5'Owner'#21'Anchor' +#9'TCheckBox'#10'chkEnabled'#22'AnchorSideLeft.Control'#7#5'Owner'#21'Anchor'
+'SideTop.Control'#7#12'chkAllowFunc'#4'Left'#2#6#6'Height'#2#20#3'Top'#2'@'#5 +'SideTop.Control'#7#12'chkAllowFunc'#4'Left'#2#6#6'Height'#2#17#3'Top'#2'<'#5
+'Width'#2'F'#11'AllowGrayed'#9#18'BorderSpacing.Left'#2#6#7'Caption'#6#7'Ena' +'Width'#2'8'#11'AllowGrayed'#9#18'BorderSpacing.Left'#2#6#7'Caption'#6#7'Ena'
+'bled'#8'TabOrder'#2#5#0#0#9'TCheckBox'#12'chkAllowFunc'#21'AnchorSideTop.Co' +'bled'#8'TabOrder'#2#5#0#0#9'TCheckBox'#12'chkAllowFunc'#21'AnchorSideTop.Co'
+'ntrol'#7#11'txtRepCount'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2'i' +'ntrol'#7#11'txtRepCount'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2'i'
+#6'Height'#2#20#3'Top'#2'@'#5'Width'#3#140#0#11'AllowGrayed'#9#17'BorderSpac' +#6'Height'#2#17#3'Top'#2'<'#5'Width'#2'p'#11'AllowGrayed'#9#17'BorderSpacing'
+'ing.Top'#2#6#7'Caption'#6#20'Allow Function Calls'#8'TabOrder'#2#0#0#0#11'T' +'.Top'#2#6#7'Caption'#6#20'Allow Function Calls'#8'TabOrder'#2#0#0#0#11'TRad'
+'RadioGroup'#7'rgStyle'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideT' +'ioGroup'#7'rgStyle'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.'
+'op.Control'#7#12'chkAllowFunc'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'Anc' +'Control'#7#12'chkAllowFunc'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'Anchor'
+'horSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4 +'SideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Lef'
+'Left'#2#6#6'Height'#2'N'#3'Top'#2'Z'#5'Width'#3#152#1#7'Anchors'#11#5'akTop' +'t'#2#6#6'Height'#2'N'#3'Top'#2'S'#5'Width'#3#152#1#7'Anchors'#11#5'akTop'#6
+#6'akLeft'#7'akRight'#0#8'AutoFill'#9#18'BorderSpacing.Left'#2#6#17'BorderSp' +'akLeft'#7'akRight'#0#8'AutoFill'#9#18'BorderSpacing.Left'#2#6#17'BorderSpac'
+'acing.Top'#2#6#19'BorderSpacing.Right'#2#6#7'Caption'#6#5'Style'#28'ChildSi' +'ing.Top'#2#6#19'BorderSpacing.Right'#2#6#7'Caption'#6#5'Style'#28'ChildSizi'
+'zing.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSiz' +'ng.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizin'
+'ing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'ChildSizing.Enlarg' +'g.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'ChildSizing.EnlargeV'
+'eVertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7 +'ertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7
+#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'C' +#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'C'
+'hildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.Contr' +'hildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.Contr'
+'olsPerLine'#2#3#12'ClientHeight'#2'='#11'ClientWidth'#3#148#1#7'Columns'#2#3 +'olsPerLine'#2#3#12'ClientHeight'#2'<'#11'ClientWidth'#3#148#1#7'Columns'#2#3
+#9'ItemIndex'#2#7#13'Items.Strings'#1#6#9'Character'#6#6'String'#6#7'Decimal' +#9'ItemIndex'#2#7#13'Items.Strings'#1#6#9'Character'#6#6'String'#6#7'Decimal'
+#6#11'Hexadecimal'#6#14'Floating Point'#6#7'Pointer'#6#16'Record/Structure'#6 +#6#11'Hexadecimal'#6#14'Floating Point'#6#7'Pointer'#6#16'Record/Structure'#6
+#7'Default'#6#11'Memory Dump'#0#8'TabOrder'#2#3#0#0#12'TButtonPanel'#11'Butt' +#7'Default'#6#11'Memory Dump'#0#8'TabOrder'#2#3#0#0#12'TButtonPanel'#11'Butt'
+'onPanel'#21'AnchorSideTop.Control'#7#7'rgStyle'#18'AnchorSideTop.Side'#7#9 +'onPanel'#21'AnchorSideTop.Control'#7#7'rgStyle'#18'AnchorSideTop.Side'#7#9
+'asrBottom'#4'Left'#2#6#6'Height'#2#30#3'Top'#3#174#0#5'Width'#3#152#1#5'Ali' +'asrBottom'#4'Left'#2#6#6'Height'#2'%'#3'Top'#3#167#0#5'Width'#3#152#1#7'Anc'
+'gn'#7#8'alBottom'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0 +'hors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'TabOrder'#2#6#11'Sho'
+#8'AutoSize'#9#8'TabOrder'#2#6#11'ShowButtons'#11#4'pbOK'#8'pbCancel'#6'pbHe' +'wButtons'#11#4'pbOK'#8'pbCancel'#6'pbHelp'#0#9'ShowBevel'#8#0#0#0
+'lp'#0#9'ShowBevel'#8#0#0#0
]); ]);

View File

@ -63,7 +63,7 @@ type
private private
FWatch: TIDEWatch; FWatch: TIDEWatch;
public public
constructor Create(AOWner: TComponent; const AWatch: TIDEWatch); overload; constructor Create(AOWner: TComponent; const AWatch: TIDEWatch; const AWatchExpression: String = ''); overload;
destructor Destroy; override; destructor Destroy; override;
end; end;
@ -91,13 +91,15 @@ begin
ShowContextHelpForIDE(Self); ShowContextHelpForIDE(Self);
end; end;
constructor TWatchPropertyDlg.Create(AOwner: TComponent; const AWatch: TIDEWatch); constructor TWatchPropertyDlg.Create(AOwner: TComponent; const AWatch: TIDEWatch;
const AWatchExpression: String = '');
begin begin
FWatch := AWatch; FWatch := AWatch;
inherited Create(AOwner); inherited Create(AOwner);
if FWatch = nil if FWatch = nil
then begin then begin
chkEnabled.Checked := True; chkEnabled.Checked := True;
txtExpression.Text := AWatchExpression;
end end
else begin else begin
txtExpression.Text := FWatch.Expression; txtExpression.Text := FWatch.Expression;

View File

@ -121,7 +121,7 @@ type
): TModalResult; virtual; abstract; ): TModalResult; virtual; abstract;
function ShowBreakPointProperties(const ABreakpoint: TIDEBreakPoint): TModalresult; virtual; abstract; function ShowBreakPointProperties(const ABreakpoint: TIDEBreakPoint): TModalresult; virtual; abstract;
function ShowWatchProperties(const AWatch: TIDEWatch): TModalresult; virtual; abstract; function ShowWatchProperties(const AWatch: TIDEWatch; AWatchExpression: String = ''): TModalresult; virtual; abstract;
public public
property Commands: TDBGCommands read GetCommands; // All current available commands of the debugger property Commands: TDBGCommands read GetCommands; // All current available commands of the debugger

View File

@ -181,7 +181,7 @@ type
const ASourceMark: TSourceMark): TModalResult; override; const ASourceMark: TSourceMark): TModalResult; override;
function ShowBreakPointProperties(const ABreakpoint: TIDEBreakPoint): TModalresult; override; function ShowBreakPointProperties(const ABreakpoint: TIDEBreakPoint): TModalresult; override;
function ShowWatchProperties(const AWatch: TIDEWatch): TModalresult; override; function ShowWatchProperties(const AWatch: TIDEWatch; AWatchExpression: String = ''): TModalresult; override;
end; end;
@ -1330,12 +1330,15 @@ begin
if Assigned(SE) then if Assigned(SE) then
begin begin
WatchVar := SE.GetOperandAtCurrentCaret; WatchVar := SE.GetOperandAtCurrentCaret;
if (WatchVar <> '') and (SE.EditorComponent.Focused) and (Watches.Find(WatchVar) = nil) and (Watches.Add(WatchVar) = nil) then if (WatchVar <> '') and SE.EditorComponent.Focused then
begin
if (Watches.Find(WatchVar) <> nil) or (Watches.Add(WatchVar) <> nil) then
Exit; Exit;
end; end;
end;
// watch was not added automatically => show a dialog // watch was not added automatically => show a dialog
// todo: dialog ShowWatchProperties(nil, WatchVar);
end; end;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -1938,8 +1941,7 @@ begin
itmRunMenuEvaluate.Enabled := (not DebuggerInvalid) itmRunMenuEvaluate.Enabled := (not DebuggerInvalid)
and (dcEvaluate in FDebugger.Commands); and (dcEvaluate in FDebugger.Commands);
itmRunMenuAddWatch.Enabled := (not DebuggerInvalid) itmRunMenuAddWatch.Enabled := True; // always allow to add a watch
and (dcWatch in FDebugger.Commands);
// TODO: add other debugger menuitems // TODO: add other debugger menuitems
// TODO: implement by actions // TODO: implement by actions
end; end;
@ -2480,9 +2482,9 @@ begin
Result := TBreakPropertyDlg.Create(Self, ABreakpoint).ShowModal; Result := TBreakPropertyDlg.Create(Self, ABreakpoint).ShowModal;
end; end;
function TDebugManager.ShowWatchProperties(const AWatch: TIDEWatch): TModalresult; function TDebugManager.ShowWatchProperties(const AWatch: TIDEWatch; AWatchExpression: String = ''): TModalresult;
begin begin
Result := TWatchPropertyDlg.Create(Self, AWatch).ShowModal; Result := TWatchPropertyDlg.Create(Self, AWatch, AWatchExpression).ShowModal;
end; end;
procedure TDebugManager.SetDebugger(const ADebugger: TDebugger); procedure TDebugManager.SetDebugger(const ADebugger: TDebugger);