-
Notifications
You must be signed in to change notification settings - Fork 3
2.4 DirectSpinBox
Number entry with buttons to raise and lower the value. This widget also supports changing the value by entering a text directly or scrolling with the mouse-wheel.
spinBox = DirectSpinBox(scale=0.1, valueEntry_width=10, borderWidth=(2,2), frameColor=(1,0,0,1))Note, the spin box has three sub elements, valueEntry, incButton and decButton which can be configured by passing parameters such as for example valueEntry_SomeOption. valueEntry is of type DirectEntry and can accept any of those parameters and inc/decButton are of type DirectButton and will accept those parameters respectively
value: value of type valueType
The start value of the spin box
textFormat: String format value
A format string which will be used to convert the value in a string
Default is: '{:0d}'
stepSize: value of type valueType
A value that will be added to the current spin box value to raise or lower it.
minValue: value of type valueType
The minimum value that can be entered in the value box
maxValue: value of type valueType
The maximum value that can be entered in the value box
valueType: value formatter
A type to be used to format the values given to the spin box.
Default is: int
repeatdelay: float
delay in seconds at which the increase or decrease function should be called when holding down one of the spinners buttons
repeatStartdelay: float
The delay which should be awaited until the repeat task kicks in.
command: function pointer
The command which should be called when the user presses enter in the textfield part of the spinner.
extraArgs: list
Extra arguments passed to the command function call
incButtonCallback: function pointer
A callback function which will be called on every increment done on the spinner (e.g. when the up button is clicked)
decButtonCallback: function pointer
A callback function which will be called on every decrement done on the spinner (e.g. when the down button is clicked)
buttonOrientation: One of DirectGuiGlobal.VERTICAL, HORIZONTAL
The Orientation of the buttons of the spinner. If Vertical, the buttons will be put on the right side of the spinner on top of each other. If set to Horizontal, the buttons will be placed left and right next to the textbox.
doStep(stepSize)
Changes the value in the spin box according to the given step size.
get
Returns the value in string format (see getValue to get the value in it's specific type)
getValue
Returns the value in it's actual type (see get to get the value as a string)
setValue(newValue)
Set a new value for the spinbox to display. newValue can be any type which can be converted by the function set in valueType