Skip to main content

TdxDockingController.GetNearestDockSiteAtPos(TPoint,TdxCustomDockControl) Method

Returns the dock site that can accept the dock control at the specified position.

Declaration

function GetNearestDockSiteAtPos(const pt: TPoint; ADockControl: TdxCustomDockControl = nil): TdxCustomDockControl;

Parameters

Name Type
pt TPoint
ADockControl TdxCustomDockControl

Returns

Type
TdxCustomDockControl

Remarks

The GetNearestDockSiteAtPos method is used to manage dock sites whose AutoSize property is set to True. Such dock sites can accept dock controls even when the mouse pointer is outside them. This takes place if the following conditions are satisfied:

  • The dock site is aligned to the left, top, right or bottom edge of its parent control (form, frame, etc).

  • The dock site’s width or height is less than specified by the dxDockZonesWidth constant. The dimension used is specified by the alignment type. If the dock site is aligned to the top or bottom edge, its height is considered. If it is aligned to the left or right edge, its width is considered.

The GetNearestDockSiteAtPos method scans through dock sites whose AutoSize property value is True and that are aligned to a container’s edge. Note also, that only dock sites whose width or height (depending on the alignment type) is less than that specified by the dxDockZonesWidth constant are considered. The bounding rectangle of such dock sites is expanded so that the appropriate dimension is equal to the required height or width. If the modified bounding rectangle contains the point passed as the pt parameter, the method returns the dock site found and stops the search.

The image below illustrates the situation where a dock site can accept the dragged dock control while the mouse pointer isn’t pointing to the site.

See Also