Skip to content

Commit

Permalink
Preparation for issue JAM-Software#770: TBaseVirtualTree.CMHintShow()…
Browse files Browse the repository at this point in the history
… now compiles the hint text only using TCMHintShow.HintStr and at the end assignes the compiled hint to FHintData.HintText.
  • Loading branch information
joachimmarder authored and Sharlikran committed Oct 17, 2018
1 parent 8cbc41e commit 6bd08e9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Source/VirtualTrees.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16357,8 +16357,8 @@ procedure TBaseVirtualTree.CMHintShow(var Message: TCMHintShow);
// cancel this with ESC.
if (HitInfo.HitColumn > NoColumn) and not (csLButtonDown in ControlState) then
begin
FHintData.HintText := FHeader.FColumns[HitInfo.HitColumn].FHint;
if FHintData.HintText <> '' then
HintStr := FHeader.FColumns[HitInfo.HitColumn].FHint;
if HintStr <> '' then
ShowOwnHint := True
else
Result := 1;
Expand Down Expand Up @@ -16457,7 +16457,6 @@ procedure TBaseVirtualTree.CMHintShow(var Message: TCMHintShow);
if ShowOwnHint then
begin
// Node specific hint text given will be retrieved when needed.
FHintData.HintText := HintStr;
HintPos := ClientToScreen(Point(NodeRect.Left, NodeRect.Top));
CursorRect := NodeRect;
end
Expand All @@ -16474,9 +16473,9 @@ procedure TBaseVirtualTree.CMHintShow(var Message: TCMHintShow);
// No node so fall back to control's hint (if indicated) or show nothing.
if FHintMode = hmHintAndDefault then
begin
FHintData.HintText := GetShortHint(Hint);
HintStr := GetShortHint(Hint);

// Fix for the problem: Default Hint once shown stayed even when
// Fix for the problem: Default Hint once shown stayed even when
// node hint was to be displayed. The reason was that CursorRect
// was for the full client area. Now reducing it to remove the
// columns from it.
Expand All @@ -16485,7 +16484,7 @@ procedure TBaseVirtualTree.CMHintShow(var Message: TCMHintShow);
else
CursorRect.right := CursorRect.right - Header.Columns.TotalWidth;

if Length(FHintData.HintText) = 0 then
if Length(HintStr) = 0 then
Result := 1
else
ShowOwnHint := True;
Expand All @@ -16500,7 +16499,7 @@ procedure TBaseVirtualTree.CMHintShow(var Message: TCMHintShow);
if ShowOwnHint and (Result = 0) then
begin
HintWindowClass := GetHintWindowClass;

FHintData.HintText := HintStr;
FHintData.Tree := Self;
FHintData.Column := HitInfo.HitColumn;
FHintData.Node := HitInfo.HitNode;
Expand Down

0 comments on commit 6bd08e9

Please sign in to comment.