Skip to content

Commit

Permalink
Custom patch (sethotnode) for ASuite
Browse files Browse the repository at this point in the history
  • Loading branch information
salvadorbs committed Sep 28, 2024
1 parent 11c0b27 commit 1d70f19
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion Source/VirtualTrees.BaseTree.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5254,8 +5254,34 @@ procedure TBaseVirtualTree.SetHeader(const Value: TVTHeader);

procedure TBaseVirtualTree.SetHotNode(Value: PVirtualNode);

var
DoInvalidate: Boolean;
const
MouseButtonDown = [tsLeftButtonDown, tsMiddleButtonDown, tsRightButtonDown];
begin
FCurrentHotNode := Value;
with Self do begin
if FCurrentHotNode <> Value then
begin
DoInvalidate := (toHotTrack in FOptions.PaintOptions) or
(toCheckSupport in FOptions.MiscOptions);
DoHotChange(FCurrentHotNode, Value);
// Invalidate old FCurrentHotNode
if Assigned(FCurrentHotNode) and DoInvalidate then
InvalidateNode(FCurrentHotNode);
// Set new FCurrentHotNode and invalidate it
FCurrentHotNode := Value;
if Assigned(FCurrentHotNode) and DoInvalidate then
InvalidateNode(FCurrentHotNode);
// Scroll view
if (FUpdateCount = 0) and
not(toDisableAutoscrollOnFocus in FOptions.AutoOptions)
then
ScrollIntoView(FCurrentHotNode,
(toCenterScrollIntoView in FOptions.SelectionOptions)
and (MouseButtonDown * FStates = []),
not(toFullRowSelect in FOptions.SelectionOptions));
end;
end;
end;


Expand Down

0 comments on commit 1d70f19

Please sign in to comment.