fsleyes_props.widgets_bounds
¶
This module provides the _Bounds()
function, which is imported into
the widgets
module namespace. It is separated purely to keep the
widgets
module file size down.
-
fsleyes_props.widgets_bounds.
_Bounds
(parent, hasProps, propObj, propVal, slider=True, spin=True, showLimits=True, editLimits=True, mousewheel=False, labels=None, spinWidth=None, **kwargs)¶ Creates and returns a panel containing sliders/spinboxes which allow the user to edit the low/high values along each dimension of the given
Bounds
property value.If both the
slider
andspin
arguments areTrue
, aRangeSliderSpinPanel
widget is returned; otherwise aRangePanel
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 the bound limits.
editLimits – Add buttons allowing the user to edit the bound limits.
mousewheel – If
True
, mouse wheel events over the slider/spin controls will change the bounds values.labels – A list of strings of length
2 * ndims
, wherendims
is the number of dimensions on theBounds
property; the strings are used as labels on the widget.spinWidth – Desired spin control width. See the
FloatSpinCtrl
class.
See the
widgets._String()
documentation for details on the other parameters.
-
fsleyes_props.widgets_bounds.
_boundBind
(hasProps, propObj, sliderPanel, propVal, axis, editLimits)¶ Called by the
_Bounds()
function.Binds the given
RangeSliderSpinPanel
orRangePanel
to one axis of the givenBoundsValueList
so that changes in one are propagated to the other.- Parameters
sliderPanel – The
RangeSliderSpinPanel
/RangePanel
instance.axis – The 0-indexed axis of the
Bounds
value.
See
_Bounds()
for details on the other arguments.