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)[source]
Bases:
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.
- property lowWidget
Returns the low widget, either a
FloatSliderorFloatSpinCtrl.
- property highWidget
Returns the high widget, either a
FloatSliderorFloatSpinCtrl.
- GetDistance()[source]
Returns the minimum distance that is maintained between the low/high range values.
- SetDistance(distance)[source]
Sets the minimum distance to be maintained between the low/high range values.
- class fsleyes_widgets.rangeslider.RangeSliderSpinPanel(parent, minValue=None, maxValue=None, lowValue=None, highValue=None, minDistance=None, lowLabel=None, highLabel=None, spinWidth=None, style=None)[source]
Bases:
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. Defaults to 6. 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.
- 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
Event emitted by
RangePanelandRangeSliderSpinPanelobjects when either of their low or high values change. Contains two attributes,lowandhigh, containing the new low/high range values.
- fsleyes_widgets.rangeslider.LowRangeEvent
Event emitted by
RangePanelandRangeSliderSpinPanelobjects when their low value changes. Contains one attributes,low, containing the new low range value.
- fsleyes_widgets.rangeslider.HighRangeEvent
Event emitted by
RangePanelandRangeSliderSpinPanelobjects when their high value changes. Contains one attributes,high, containing the new high range value.
- fsleyes_widgets.rangeslider.RangeLimitEvent
Event emitted by
RangeSliderSpinPanelobjects when the user modifies the range limits. Contains two attributes,minandmax, containing the new minimum/maximum range limits.