[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Controls' (#lcl)

TControl.GetMousePosFromMessage

Converts the coordinates in the mouse message from SmallInt to LongInt values.

Declaration

Source position: controls.pp line 1494

protected function TControl.GetMousePosFromMessage(

  const MessageMousePos: TSmallPoint

):TPoint;

Arguments

MessageMousePos

  

TSmallPoint instance with the values converted in the method.

Function result

TPoint instance with the LongInt values for the mouse cursor position.

Description

MessageMousePos is a TSmallPoint type with the mouse coordinates as SmallInt values. The return value is a TPoint instance with the LongInt values for the converted mouse coordinates.

If the control has a Width or Height that exceeds the maximum value for the SmallInt type, GetCursorPos is called to get the current mouse pointer position and the values are converted from screen to client coordinates. Otherwise, SmallPointToPoint is called to convert the values in MessageMousePos.

GetMousePosFromMessage provides coordinates using the type needed in MouseDown, MouseUp, MouseMove, and other mouse message handling methods in the control.

See also

TControl.ScreenToClient

  

Converts absolute screen coordinates into client-relative coordinates.

TControl.MouseUp

  

Signals the OnMouseUp handler.

TControl.MouseDown

  

Handles a mouse down event for the control.

TControl.MouseMove

  

Handler for MouseMove events.

TControl.OnMouseWheelDown

  

Event handler signalled for a downward movement of the mouse wheel.

TControl.OnMouseWheelUp

  

Event handler signalled for an upward movement of the mouse wheel.

TSmallPoint

TPoint


Version 3.2 Generated 2024-02-25 Home