Skip to main content

TcxHotZoneStyle.CalculateHotZoneRect(TRect) Method

Calculates the bounding rectangle of the hot zone.

Declaration

function CalculateHotZoneRect(const ABounds: TRect): TRect; virtual;

Parameters

Name Type
ABounds TRect

Returns

Type
TRect

Remarks

The CalculateHotZoneRect method calculates the bounding rectangle (accessible via the HotZoneRect property) in which the hot zone will be painted.

The ABounds parameter specifies the bounding rectangle of the owning splitter control. As implemented in the TcxHotZoneStyle class, this parameter is used to calculate the method’s return value depending on the SizePercent property value. However, you may still want to override this method in TcxHotZoneStyle descendants. For instance, you may want your custom hot zone to occupy the whole splitter without regard to the SizePercent property value. To implement this, you need to return the value of the ABounds parameter.

Another reason to override the CalculateHotZoneRect method is to perform additional calculations when the hot zone contains several elements.

Note that, when calculating the hot zone’s bounding rectangle, you must take into account the SplitterDirection property value, which returns the direction of the splitter. Thus, you can determine whether to modify the width or the height of the hot zone’s rectangle.

Refer to the Creating a Custom Hot Zone Style topic for an example of overriding this method.

See Also