Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-06

TreeView.MouseLeave issue

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexey
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.

Regards, Alexey

Reply by email

Mattias Gaertner
to Alexey
Show quoted text 12 lines
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

Reply by email