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

TCustomFloatSpinEdit

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

The base class for a spin edit control using a floating point value.

Declaration

Source position: spin.pp line 33

type TCustomFloatSpinEdit = class(TCustomEdit)

protected

  class procedure WSRegisterClass; override;

  

Registers this component class with the current WidgetSet.

  procedure Change; override;

  

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

  procedure EditingDone; override;

  

Performs actions when editing has been completed for the control.

  function RealGetText; override;

  

Gets the value for the text in the control.

  procedure RealSetText(); override;

  

Updates Modified and the TextHint display when storing the new Text value.

  procedure TextChanged; override;

  

Updates the control state when the value in Text has been changed.

  procedure SetDecimals(); virtual;

  

Sets the value for the DecimalPlaces property.

  procedure SetValue(); virtual;

  

Sets the value for the Value property.

  procedure SetMaxValue(); virtual;

  

Sets the value for the MaxValue property.

  procedure SetMinValue(); virtual;

  

Sets the value for the MinValue property.

  procedure SetValueEmpty(); virtual;

  

Sets the value for the ValueEmpty property.

  procedure SetIncrement(); virtual;

  

Sets the value for the Increment property.

  procedure InitializeWnd; override;

  

Creates or re-creates the handle for the windowed control.

  procedure FinalizeWnd; override;

  

Frees the handle for the windowed control.

  procedure Loaded; override;

  

Performs actions when LCL component streaming is completed.

  procedure KeyPress(); override;

  

Handles key press events for the control.

  class function GetControlClassDefaultSize; override;

  

Gets the default size for new instances of the class.

public

  constructor Create(); override;

  

Constructor for the class instance.

  function GetLimitedValue(); virtual;

  

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

  function ValueToStr(); virtual;

  

Converts the specified value to a String type using the spin edit settings.

  function StrToValue(); virtual;

  

Converts the specified string to a float value according to spin edit settings.

  property DecimalPlaces: Integer; [rw]

  

Number of the decimal places displayed in the spin edit control.

  property EditorEnabled: Boolean; [rw]

  

Indicates whether the value for the control can be entered directly into its edit box.

  property Increment: Double; [rws]

  

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

  property MinValue: Double; [rw]

  

Minimum value allowed in the spin edit control.

  property MaxValue: Double; [rws]

  

Maximum value allowed in the spin edit control.

  property Value: Double; [rw]

  

The floating point value for the spin edit control.

  property ValueEmpty: Boolean; [rw]

  

Indicates that a value has not been assigned for the control.

end;

Inheritance

TCustomFloatSpinEdit

  

The base class for a spin edit control using a floating point value.

|

TCustomEdit

  

The base class for controls presenting editable text.

|

TWinControl

  

Implements a windowed control which can contain other child controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

TCustomFloatSpinEdit is a TCustomEdit descendant which implements the base class for the float-based spin edit control. It provides an edit control where the Float value can be entered directly, and up / down buttons which can be used to increment or decrement the value for the control.

Use the Value property to assign a floating point value to the control as a Double type. 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).

At run-time, setting Value to a number outside of the range for the real type causes Value to be updated. 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.

Version info

Modified in LCL version 3.0 to implement range checking with floating point property editor support.

See also

TCustomFloatSpinEdit.Value

  

The floating point value for the spin edit control.

TCustomFloatSpinEdit.MinValue

  

Minimum value allowed in the spin edit control.

TCustomFloatSpinEdit.MaxValue

  

Maximum value allowed in the spin edit control.

TCustomFloatSpinEdit.DecimalPlaces

  

Number of the decimal places displayed in the spin edit control.

TCustomFloatSpinEdit.Increment

  

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

TCustomEdit

  

The base class for controls presenting editable text.


Version 3.2 Generated 2024-02-25 Home