Numerical input text field.
    public class SpinBox : Range

SpinBox is a numerical input text field. It allows entering integers and floats.

Example:

[codeblock]

var spin_box = SpinBox.new()

add_child(spin_box)

var line_edit = spin_box.get_line_edit()

line_edit.context_menu_enabled = false

spin_box.align = LineEdit.ALIGN_RIGHT

[/codeblock]

The above code will create a SpinBox, disable context menu on it and set the text alignment to right.

See Range class for more options over the SpinBox.

Inheritance Chain

Constructors

    public SpinBox()

Properties

    public LineEdit.AlignEnum Align { get; set; }

Sets the text alignment of the SpinBox.

    public bool Editable { get; set; }

If true, the SpinBox will be editable. Otherwise, it will be read only.

    public string Prefix { get; set; }

Adds the specified prefix string before the numerical value of the SpinBox.

    public string Suffix { get; set; }

Adds the specified prefix string after the numerical value of the SpinBox.

Methods

    [Obsolete("GetAlign is deprecated. Use the Align property instead.")]
    public LineEdit.AlignEnum GetAlign()

Getter for Align

    public LineEdit GetLineEdit()

Returns the LineEdit instance from this SpinBox. You can use it to access properties and methods of LineEdit.

    [Obsolete("GetPrefix is deprecated. Use the Prefix property instead.")]
    public string GetPrefix()

Getter for Prefix

    [Obsolete("GetSuffix is deprecated. Use the Suffix property instead.")]
    public string GetSuffix()

Getter for Suffix

    [Obsolete("IsEditable is deprecated. Use the Editable property instead.")]
    public bool IsEditable()

Getter for Editable

    [Obsolete("SetAlign is deprecated. Use the Align property instead.")]
    public void SetAlign(LineEdit.AlignEnum align)

Setter for Align

    [Obsolete("SetEditable is deprecated. Use the Editable property instead.")]
    public void SetEditable(bool editable)

Setter for Editable

    [Obsolete("SetPrefix is deprecated. Use the Prefix property instead.")]
    public void SetPrefix(string prefix)

Setter for Prefix

    [Obsolete("SetSuffix is deprecated. Use the Suffix property instead.")]
    public void SetSuffix(string suffix)

Setter for Suffix

Tags: