lcl: treeview: fix tooltip hiding

git-svn-id: trunk@52362 -
This commit is contained in:
ondrej 2016-05-23 15:28:19 +00:00
parent 4c522305c1
commit f68cca0ca9
2 changed files with 12 additions and 1 deletions

View File

@ -3298,6 +3298,7 @@ type
function GetShowSeparators: boolean;
function GetToolTips: boolean;
function GetTopItem: TTreeNode;
procedure HintMouseLeave(Sender: TObject);
procedure ImageListChange(Sender: TObject);
procedure OnChangeTimer(Sender: TObject);
procedure SetAutoExpand(Value: Boolean);

View File

@ -4128,6 +4128,12 @@ begin
Result := FTopItem;
end;
procedure TCustomTreeView.HintMouseLeave(Sender: TObject);
begin
if FindLCLControl(Mouse.CursorPos)<>Self then
FHintWnd.Hide;
end;
procedure TCustomTreeView.SetTopItem(Value: TTreeNode);
begin
if HandleAllocated and (Value <> nil) then
@ -4235,7 +4241,10 @@ var
MaxHintWidth: Integer;
begin
if FHintWnd=nil then
begin
FHintWnd:=THintWindow.Create(Self);
FHintWnd.OnMouseLeave:=@HintMouseLeave;
end;
Node:=GetNodeAt(X, Y);
if Node=nil then
@ -5528,7 +5537,8 @@ procedure TCustomTreeView.MouseLeave;
begin
FStates:=FStates-[tvsDblClicked,tvsTripleClicked,tvsQuadClicked,
tvsEditOnMouseUp,tvsSingleSelectOnMouseUp];
if Assigned(FHintWnd) then
if Assigned(FHintWnd) and FHintWnd.Visible
and not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos)) then
FHintWnd.Hide;
inherited MouseLeave;
end;