fsleyes_props.widgets_number
¶
This module provides the _Number()
function, which is imported into
the widgets
module namespace. It is separated purely to keep the
widgets
module file size down.
-
fsleyes_props.widgets_number.
_Number
(parent, hasProps, propObj, propVal, slider=True, spin=True, showLimits=True, editLimits=True, mousewheel=False, increment=None, spinWidth=None, **kwargs)¶ Creates and returns a widget allowing the user to edit the given
Number
property value.If both the
slider
andspin
arguments areTrue
, aSliderSpinPanel
widget is returned; otherwise aFloatSpinCtrl
, orFloatSliders
widget is returned.If both
slider
andspin
areFalse
, aValueError
is raised.- Parameters
slider – Display slider widgets allowing the user to control the bound values.
spin – Display spin control widgets allowing the user to control the bound values.
showLimits – Show labels displaying the min/max values, if thye are set on the
Number
property.editLimits – Allow the user to edit the min/max values.
mousewheel – If
True
, mouse wheel events on the spin/slider control(s) will change the value.increment – If
spin=True
, the increment/step size to be used when increasing/decreasing the value. If not provided, a suitable increment is calculated.spinWidth – Desired spin control width in characters. See the
FloatSpinCtrl
class.
See the
widgets._String()
documentation for details on the parameters.
-
fsleyes_props.widgets_number.
_makeSpinBox
(parent, hasProps, propObj, propVal, mousewheel, increment, spinWidth)¶ Used by the
_Number()
function.Creates a
FloatSpinCtrl
and binds it to the givenPropertyValue
instance.See
_Number()
for details on the parameters.
-
fsleyes_props.widgets_number.
_makeSlider
(parent, hasProps, propObj, propVal, showSpin, showLimits, editLimits, mousewheel, spinWidth)¶ Used by the
_Number()
function.Creates and returns a
FloatSlider
orSliderSpinPanel
, and binds it to the givenPropertyValue
instance.See
_Number()
for details on the parameters.