reckfellENGINE

SpinBox

Numeric field with expressions and increment buttons.

On this page
class SpinBoxReckfellSharpInherits Range

SpinBox combines Range, an internal LineEdit and increment buttons. Defaults are Step = 1, Editable = true and UpdateOnTextChanged = false; additional format and arrow-step settings are off. Set an appropriate Step for fractional values.

GetLineEdit returns a SpinBox-owned internal Control: configure it without freeing or reparenting it. Assigning LineEdit.Text in code neither assigns Value nor emits TextChanged. Call Apply to commit that text. For example, 2 + 3 * 4 produces Value = 14; Range then snaps and bounds the result. Empty or syntactically invalid input does not replace the previous number.

UpdateOnTextChanged connects deferred processing of the internal field’s signal. It does not turn the Text setter into automatic numeric input. Intermediate expressions can update Value before editing finishes; avoid attaching expensive work to every entered digit unnecessarily.

Format controls display outside active editing. Use a template with one value: %s kg uses standard Step-aware text; %.2f kg displays two decimal places without changing Value precision. This is the engine’s sprintf format rather than C# string.Format. Invalid templates can display <Invalid>. Deprecated Prefix/Suffix only apply when Format is empty.

FormatAutoTranslateMode defaults to Disabled. For translated units, set Format, optionally PluralFormat and enable an appropriate translation mode; PluralFormat alone does not create localization.

CustomArrowStep = 0 uses Step; a nonzero value changes button increments rather than Range snapping. CustomArrowRound aligns transitions to the arrow-step grid; choose a multiple of Step or an increment may fail to change the number. Editable = false blocks user editing rather than programmatic Value writes or Apply.

Range.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

SpinBoxConstructor
# SpinBox
C#
public SpinBox();

Creates a numeric field with an internal LineEdit and button timer. Step = 1, Editable = true, UpdateOnTextChanged = false; Format is empty.

Properties11

AlignmentProperty
# Alignment
C#
public HorizontalAlignment Alignment { get; set; }

Horizontal text alignment of the internal LineEdit, default Left. Does not move SpinBox within its parent layout.

CustomArrowRoundProperty
# CustomArrowRound
C#
public bool CustomArrowRound { get; set; }

Aligns button transitions to the CustomArrowStep grid rather than simply adding/subtracting, default false. Arrow increment must be compatible with Step or a transition can leave Value unchanged.

CustomArrowStepProperty
# CustomArrowStep
C#
public double CustomArrowStep { get; set; }

Button increment: 0 uses Step; nonzero uses a custom increment. Does not replace Range snapping, so choose a compatible increment. Does not recalculate current Value.

EditableProperty
# Editable
C#
public bool Editable { get; set; }

Allows user editing through the internal LineEdit and buttons, default true. Does not block programmatic Value or Apply.

FormatProperty
# Format
C#
public string Format { get; set; }

Single-value sprintf template for display outside editing. %s uses standard Step-aware text; %.2f displays two decimal places. Does not change Value; takes precedence over Prefix/Suffix. Invalid templates can display <Invalid>.

FormatAutoTranslateModeProperty
# FormatAutoTranslateMode
C#
public Entity.AutoTranslateModeEnum FormatAutoTranslateMode { get; set; }

Automatic Format/PluralFormat translation: default Disabled, Always forces translation, Inherit respects entity translation. Does not itself add catalog translations.

PluralFormatProperty
# PluralFormat
C#
public string PluralFormat { get; set; }

Plural-form template for Format translation. Requires nonempty Format and translation enabled through FormatAutoTranslateMode; selection uses Value and the translation catalog.

PrefixProperty · Deprecated
# Prefix
C#
public string Prefix { get; set; }

Deprecated display prefix separated from the number by a space. Applies only with empty Format outside editing. Use Format for new code.

SelectAllOnFocusProperty
# SelectAllOnFocus
C#
public bool SelectAllOnFocus { get; set; }

Select all text on focus, default false. Delegated to the internal LineEdit; toggling the setting does not request focus.

SuffixProperty · Deprecated
# Suffix
C#
public string Suffix { get; set; }

Deprecated display suffix separated from the number by a space. Applies only with empty Format outside editing. Not part of numeric Value.

UpdateOnTextChangedProperty
# UpdateOnTextChanged
C#
public bool UpdateOnTextChanged { get; set; }

Apply expressions through a deferred connection to the internal field’s TextChanged, default false. Programmatic LineEdit.Text writes do not emit that signal; use Apply.

Methods24

Applyvoid
# Apply
C#
public void Apply();

Parses current internal LineEdit text as a numeric expression and assigns the result to Value. Empty or syntactically invalid text preserves the previous number. Call after programmatic Text assignment; there is no Error/bool result.

GetCustomArrowStepdouble
# GetCustomArrowStep
C#
public double GetCustomArrowStep();

Button increment: 0 uses Step; nonzero uses a custom increment. Does not replace Range snapping, so choose a compatible increment. Does not recalculate current Value.

Returns double

Current setting rather than confirmation of input or visual validation.

GetFormatstring
# GetFormat
C#
public string GetFormat();

Single-value sprintf template for display outside editing. %s uses standard Step-aware text; %.2f displays two decimal places. Does not change Value; takes precedence over Prefix/Suffix. Invalid templates can display <Invalid>.

Returns string

Current setting rather than confirmation of input or visual validation.

GetFormatAutoTranslateModeEntity.AutoTranslateModeEnum
# GetFormatAutoTranslateMode
C#
public Entity.AutoTranslateModeEnum GetFormatAutoTranslateMode();

Automatic Format/PluralFormat translation: default Disabled, Always forces translation, Inherit respects entity translation. Does not itself add catalog translations.

Returns Entity.AutoTranslateModeEnum

Current setting rather than confirmation of input or visual validation.

GetHorizontalAlignmentHorizontalAlignment
# GetHorizontalAlignment
C#
public HorizontalAlignment GetHorizontalAlignment();

Horizontal text alignment of the internal LineEdit, default Left. Does not move SpinBox within its parent layout.

Returns HorizontalAlignment

Current setting rather than confirmation of input or visual validation.

GetLineEditLineEdit
# GetLineEdit
C#
public LineEdit GetLineEdit();

Returns the shared internal LineEdit owned by SpinBox. Do not free or reparent it. Text is editing text rather than guaranteed Value; use Apply for programmatic commitment.

Returns LineEdit

Shared LineEdit owned by SpinBox; do not free separately.

GetPluralFormatstring
# GetPluralFormat
C#
public string GetPluralFormat();

Plural-form template for Format translation. Requires nonempty Format and translation enabled through FormatAutoTranslateMode; selection uses Value and the translation catalog.

Returns string

Current setting rather than confirmation of input or visual validation.

GetPrefixstring
# GetPrefix
C#
public string GetPrefix();

Deprecated display prefix separated from the number by a space. Applies only with empty Format outside editing. Use Format for new code.

Returns string

Current setting rather than confirmation of input or visual validation.

GetSuffixstring
# GetSuffix
C#
public string GetSuffix();

Deprecated display suffix separated from the number by a space. Applies only with empty Format outside editing. Not part of numeric Value.

Returns string

Current setting rather than confirmation of input or visual validation.

GetUpdateOnTextChangedbool
# GetUpdateOnTextChanged
C#
public bool GetUpdateOnTextChanged();

Apply expressions through a deferred connection to the internal field’s TextChanged, default false. Programmatic LineEdit.Text writes do not emit that signal; use Apply.

Returns bool

Current setting rather than confirmation of input or visual validation.

IsCustomArrowRoundingbool
# IsCustomArrowRounding
C#
public bool IsCustomArrowRounding();

Aligns button transitions to the CustomArrowStep grid rather than simply adding/subtracting, default false. Arrow increment must be compatible with Step or a transition can leave Value unchanged.

Returns bool

Current setting rather than confirmation of input or visual validation.

IsEditablebool
# IsEditable
C#
public bool IsEditable();

Allows user editing through the internal LineEdit and buttons, default true. Does not block programmatic Value or Apply.

Returns bool

Current setting rather than confirmation of input or visual validation.

IsSelectAllOnFocusbool
# IsSelectAllOnFocus
C#
public bool IsSelectAllOnFocus();

Select all text on focus, default false. Delegated to the internal LineEdit; toggling the setting does not request focus.

Returns bool

Current setting rather than confirmation of input or visual validation.

SetCustomArrowRoundvoid
# SetCustomArrowRound
C#
public void SetCustomArrowRound(bool round);

Aligns button transitions to the CustomArrowStep grid rather than simply adding/subtracting, default false. Arrow increment must be compatible with Step or a transition can leave Value unchanged.

Parameters
NameTypeDefault
roundbool—
round

Aligns button transitions to the CustomArrowStep grid rather than simply adding/subtracting, default false. Arrow increment must be compatible with Step or a transition can leave Value unchanged.

SetCustomArrowStepvoid
# SetCustomArrowStep
C#
public void SetCustomArrowStep(double arrowStep);

Button increment: 0 uses Step; nonzero uses a custom increment. Does not replace Range snapping, so choose a compatible increment. Does not recalculate current Value.

Parameters
NameTypeDefault
arrowStepdouble—
arrowStep

Button increment: 0 uses Step; nonzero uses a custom increment. Does not replace Range snapping, so choose a compatible increment. Does not recalculate current Value.

SetEditablevoid
# SetEditable
C#
public void SetEditable(bool enabled);

Allows user editing through the internal LineEdit and buttons, default true. Does not block programmatic Value or Apply.

Parameters
NameTypeDefault
enabledbool—
enabled

Allows user editing through the internal LineEdit and buttons, default true. Does not block programmatic Value or Apply.

SetFormatvoid
# SetFormat
C#
public void SetFormat(string format);

Single-value sprintf template for display outside editing. %s uses standard Step-aware text; %.2f displays two decimal places. Does not change Value; takes precedence over Prefix/Suffix. Invalid templates can display <Invalid>.

Parameters
NameTypeDefault
formatstring—
format

Single-value sprintf template for display outside editing. %s uses standard Step-aware text; %.2f displays two decimal places. Does not change Value; takes precedence over Prefix/Suffix. Invalid templates can display <Invalid>.

SetFormatAutoTranslateModevoid
# SetFormatAutoTranslateMode
C#
public void SetFormatAutoTranslateMode(Entity.AutoTranslateModeEnum mode);

Automatic Format/PluralFormat translation: default Disabled, Always forces translation, Inherit respects entity translation. Does not itself add catalog translations.

Parameters
NameTypeDefault
modeEntity.AutoTranslateModeEnum—
mode

Automatic Format/PluralFormat translation: default Disabled, Always forces translation, Inherit respects entity translation. Does not itself add catalog translations.

SetHorizontalAlignmentvoid
# SetHorizontalAlignment
C#
public void SetHorizontalAlignment(HorizontalAlignment alignment);

Horizontal text alignment of the internal LineEdit, default Left. Does not move SpinBox within its parent layout.

Parameters
NameTypeDefault
alignmentHorizontalAlignment—
alignment

Horizontal text alignment of the internal LineEdit, default Left. Does not move SpinBox within its parent layout.

SetPluralFormatvoid
# SetPluralFormat
C#
public void SetPluralFormat(string format);

Plural-form template for Format translation. Requires nonempty Format and translation enabled through FormatAutoTranslateMode; selection uses Value and the translation catalog.

Parameters
NameTypeDefault
formatstring—
format

Plural-form template for Format translation. Requires nonempty Format and translation enabled through FormatAutoTranslateMode; selection uses Value and the translation catalog.

SetPrefixvoid
# SetPrefix
C#
public void SetPrefix(string prefix);

Deprecated display prefix separated from the number by a space. Applies only with empty Format outside editing. Use Format for new code.

Parameters
NameTypeDefault
prefixstring—
prefix

Deprecated display prefix separated from the number by a space. Applies only with empty Format outside editing. Use Format for new code.

SetSelectAllOnFocusvoid
# SetSelectAllOnFocus
C#
public void SetSelectAllOnFocus(bool enabled);

Select all text on focus, default false. Delegated to the internal LineEdit; toggling the setting does not request focus.

Parameters
NameTypeDefault
enabledbool—
enabled

Select all text on focus, default false. Delegated to the internal LineEdit; toggling the setting does not request focus.

SetSuffixvoid
# SetSuffix
C#
public void SetSuffix(string suffix);

Deprecated display suffix separated from the number by a space. Applies only with empty Format outside editing. Not part of numeric Value.

Parameters
NameTypeDefault
suffixstring—
suffix

Deprecated display suffix separated from the number by a space. Applies only with empty Format outside editing. Not part of numeric Value.

SetUpdateOnTextChangedvoid
# SetUpdateOnTextChanged
C#
public void SetUpdateOnTextChanged(bool enabled);

Apply expressions through a deferred connection to the internal field’s TextChanged, default false. Programmatic LineEdit.Text writes do not emit that signal; use Apply.

Parameters
NameTypeDefault
enabledbool—
enabled

Apply expressions through a deferred connection to the internal field’s TextChanged, default false. Programmatic LineEdit.Text writes do not emit that signal; use Apply.

Theme properties

These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.

Key and typeDescription
down_disabled_icon_modulate
Color

Down button icon modulation color, when the button is disabled.

Default: Color(0.875, 0.875, 0.875, 0.5)
down_hover_icon_modulate
Color

Down button icon modulation color, when the button is hovered.

Default: Color(0.95, 0.95, 0.95, 1)
down_icon_modulate
Color

Down button icon modulation color.

Default: Color(0.875, 0.875, 0.875, 1)
down_pressed_icon_modulate
Color

Down button icon modulation color, when the button is being pressed.

Default: Color(0.95, 0.95, 0.95, 1)
up_disabled_icon_modulate
Color

Up button icon modulation color, when the button is disabled.

Default: Color(0.875, 0.875, 0.875, 0.5)
up_hover_icon_modulate
Color

Up button icon modulation color, when the button is hovered.

Default: Color(0.95, 0.95, 0.95, 1)
up_icon_modulate
Color

Up button icon modulation color.

Default: Color(0.875, 0.875, 0.875, 1)
up_pressed_icon_modulate
Color

Up button icon modulation color, when the button is being pressed.

Default: Color(0.95, 0.95, 0.95, 1)
buttons_vertical_separation
int

Vertical separation between the up and down buttons.

Default: 0
buttons_width
int

Width of the up and down buttons. If smaller than any icon set on the buttons, the respective icon may overlap neighboring elements. If smaller than 0, the width is automatically adjusted from the icon size.

Default: 16
field_and_buttons_separation
int

Width of the horizontal separation between the text input field (LineEdit) and the buttons.

Default: 2
icon_max_width
int

The maximum allowed width of the SpinBox's up and down icons. The height is adjusted according to the icon's ratio.

Default: 0
set_min_buttons_width_from_icons
int

If not 0, the minimum button width corresponds to the widest of all icons set on those buttons, even if SpinBox.buttons_width is smaller.

Default: 1
down
Texture2D

Down button icon, displayed in the middle of the down (value-decreasing) button.

down_disabled
Texture2D

Down button icon when the button is disabled.

down_hover
Texture2D

Down button icon when the button is hovered.

down_pressed
Texture2D

Down button icon when the button is being pressed.

up
Texture2D

Up button icon, displayed in the middle of the up (value-increasing) button.

up_disabled
Texture2D

Up button icon when the button is disabled.

up_hover
Texture2D

Up button icon when the button is hovered.

up_pressed
Texture2D

Up button icon when the button is being pressed.

updown
Texture2D

Single texture representing both the up and down buttons icons. It is displayed in the middle of the buttons and does not change upon interaction. If a valid icon is assigned, it will replace SpinBox.up and SpinBox.down.

focus_sound
AudioStream

Played when this SpinBox receives keyboard or gamepad-induced focus. Mouse or touch-induced focus does not play a focus sound.

pressed_disabled_sound
AudioStream

Played when the up or down button is pressed while the SpinBox is disabled due to SpinBox.Editable being false.

pressed_sound
AudioStream

Played when the up or down button is pressed.

down_background
StyleBox

Background style of the down button.

down_background_disabled
StyleBox

Background style of the down button when disabled.

down_background_hovered
StyleBox

Background style of the down button when hovered.

down_background_pressed
StyleBox

Background style of the down button when being pressed.

field_and_buttons_separator
StyleBox

StyleBox drawn in the space occupied by the separation between the input field and the buttons.

up_background
StyleBox

Background style of the up button.

up_background_disabled
StyleBox

Background style of the up button when disabled.

up_background_hovered
StyleBox

Background style of the up button when hovered.

up_background_pressed
StyleBox

Background style of the up button when being pressed.

up_down_buttons_separator
StyleBox

StyleBox drawn in the space occupied by the separation between the up and down buttons.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.