Skip to content

Commit 95b083c

Browse files
committed
Issue #818:
* DoBeforeCellPaint(): No need to invalidate if we are not actually painting * CMHintShowPause(): No need to modify hint pause if we do not intend to show the hint. Removed old commented code.
1 parent e9a856e commit 95b083c

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

Source/VirtualTrees.pas

+3-26
Original file line numberDiff line numberDiff line change
@@ -15959,29 +15959,9 @@ procedure TBaseVirtualTree.CMHintShowPause(var Message: TCMHintShowPause);
1595915959
// Tells the application that the tree (and only the tree) does not want a delayed tool tip.
1596015960
// Normal hints / header hints use the default delay (except for the first time).
1596115961

15962-
begin
15963-
// A little workaround is needed here to make the application class using the correct hint window class.
15964-
// Once the application gets ShowHint set to true (which is the case when we want to show hints in the tree) then
15965-
// an internal hint window will be created which is not our own class (because we don't set an application wide
15966-
// hint window class but only one for the tree). Unfortunately, this default hint window class will prevent
15967-
// hints for the non-client area to show up (e.g. for the header) by calling CancelHint whenever certain messages
15968-
// arrive. By setting the hint show pause to 0 if our hint class was not used recently we make sure
15969-
// that the hint timer (in Forms.pas) is not used and our class is created immediately.
15970-
//
15971-
// Note for newer Delphi versions: Does not work because TApplication.HintMouseMessage() not only checks (Pause = 0) but also TApplication.FHintActive,
15972-
// which is initally False. So this code has been commented. See also issue #728.
15973-
// if FHintWindowDestroyed then
15974-
// begin
15975-
// GetCursorPos(P);
15976-
// // Check if the mouse is in the header or tool tips are enabled, which must be shown without delay anyway.
15977-
// if FHeader.UseColumns and (hoShowHint in FHeader.FOptions) and FHeader.InHeader(ScreenToClient(P)) or
15978-
// (FHintMode = hmToolTip) then
15979-
// Message.Pause^ := 0;
15980-
// end
15981-
// else
15982-
15983-
if FHintMode = hmToolTip then
15984-
Message.Pause^ := 0;
15962+
begin
15963+
if ShowHint and (FHintMode = hmToolTip) then
15964+
Message.Pause^ := 0;
1598515965
end;
1598615966

1598715967
//----------------------------------------------------------------------------------------------------------------------
@@ -19294,10 +19274,7 @@ procedure TBaseVirtualTree.DoBeforeCellPaint(Canvas: TCanvas; Node: PVirtualNode
1929419274
FOnBeforeCellPaint(Self, Canvas, Node, Column, CellPaintMode, CellRect, ContentRect);
1929519275

1929619276
if CellPaintMode = cpmGetContentMargin then
19297-
begin
1929819277
SetUpdateState(False);
19299-
InvalidateRect(Handle, @UpdateRect, False);
19300-
end;
1930119278
end;
1930219279
end;
1930319280

0 commit comments

Comments
 (0)