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 Jan 18, 2024
1 parent 706616f commit 407238e
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 @@ -5250,8 +5250,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 407238e

Please sign in to comment.