mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 19:19:19 +02:00
IdeDebugger: Watches, fix updating array-nav-bar while scrolling
(cherry picked from commit 2234c02716
)
This commit is contained in:
parent
d88073b520
commit
d25e9d67fe
@ -5,8 +5,8 @@ unit DebuggerTreeView;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Types, laz.VirtualTrees, SpinEx, LMessages, Controls,
|
Classes, SysUtils, Types, Math, laz.VirtualTrees, SpinEx, LMessages, Controls,
|
||||||
ImgList;
|
ImgList, LCLIntf;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ type
|
|||||||
procedure SetNodeText(Node: PVirtualNode; AColumn: integer; AValue: String);
|
procedure SetNodeText(Node: PVirtualNode; AColumn: integer; AValue: String);
|
||||||
procedure ChangeControl(Node: PVirtualNode; NData: PDbgTreeNodeData; AControl: TControl);
|
procedure ChangeControl(Node: PVirtualNode; NData: PDbgTreeNodeData; AControl: TControl);
|
||||||
protected
|
protected
|
||||||
procedure CheckControlsVisible;
|
procedure CheckControlsVisible(SkipPos: boolean = False);
|
||||||
procedure EndUpdate; override;
|
procedure EndUpdate; override;
|
||||||
function DoSetOffsetXY(Value: TPoint; Options: TScrollUpdateOptions;
|
function DoSetOffsetXY(Value: TPoint; Options: TScrollUpdateOptions;
|
||||||
ClipRect: PRect = nil): Boolean; override;
|
ClipRect: PRect = nil): Boolean; override;
|
||||||
@ -307,23 +307,25 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDbgTreeView.CheckControlsVisible;
|
procedure TDbgTreeView.CheckControlsVisible(SkipPos: boolean);
|
||||||
var
|
var
|
||||||
VNode: PVirtualNode;
|
VNode: PVirtualNode;
|
||||||
Y, H: Integer;
|
Y, H, T, B: Integer;
|
||||||
Ctrl: TControl;
|
Ctrl: TControl;
|
||||||
Chg: Boolean;
|
Chg: Boolean;
|
||||||
begin
|
begin
|
||||||
if (FFirstControlNode = nil) or (UpdateCount > 0) then
|
if (FFirstControlNode = nil) or (UpdateCount > 0) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
Y := OffsetY;
|
T := Header.Height;
|
||||||
|
B := ClientHeight - 1 + T; // subtracted by laz.VirtualTree
|
||||||
|
Y := OffsetY + T;
|
||||||
Chg := False;
|
Chg := False;
|
||||||
for VNode in VisibleNoInitNodes do begin
|
for VNode in VisibleNoInitNodes do begin
|
||||||
Ctrl := NodeControl[VNode];
|
Ctrl := NodeControl[VNode];
|
||||||
H := NodeHeight[VNode];
|
H := NodeHeight[VNode];
|
||||||
if (Ctrl <> nil) then begin
|
if (Ctrl <> nil) then begin
|
||||||
if (Y < 0) or (Y + H >= ClientHeight) then begin
|
if (Y < T) or (Y >= B) then begin
|
||||||
Chg := Chg or Ctrl.Visible;
|
Chg := Chg or Ctrl.Visible;
|
||||||
Ctrl.Visible := False;
|
Ctrl.Visible := False;
|
||||||
end
|
end
|
||||||
@ -333,8 +335,10 @@ begin
|
|||||||
(Ctrl.Height <> H) or
|
(Ctrl.Height <> H) or
|
||||||
(Ctrl.Visible <> True);
|
(Ctrl.Visible <> True);
|
||||||
|
|
||||||
Ctrl.Top := Y;
|
if (not Ctrl.Visible) or (not SkipPos) then begin
|
||||||
Ctrl.Height := H;
|
Ctrl.Top := Y;
|
||||||
|
Ctrl.Height := Min(H, b - 1 - Y);
|
||||||
|
end;
|
||||||
Ctrl.Visible := True;
|
Ctrl.Visible := True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -357,6 +361,8 @@ begin
|
|||||||
Result := inherited DoSetOffsetXY(Value, Options, ClipRect);
|
Result := inherited DoSetOffsetXY(Value, Options, ClipRect);
|
||||||
{$if defined(LCLGtk) or defined(LCLGtk2)}
|
{$if defined(LCLGtk) or defined(LCLGtk2)}
|
||||||
CheckControlsVisible;
|
CheckControlsVisible;
|
||||||
|
{$else}
|
||||||
|
CheckControlsVisible(True);
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -487,13 +493,15 @@ begin
|
|||||||
if NData^.Control <> nil then begin
|
if NData^.Control <> nil then begin
|
||||||
if PaintInfo.Column = 0 then begin
|
if PaintInfo.Column = 0 then begin
|
||||||
r := GetDisplayRect(PaintInfo.Node, 0, True, False);
|
r := GetDisplayRect(PaintInfo.Node, 0, True, False);
|
||||||
r.Right := ClientWidth - 1;
|
if r.Top >= Header.Height then begin
|
||||||
NData^.Control.BoundsRect := r;
|
r.Right := ClientWidth - 1;
|
||||||
NData^.Control.Visible := True;
|
NData^.Control.BoundsRect := r;
|
||||||
if (r.Top < (r.Bottom - r.Height) * 2 + 5) or
|
NData^.Control.Visible := True;
|
||||||
(r.Bottom > ClientHeight - (r.Bottom - r.Height) * 2 - 5)
|
if (r.Top < (r.Bottom - r.Height) * 2 + 5) or
|
||||||
then
|
(r.Bottom > ClientHeight - (r.Bottom - r.Height) * 2 - 5)
|
||||||
NData^.Control.Invalidate;
|
then
|
||||||
|
NData^.Control.Invalidate;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user