Skip to main content

TdxRangeControlCustomDateTimeClientProperties.GetNearestNormalizedAcceptableValue(Double) Method

Returns the nearest selectable date/time value (as the corresponding range control‘s viewport coordinate) from the specified range control’s viewport coordinate.

Declaration

function GetNearestNormalizedAcceptableValue(const AValue: Double): Double; override;

Parameters

Name Type
AValue Double

Returns

Type
Double

Remarks

Normally, this function supports the internal infrastructure and is not intended to be used directly from your code. The GetNearestNormalizedAcceptableValue function is called internally by the range control when an end-user selects a date/time value either by dropping the dragged selection thumb or clicking within the control’s area. This function is called to ensure selection of the date/time value corresponding to a tickmark of the currently active or visible predefined scale, depending on the actual date/time range selection and visualization model.

For instance, the visible scale is graduated in days (i.e., its ScaleUnit property returns rcduDay), the GetNearestNormalizedAcceptableValue function returns the viewport coordinate corresponding to nearest number of whole days on the scale, even if the viewport coordinate passed as the AValue parameter corresponds to a position between two days on the scale.

Note

If you are implementing a custom Date/Time-based data range model, you may need to override the GetNearestNormalizedAcceptableValue function in the custom TdxRangeControlCustomDateTimeClientProperties class descendant.

See Also