Documentation
¶
Overview ¶
Package SpinBox provides methods for working with SpinBox object instances.
Index ¶
- type Advanced
- type Any
- type HorizontalAlignment
- type Instance
- func (self Instance) Alignment() HorizontalAlignment
- func (self Instance) Apply()
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRange() Range.Instance
- func (self Instance) AsSpinBox() Instance
- func (self Instance) CustomArrowStep() Float.X
- func (self Instance) Editable() bool
- func (self Instance) GetLineEdit() [1]gdclass.LineEdit
- func (self Instance) Prefix() string
- func (self Instance) SelectAllOnFocus() bool
- func (self Instance) SetAlignment(value HorizontalAlignment)
- func (self Instance) SetCustomArrowStep(value Float.X)
- func (self Instance) SetEditable(value bool)
- func (self Instance) SetPrefix(value string)
- func (self Instance) SetSelectAllOnFocus(value bool)
- func (self Instance) SetSuffix(value string)
- func (self Instance) SetUpdateOnTextChanged(value bool)
- func (self Instance) Suffix() string
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) UpdateOnTextChanged() bool
- func (self Instance) Virtual(name string) reflect.Value
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 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 ¶
[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 (Instance) Alignment ¶
func (self Instance) Alignment() HorizontalAlignment
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) CustomArrowStep ¶
func (Instance) GetLineEdit ¶
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) SelectAllOnFocus ¶
func (Instance) SetAlignment ¶
func (self Instance) SetAlignment(value HorizontalAlignment)