SpinBox

package
v0.0.0-...-5fa07e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package SpinBox provides methods for working with SpinBox object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsSpinBox() Instance
}

type HorizontalAlignment

type HorizontalAlignment int
const (
	/*Horizontal left alignment, usually for text-derived classes.*/
	HorizontalAlignmentLeft HorizontalAlignment = 0
	/*Horizontal center alignment, usually for text-derived classes.*/
	HorizontalAlignmentCenter HorizontalAlignment = 1
	/*Horizontal right alignment, usually for text-derived classes.*/
	HorizontalAlignmentRight HorizontalAlignment = 2
	/*Expand row to fit width, usually for text-derived classes.*/
	HorizontalAlignmentFill HorizontalAlignment = 3
)

type Instance

type Instance [1]gdclass.SpinBox

[SpinBox] is a numerical input text field. It allows entering integers and floating-point numbers. [b]Example:[/b] [codeblocks] [gdscript] 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.horizontal_alignment = LineEdit.HORIZONTAL_ALIGNMENT_RIGHT [/gdscript] [csharp] var spinBox = new SpinBox(); AddChild(spinBox); var lineEdit = spinBox.GetLineEdit(); lineEdit.ContextMenuEnabled = false; spinBox.AlignHorizontal = LineEdit.HorizontalAlignEnum.Right; [/csharp] [/codeblocks] 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]. [b]Note:[/b] With the [SpinBox]'s context menu disabled, you can right-click the bottom half of the spinbox to set the value to its minimum, while right-clicking the top half sets the value to its maximum. [b]Note:[/b] [SpinBox] relies on an underlying [LineEdit] node. To theme a [SpinBox]'s background, add theme items for [LineEdit] and customize them. [b]Note:[/b] If you want to implement drag and drop for the underlying [LineEdit], you can use [method Control.set_drag_forwarding] on the node returned by [method get_line_edit].

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) Alignment

func (self Instance) Alignment() HorizontalAlignment

func (Instance) Apply

func (self Instance) Apply()

Applies the current value of this [SpinBox].

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRange

func (self Instance) AsRange() Range.Instance

func (Instance) AsSpinBox

func (self Instance) AsSpinBox() Instance

func (Instance) CustomArrowStep

func (self Instance) CustomArrowStep() Float.X

func (Instance) Editable

func (self Instance) Editable() bool

func (Instance) GetLineEdit

func (self Instance) GetLineEdit() [1]gdclass.LineEdit

Returns the [LineEdit] instance from this [SpinBox]. You can use it to access properties and methods of [LineEdit]. [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.

func (Instance) Prefix

func (self Instance) Prefix() string

func (Instance) SelectAllOnFocus

func (self Instance) SelectAllOnFocus() bool

func (Instance) SetAlignment

func (self Instance) SetAlignment(value HorizontalAlignment)

func (Instance) SetCustomArrowStep

func (self Instance) SetCustomArrowStep(value Float.X)

func (Instance) SetEditable

func (self Instance) SetEditable(value bool)

func (Instance) SetPrefix

func (self Instance) SetPrefix(value string)

func (Instance) SetSelectAllOnFocus

func (self Instance) SetSelectAllOnFocus(value bool)

func (Instance) SetSuffix

func (self Instance) SetSuffix(value string)

func (Instance) SetUpdateOnTextChanged

func (self Instance) SetUpdateOnTextChanged(value bool)

func (Instance) Suffix

func (self Instance) Suffix() string

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) UpdateOnTextChanged

func (self Instance) UpdateOnTextChanged() bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL