Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TControl.GetMousePosFromMessage

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

Declaration

Source position: controls.pp line 1421

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

  

Invokes the OnMouseUp handler.

TControl.MouseDown

  

Handles a mouse down event for the control.

TControl.MouseMove

  

Handler for MouseMove events.

TControl.OnMouseWheelDown

  

Event handler for downward movement of mouse wheel.

TControl.OnMouseWheelUp

  

Event handler for upward movement of the mouse wheel.

TSmallPoint

TPoint



CT Web help

CodeTyphon Studio