[Lazarus] TreeView.MouseLeave issue

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jun 30 23:02:54 CEST 2017


On Fri, 30 Jun 2017 11:59:56 +0300
Alexey via Lazarus <lazarus at lists.lazarus-ide.org> wrote:

> procedure TCustomTreeView.MouseLeave;
> begin
>    FStates:=FStates-[tvsDblClicked,tvsTripleClicked,tvsQuadClicked,
>                      tvsEditOnMouseUp,tvsSingleSelectOnMouseUp];
>    if Assigned(FHintWnd) and FHintWnd.Visible
>    and not PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos)) then
>      FHintWnd.Hide;
>    inherited MouseLeave;
> end;
> 
> If it is MouseLeave than mouse cannot be in ClientRect, then condittion 
> PtInRect not needed here.

Mouse.CursorPos asks the current state.
MouseLeave is called by an event of the message queue, so the mouse or
control may have moved in the meantime.

Mattias


More information about the Lazarus mailing list