fsleyes_widgets.rangeslider¶
This module provides the RangePanel and
RangeSliderSpinPanel classes, both of which contain controls allowing
the user to modify a range.
The RangeSliderSpinPanel is a widget which contains two
RangePanel widgets - one with sliders, and one with spinboxes. All
four control widgets are linked.
-
class
fsleyes_widgets.rangeslider.RangePanel(parent, minValue=None, maxValue=None, lowValue=None, highValue=None, lowLabel=None, highLabel=None, minDistance=None, spinWidth=None, style=0)¶ Bases:
wx._core.PanelRangePanelis a widget which contains two sliders or spinboxes (eitherFloatSlider, orFloatSpinCtrl), allowing a range to be set.When the user changes the low range value to a value beyond the current high value, the high value is increased such that it remains at least a minimum value above the low value. The inverse relationship is also enforced. Whenever the user chenges the low or high range values,
EVT_LOW_RANGEorEVT_HIGH_RANGEevents are generated respectively.A situation may arise whereby a change to one limit will affect the other ( e.g. when enforcing a minimum distance between the values). When this occurs, an
EVT_RANGEevent is generated. So you may need to listen for all three types of event.The following style flags are available:
If set, the
RangePanelstores integer values, rather than floating point.If set, the user will be able to change the range values with the mouse wheel.
If set,
FloatSliderwidgets will be used to control the range values.If set, and
RP_SLIDERis not set, the user will be able to enter values into the spin controls that are beyond the current minimum/maximum range values.Create a
RangePanel.- Parameters
parent – The
wxparent object.minValue – Minimum range value.
maxValue – Maximum range value.
lowLabel – If not
None, awx.StaticTextwidget is placed to the left of the low widget, containing the given label.highLabel – If not
None, awx.StaticTextwidget is placed to the left of the high widget, containing the given label.lowValue – Initial low range value.
highValue – Initial high range value.
minDistance – Minimum distance to be maintained between low/high values.
spinWidth – Desired spin control width. See the
FloatSpinCtrlclass.style – A combination of
RP_MOUSEWHEEL,RP_INTEGER,RP_SLIDER, andRP_NO_LIMIT.
-
__init__(parent, minValue=None, maxValue=None, lowValue=None, highValue=None, lowLabel=None, highLabel=None, minDistance=None, spinWidth=None, style=0)¶ Create a
RangePanel.- Parameters
parent – The
wxparent object.minValue – Minimum range value.
maxValue – Maximum range value.
lowLabel – If not
None, awx.StaticTextwidget is placed to the left of the low widget, containing the given label.highLabel – If not
None, awx.StaticTextwidget is placed to the left of the high widget, containing the given label.lowValue – Initial low range value.
highValue – Initial high range value.
minDistance – Minimum distance to be maintained between low/high values.
spinWidth – Desired spin control width. See the
FloatSpinCtrlclass.style – A combination of
RP_MOUSEWHEEL,RP_INTEGER,RP_SLIDER, andRP_NO_LIMIT.
-
property
lowWidget¶ Returns the low widget, either a
FloatSliderorFloatSpinCtrl.
-
property
highWidget¶ Returns the high widget, either a
FloatSliderorFloatSpinCtrl.
-
GetDistance()¶ Returns the minimum distance that is maintained between the low/high range values.
-
SetDistance(distance)¶ Sets the minimum distance to be maintained between the low/high range values.
-
GetLow()¶ Returns the current low range value.
-
GetHigh()¶ Returns the current high range value.
-
SetLow(lowValue)¶ Set the current low range value
-
SetHigh(highValue)¶ Set the current high range value
-
GetRange()¶ Returns a tuple containing the current (low, high) range values.
-
SetRange(lowValue, highValue)¶ Sets the current (low, high) range values, making sure that they are at within the low/high limits, and least (min distance) apart.
-
GetLimits()¶ Returns a tuple containing the current (minimum, maximum) range limit values.
-
SetLimits(minValue, maxValue)¶ Sets the current (minimum, maximum) range limit values.
-
GetMin()¶ Returns the current minimum range value.
-
GetMax()¶ Returns the current maximum range value.
-
SetMin(minValue)¶ Sets the current minimum range value.
-
SetMax(maxValue)¶ Sets the current maximum range value.
-
_RangePanel__onHighChange(ev=None)¶ Called when the user changes the high widget.
Attempts to make sure that the low widget is at least (high value - min distance), then posts a
RangeEvent.
-
_RangePanel__onLowChange(ev=None)¶ Called when the user changes the low widget.
Attempts to make sure that the high widget is at least (low value + min distance), then posts a
RangeEvent.
-
__module__= 'fsleyes_widgets.rangeslider'¶
-
class
fsleyes_widgets.rangeslider.RangeSliderSpinPanel(parent, minValue=None, maxValue=None, lowValue=None, highValue=None, minDistance=None, lowLabel=None, highLabel=None, spinWidth=None, style=None)¶ Bases:
wx._core.PanelA
wx.Panelwhich contains two sliders and two spinboxes.The sliders and spinboxes are contained within two
RangePanelinstances respectively. One slider and spinbox pair is used to edit the low value of a range, and the other slider/spinbox used to edit the high range value. Buttons are optionally displayed on either end which display the minimum/maximum limits and, when clicked, allow the user to modify said limits.The
RangeSliderSpinPanelforwards events from theRangePanelinstances when the user edits the low/high range values, and generates aRangeLimitEventwhen the user edits the range limits.The following style flags are available:
If set, the
RangeSliderSpinPanelstores integer values, rather than floating point.If set, the user will be able to change the range values with the mouse wheel.
If set, the minimum/maximum range values are shown alongside the range controls.
If set, and
RSSP_SHOW_LIMITSis also set, the minimum/maximum range values are shown alongside the range controls on buttons.If set, the user is able to enter values into the spin controls which are outside of the current minimum/maximum.
A
RangeSliderSpinPanelwill look something like this:Create a
RangeSliderSpinPanel.- Parameters
parent – The
wxparent object.minValue – Minimum low value.
maxValue – Maximum high value.
lowValue – Initial low value.
highValue – Initial high value.
minDistance – Minimum distance to maintain between low and high values.
lowLabel – If not
None, awx.StaticTextwidget is placed to the left of the low slider, containing the label.highLabel – If not
None, awx.StaticTextwidget is placed to the left of the high slider, containing the label.spinWidth – Desired spin control width. See the
FloatSpinCtrlclass.style – A combination of
RSSP_INTEGER,RSSP_MOUSEWHEEL,RSSP_SHOW_LIMITS,RSSP_EDIT_LIMITS, andRSSP_NO_LIMIT. Defaults toRSSP_SHOW_LIMITS.
-
__init__(parent, minValue=None, maxValue=None, lowValue=None, highValue=None, minDistance=None, lowLabel=None, highLabel=None, spinWidth=None, style=None)¶ Create a
RangeSliderSpinPanel.- Parameters
parent – The
wxparent object.minValue – Minimum low value.
maxValue – Maximum high value.
lowValue – Initial low value.
highValue – Initial high value.
minDistance – Minimum distance to maintain between low and high values.
lowLabel – If not
None, awx.StaticTextwidget is placed to the left of the low slider, containing the label.highLabel – If not
None, awx.StaticTextwidget is placed to the left of the high slider, containing the label.spinWidth – Desired spin control width. See the
FloatSpinCtrlclass.style – A combination of
RSSP_INTEGER,RSSP_MOUSEWHEEL,RSSP_SHOW_LIMITS,RSSP_EDIT_LIMITS, andRSSP_NO_LIMIT. Defaults toRSSP_SHOW_LIMITS.
-
property
lowSlider¶ Returns the
FloatSliderfor the low range.
-
property
highSlider¶ Returns the
FloatSliderfor the high range.
-
property
lowSpin¶ Returns the
FloatSpinCtrlfor the low range.
-
property
highSpin¶ Returns the
FloatSpinCtrlfor the high range.
-
property
minButton¶ Returns the button to edit the lower range limit, or
NoneifRSSP_EDIT_LIMITSis not active.
-
property
maxButton¶ Returns the button to edit the upper range limit, or
NoneifRSSP_EDIT_LIMITSis not active.
-
GetDistance()¶ Returns the minimum distance between the low/high range values.
-
SetDistance(distance)¶ Sets the minimum distance between the low/high range values.
-
GetLimits()¶ Returns the minimum/maximum range values.
-
SetLimits(minValue, maxValue)¶ Sets the minimum/maximum range values.
-
SetMin(minValue)¶ Sets the minimum range value.
-
SetMax(maxValue)¶ Sets the maximum range value.
-
GetMin()¶ Returns the minimum range value.
-
GetMax()¶ Returns the maximum range value.
-
GetLow()¶ Returns the current low range value.
-
GetHigh()¶ Returns the current high range value.
-
SetLow(lowValue)¶ Sets the current low range value.
-
SetHigh(highValue)¶ Sets the current high range value.
-
GetRange()¶ Return the current (low, high) range values.
-
SetRange(lowValue, highValue)¶ Set the current low and high range values.
-
_RangeSliderSpinPanel__onLimitButton(ev)¶ Called when one of the min/max buttons is pushed. Pops up a dialog prompting the user to enter a new value, and updates the range limits accordingly. Emits a
RangeLimitEvent.
-
_RangeSliderSpinPanel__onRangeChange(ev)¶ Called when the user edits the limits on either the slider or spinboxes. Syncs the change between the sliders and spinboxes, and re-posts the event.
-
__module__= 'fsleyes_widgets.rangeslider'¶
-
fsleyes_widgets.rangeslider.RP_INTEGER= 1¶ If set, the
RangePanelstores integer values, rather than floating point.
-
fsleyes_widgets.rangeslider.RP_MOUSEWHEEL= 2¶ If set, the user will be able to change the range values with the mouse wheel.
-
fsleyes_widgets.rangeslider.RP_SLIDER= 4¶ If set,
FloatSliderwidgets will be used to control the range values. If not set,FloatSpinCtrlwidgets are used.
-
fsleyes_widgets.rangeslider.RP_NO_LIMIT= 8¶ If set, and
RP_SLIDERis not set, the user will be able to enter values into the spin controls that are beyond the current minimum/maximum range values.
-
fsleyes_widgets.rangeslider.RSSP_INTEGER= 1¶ If set, the
RangeSliderSpinPanelstores integer values, rather than floating point.
-
fsleyes_widgets.rangeslider.RSSP_MOUSEWHEEL= 2¶ If set, the user will be able to change the range values with the mouse wheel.
-
fsleyes_widgets.rangeslider.RSSP_SHOW_LIMITS= 4¶ If set, the minimum/maximum range values are shown alongside the range controls.
-
fsleyes_widgets.rangeslider.RSSP_EDIT_LIMITS= 8¶ If set, and
RSSP_SHOW_LIMITSis also set, the minimum/maximum range values are shown alongside the range controls on buttons. When the presses a button, a dialog is displayed allowing them to change the range limits.
-
fsleyes_widgets.rangeslider.RSSP_NO_LIMIT= 16¶ If set, the user is able to enter values into the spin controls which are outside of the current minimum/maximum.
-
fsleyes_widgets.rangeslider.EVT_RANGE= <wx.core.PyEventBinder object>¶ Identifier for the
RangeEvent.
-
fsleyes_widgets.rangeslider.EVT_LOW_RANGE= <wx.core.PyEventBinder object>¶ Identifier for the
LowRangeEvent.
-
fsleyes_widgets.rangeslider.EVT_HIGH_RANGE= <wx.core.PyEventBinder object>¶ Identifier for the
HighRangeEvent.
-
fsleyes_widgets.rangeslider.EVT_RANGE_LIMIT= <wx.core.PyEventBinder object>¶ Identifier for the
RangeLimitEvent.
-
fsleyes_widgets.rangeslider.RangeEvent¶ alias of
wx.lib.newevent.NewEvent.<locals>._Event
-
fsleyes_widgets.rangeslider.LowRangeEvent¶ alias of
wx.lib.newevent.NewEvent.<locals>._Event
-
fsleyes_widgets.rangeslider.HighRangeEvent¶ alias of
wx.lib.newevent.NewEvent.<locals>._Event
-
fsleyes_widgets.rangeslider.RangeLimitEvent¶ alias of
wx.lib.newevent.NewEvent.<locals>._Event
