# FormDoubleSpinBox

A spin box item supporting doubles. Spin boxes are sometimes also referred to as numeric steppers or spinners. Spin boxes are used to obtain a numerical value. Up and down arrows are provided to increment or decrement the value respectively. Alternatively, the numerical value can be typed into the input field.

## Example

form = cf.Form.New("Generate views")

-- Create 'FormDoubleSpinBox' and adjust its initial settings

spinbox = cf.FormDoubleSpinBox.New("Frequency step between views:")
spinbox:SetMinimum(12.5)
spinbox:SetMaximum(250)
spinbox:SetSingleStep(12.5)

-- Run the form and retrieve the user input

form:Run()
selectedFrequency = spinbox.Value


## Inheritance

The FormDoubleSpinBox object is derived from the FormLabelledItem object.

## Property List

Enabled
Controls the item enabled state. Setting the enabled state of an item to false will also disable items or their contents. (Read/Write boolean)
FixedHeight
The fixed height of the item in pixels. When the fixed height is set to a positive value, it is the height of the item. Setting the fixed height to zero or a negative value will restore the default/auto setting and the height will be dynamically determined. The fixed height takes precedence over the minimum height and thus the minimum height is ignored when a fixed height is set. (Read/Write number)
FixedWidth
The fixed width of the item in pixels. When the fixed width is set to a positive value, it is the width of the item. Setting the fixed width to zero or a negative value will restore the default/auto setting and the width will be dynamically determined. The fixed width takes precedence over the minimum width and thus the minimum width is ignored when a fixed width is set. (Read/Write number)
ItemHeight
The height of the item in pixels. (Read only number)
ItemWidth
The width of the item in pixels. (Read only number)
MinimumHeight
The minimum height of the item in pixels. When the height is dynamically determined, it will not be less than the minimum height setting. The minimum height value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum height to zero or a negative value will restore the default/auto setting where no minimum height is enforced. (Read/Write number)
MinimumWidth
The minimum width of the item in pixels. When the width is dynamically determined, it will not be less than the minimum width setting. The minimum width value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum width to zero or a negative value will restore the default/auto setting where no minimum width is enforced. (Read/Write number)
Type
The object type string. (Read only string)
Value
The starting value of the spin box. (Read/Write number)
Visible
Controls the item visibility. Setting the visibility of an item to false will also hide items or their contents. (Read/Write boolean)

## Method List

ClearCallBack ()
Clear the function that will be called when the check box state changes.
LabelItem ()
Returns the built-in label object associated with the form item. This allows access to the label like a normal form label. (Returns a FormLabel object.)
SetCallBack (callback function)
Set the function that will be called when the item's action has triggered.
SetDecimals (decimals number)
The precision of the spin box, in decimals.
SetMaximum (maximum number)
Set the maximum value of the spin box.
SetMinimum (minimum number)
Set the minimum value of the spin box.
SetSingleStep (step number)
The single step size of the spin box item. When the user uses the arrows to change the spin box's value the value will be incremented/decremented by the amount of the single step. The default value is 1.0. Setting a step size value of less than 0 does nothing.

## Constructor Function List

New (label string)
Create a new spin box item. (Returns a FormDoubleSpinBox object.)
New ()
Create a new spin box item. (Returns a FormDoubleSpinBox object.)

## Property Details

Enabled
Controls the item enabled state. Setting the enabled state of an item to false will also disable items or their contents.
Type
boolean
Access
FixedHeight
The fixed height of the item in pixels. When the fixed height is set to a positive value, it is the height of the item. Setting the fixed height to zero or a negative value will restore the default/auto setting and the height will be dynamically determined. The fixed height takes precedence over the minimum height and thus the minimum height is ignored when a fixed height is set.
Type
number
Access
FixedWidth
The fixed width of the item in pixels. When the fixed width is set to a positive value, it is the width of the item. Setting the fixed width to zero or a negative value will restore the default/auto setting and the width will be dynamically determined. The fixed width takes precedence over the minimum width and thus the minimum width is ignored when a fixed width is set.
Type
number
Access
ItemHeight
The height of the item in pixels.
Type
number
Access
ItemWidth
The width of the item in pixels.
Type
number
Access
MinimumHeight
The minimum height of the item in pixels. When the height is dynamically determined, it will not be less than the minimum height setting. The minimum height value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum height to zero or a negative value will restore the default/auto setting where no minimum height is enforced.
Type
number
Access
MinimumWidth
The minimum width of the item in pixels. When the width is dynamically determined, it will not be less than the minimum width setting. The minimum width value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum width to zero or a negative value will restore the default/auto setting where no minimum width is enforced.
Type
number
Access
Type
The object type string.
Type
string
Access
Value
The starting value of the spin box.
Type
number
Access
Visible
Controls the item visibility. Setting the visibility of an item to false will also hide items or their contents.
Type
boolean
Access

## Method Details

ClearCallBack ()
Clear the function that will be called when the check box state changes.
LabelItem ()
Returns the built-in label object associated with the form item. This allows access to the label like a normal form label.
Return
FormLabel
The form label item.
SetCallBack (callback function)
Set the function that will be called when the item's action has triggered.
Input Parameters
callback(function)
The function call back.
SetDecimals (decimals number)
The precision of the spin box, in decimals.
Input Parameters
decimals(number)
The precision.
SetMaximum (maximum number)
Set the maximum value of the spin box.
Input Parameters
maximum(number)
The maximum value.
SetMinimum (minimum number)
Set the minimum value of the spin box.
Input Parameters
minimum(number)
The minimum value.
SetSingleStep (step number)
The single step size of the spin box item. When the user uses the arrows to change the spin box's value the value will be incremented/decremented by the amount of the single step. The default value is 1.0. Setting a step size value of less than 0 does nothing.
Input Parameters
step(number)
The step size.

## Static Function Details

New (label string)
Create a new spin box item.
Input Parameters
label(string)
The label next to the spin box describing the meaning of the value.
Return
FormDoubleSpinBox
The newly created spin box item.
New ()
Create a new spin box item.
Return
FormDoubleSpinBox
The newly created spin box item.