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
Numberproperty value.If both the
sliderandspinarguments areTrue, aSliderSpinPanelwidget is returned; otherwise aFloatSpinCtrl, orFloatSliderswidget is returned.If both
sliderandspinareFalse, aValueErroris 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
Numberproperty.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
FloatSpinCtrlclass.
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
FloatSpinCtrland binds it to the givenPropertyValueinstance.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
FloatSliderorSliderSpinPanel, and binds it to the givenPropertyValueinstance.See
_Number()for details on the parameters.