[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Converts the screen coordinates for the control to the screen coordinates for the specified parent control.
Source position: controls.pp line 1669
public function TControl.ClientToParent( |
const Point: TPoint; |
AParent: TWinControl = Nil |
):TPoint; |
Point |
|
TPoint instance with the client coordinates for the control. |
AParent |
|
Parent control with the bounds for the adjusted coordinates. |
TPoint instance with the client coordinates adjusted to the parent control.
ClientToParent is a TPoint function used to convert the screen coordinates for the control to the screen coordinates for the specified parent control. If Aparent is unassigned, the Parent property for the control is used in the method.
ClientToParent calls the IsParentOf method in AParent to determine if control is in its control hierarchy. An EInvalidOperation exception is raised if the return value from IsParentOf is False.
The return value is determined by converting the client coordinates for the control to screen coordinates, and asking the parent control to convert them back to the client coordinates for the parent control.
ClientToParent is used, for instance, in the TScrollingWinControl.ScrollInView method.
lazarus-ccr.sourceforge.net |