[Overview][Classes][Procedures and functions][Index] Reference for unit 'Spin' (#lcl)

TCustomFloatSpinEdit.Value

The floating point value for the spin edit control.

Declaration

Source position: spin.pp line 83

public property TCustomFloatSpinEdit.Value : Double
  read GetValue
  write SetValue;

Description

Value is a Double property which contains the floating point value for the spin edit control. It can be modified using the UI elements for the control (up and down buttons, up and down cursor keys, or the edit box for the control). It can also be assigned directly in program code.

Value is a 64-bit real type in the range 5.0E-324 .. 1.7E308 (inclusive), and allows up to 15-16 digits of precision (15 digits for a negative value).

Changing the value for the property causes the Text for the control to be checked for a valid numeric representation for the property. If the new property value is the same as the existing value, no actions are performed.

When the property value has been stored, internal flags are set to ensure that Modified is updated accordingly and the private UpdateControl method is called. If the handle for the control has been allocated, the Change method is called to post a CM_CHANGED control message and signal OnChange handler(s) assigned for the control.

When changed, Value is constrained to the range defined in the MinValue and MaxValue properties (when assigned). The range limits are not enforced when MinValue and MaxValue have the same value, or when MaxValue is smaller than MinValue. When neither MinValue nor MaxValue have been assigned, either -Inf or +Inf is displayed as the value for the control. If either MinValue or MaxValue has been given an explicit non-default value, the Value property is updated with corresponding range limit.

In LCL version 3.0, the floating point property editor will not allow an invalid value to be stored in the Value property at design-time. An error is raised (and handled) with the message 'Property value out of range', and the Value property is not updated.

LCL versions prior to 3.0 allowed the values +Inf, -Inf, and NaN to be assigned as the property value. These values are no longer supported in LCL version 3.0 and later.

Use the MinValue and MaxValue properties to define the lower and upper limits for the Value in the control. Like Value, they are implemented as a Double type with the same range limits. An invalid value causes the property to be set to the corresponding range limit for the real type.

Use the DecimalPlaces property to specify the number of decimal digits displayed for a value not represented using the radix/precision/exponent format for the IEE 754 value.

Use the Increment property to set the value added to or subtracted from the control Value when the up or down buttons are clicked.

See also

TCustomFloatSpinEdit.MinValue

  

Minimum value allowed in the spin edit control.

TCustomFloatSpinEdit.MaxValue

  

Maximum value allowed in the spin edit control.

TCustomFloatSpinEdit.GetLimitedValue

  

Limits the specified value to the minimum and maximum values for the control.

TCustomFloatSpinEdit.Change

  

Updates Modified prior to sending control messages and signalling OnChange handler(s).

TCustomFloatSpinEdit.Increment

  

Amount applied to the control value when the up or down arrow button is pushed.

TCustomEdit.Modified

  

True when the value in Text has been changed using the keyboard.


Version 3.2 Generated 2024-02-25 Home