mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 08:59:13 +02:00
Debugger: Watches, fix "not showing" the last array element / fixed page size calculation / ensure to trigger evaluation, when node is expanded.
This commit is contained in:
parent
ee5cc5f780
commit
8c9d81c77f
@ -39,6 +39,7 @@ object WatchesDlg: TWatchesDlg
|
|||||||
OnChange = tvWatchesChange
|
OnChange = tvWatchesChange
|
||||||
OnDragOver = tvWatchesDragOver
|
OnDragOver = tvWatchesDragOver
|
||||||
OnDragDrop = tvWatchesDragDrop
|
OnDragDrop = tvWatchesDragDrop
|
||||||
|
OnExpanded = tvWatchesExpanded
|
||||||
OnFocusChanged = tvWatchesFocusChanged
|
OnFocusChanged = tvWatchesFocusChanged
|
||||||
OnInitChildren = tvWatchesInitChildren
|
OnInitChildren = tvWatchesInitChildren
|
||||||
OnNodeDblClick = tvWatchesNodeDblClick
|
OnNodeDblClick = tvWatchesNodeDblClick
|
||||||
@ -164,13 +165,14 @@ object WatchesDlg: TWatchesDlg
|
|||||||
Width = 200
|
Width = 200
|
||||||
Align = alTop
|
Align = alTop
|
||||||
Caption = '...'
|
Caption = '...'
|
||||||
|
Color = clDefault
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object mnuPopup: TPopupMenu
|
object mnuPopup: TPopupMenu
|
||||||
left = 100
|
Left = 100
|
||||||
top = 96
|
Top = 96
|
||||||
object popAdd: TMenuItem
|
object popAdd: TMenuItem
|
||||||
Action = actAddWatch
|
Action = actAddWatch
|
||||||
end
|
end
|
||||||
|
@ -133,6 +133,7 @@ type
|
|||||||
procedure tvWatchesDragOver(Sender: TBaseVirtualTree; Source: TObject;
|
procedure tvWatchesDragOver(Sender: TBaseVirtualTree; Source: TObject;
|
||||||
Shift: TShiftState; State: TDragState; const Pt: TPoint; Mode: TDropMode;
|
Shift: TShiftState; State: TDragState; const Pt: TPoint; Mode: TDropMode;
|
||||||
var Effect: LongWord; var Accept: Boolean);
|
var Effect: LongWord; var Accept: Boolean);
|
||||||
|
procedure tvWatchesExpanded(Sender: TBaseVirtualTree; Node: PVirtualNode);
|
||||||
procedure tvWatchesFocusChanged(Sender: TBaseVirtualTree;
|
procedure tvWatchesFocusChanged(Sender: TBaseVirtualTree;
|
||||||
Node: PVirtualNode; Column: TColumnIndex);
|
Node: PVirtualNode; Column: TColumnIndex);
|
||||||
procedure tvWatchesInitChildren(Sender: TBaseVirtualTree;
|
procedure tvWatchesInitChildren(Sender: TBaseVirtualTree;
|
||||||
@ -484,6 +485,20 @@ begin
|
|||||||
( (Source is TCustomEdit) and (TCustomEdit(Source).SelText <> '') );
|
( (Source is TCustomEdit) and (TCustomEdit(Source).SelText <> '') );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWatchesDlg.tvWatchesExpanded(Sender: TBaseVirtualTree;
|
||||||
|
Node: PVirtualNode);
|
||||||
|
var
|
||||||
|
AWatch: TIdeWatch;
|
||||||
|
begin
|
||||||
|
Node := tvWatches.GetFirstChildNoInit(Node);
|
||||||
|
while Node <> nil do begin
|
||||||
|
AWatch := TIdeWatch(tvWatches.NodeItem[Node]);
|
||||||
|
if AWatch <> nil then
|
||||||
|
UpdateItem(Node, AWatch);
|
||||||
|
Node := tvWatches.GetNextSiblingNoInit(Node);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TWatchesDlg.tvWatchesFocusChanged(Sender: TBaseVirtualTree;
|
procedure TWatchesDlg.tvWatchesFocusChanged(Sender: TBaseVirtualTree;
|
||||||
Node: PVirtualNode; Column: TColumnIndex);
|
Node: PVirtualNode; Column: TColumnIndex);
|
||||||
begin
|
begin
|
||||||
@ -1181,7 +1196,7 @@ begin
|
|||||||
ExistingNode := tvWatches.GetNextSiblingNoInit(ExistingNode);
|
ExistingNode := tvWatches.GetNextSiblingNoInit(ExistingNode);
|
||||||
|
|
||||||
Offs := Nav.Index;
|
Offs := Nav.Index;
|
||||||
for i := 0 to ChildCount do begin
|
for i := 0 to ChildCount - 1 do begin
|
||||||
Idx := IntToStr(Offs + i);
|
Idx := IntToStr(Offs + i);
|
||||||
|
|
||||||
NewWatch := AWatch.ChildrenByName[Idx];
|
NewWatch := AWatch.ChildrenByName[Idx];
|
||||||
@ -1193,8 +1208,8 @@ begin
|
|||||||
if AWatch is TCurrentWatch then begin
|
if AWatch is TCurrentWatch then begin
|
||||||
NewWatch.DisplayFormat := wdfDefault;
|
NewWatch.DisplayFormat := wdfDefault;
|
||||||
NewWatch.Enabled := AWatch.Enabled;
|
NewWatch.Enabled := AWatch.Enabled;
|
||||||
if EnvironmentOptions.DebuggerAutoSetInstanceFromClass then
|
if (defClassAutoCast in AWatch.EvaluateFlags) then
|
||||||
NewWatch.EvaluateFlags := [defClassAutoCast];
|
NewWatch.EvaluateFlags := NewWatch.EvaluateFlags + [defClassAutoCast];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if ExistingNode <> nil then begin
|
if ExistingNode <> nil then begin
|
||||||
@ -1208,6 +1223,8 @@ begin
|
|||||||
UpdateItem(nd, NewWatch);
|
UpdateItem(nd, NewWatch);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
inc(ChildCount); // for the nav row
|
||||||
|
|
||||||
if AWatch is TCurrentWatch then begin
|
if AWatch is TCurrentWatch then begin
|
||||||
KeepCnt := Nav.PageSize;
|
KeepCnt := Nav.PageSize;
|
||||||
KeepBelow := KeepCnt;
|
KeepBelow := KeepCnt;
|
||||||
|
@ -156,7 +156,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := edArrayPageSize.Value;
|
Result := edArrayPageSize.Value;
|
||||||
idx := edArrayStart.Value;
|
idx := edArrayStart.Value;
|
||||||
if (idx >= FLowBound) and (idx < FHighBound) then
|
if (idx >= FLowBound) and (idx <= FHighBound) then
|
||||||
Result := Max(1, Min(Result, FHighBound + 1 - idx));
|
Result := Max(1, Min(Result, FHighBound + 1 - idx));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user