fsleyes_widgets.numberdialog¶
This module provides the NumberDialog class, a dialog which
allows the user to enter a number.
-
class
fsleyes_widgets.numberdialog.NumberDialog(parent, real=True, title=None, message=None, initial=None, minValue=None, maxValue=None, okText=None, cancelText=None)¶ Bases:
wx._core.DialogA
wx.Dialogwhich prompts the user for a number.This class differs from the
wx.NumberEntryDialogin that it supports floating point numbers.A
NumberDialogcontains awx.FloatSpinCtrland Ok/Cancel buttons, allowing the user to specify a number. If the user pushes the Ok button, the number they entered will be accessible via theGetValue()method.Create a
NumberDialog.Parameters: - parent – The
wxparent object. - real – If
True, a floating point number will be accepted. Otherwise, only integers are accepted. - title – Dialog title.
- message – If not None, a
wx.StaticTextlabel is added, containing the message. - initial – Initial value.
- minValue – Minimum value.
- maxValue – Maximum value.
- okText – Text for OK button. Defaults to “Ok”.
- cancelText – Text for Cancel button. Defaults to “Cancel”
-
__init__(parent, real=True, title=None, message=None, initial=None, minValue=None, maxValue=None, okText=None, cancelText=None)¶ Create a
NumberDialog.Parameters: - parent – The
wxparent object. - real – If
True, a floating point number will be accepted. Otherwise, only integers are accepted. - title – Dialog title.
- message – If not None, a
wx.StaticTextlabel is added, containing the message. - initial – Initial value.
- minValue – Minimum value.
- maxValue – Maximum value.
- okText – Text for OK button. Defaults to “Ok”.
- cancelText – Text for Cancel button. Defaults to “Cancel”
- parent – The
-
floatSpinCtrl¶ Returns a reference to the
FloatSpinCtrl.
-
okButton¶ Returns a reference to the ok
Button.
-
cancelButton¶ Returns a reference to the cancel
Button.
-
GetValue()¶ Return the value that the user entered.
After a valid value has been entered, and OK button pushed (or enter pressed), this method may be used to retrieve the value. Returns
Nonein all other situations.
-
_NumberDialog__onCancel(ev)¶ Called when the Cancel button is pushed. Closes the dialog.
-
_NumberDialog__onEnter(ev)¶ Called when the enter key is pressed in the
FloatSpinCtrl. Forwards the event to the__onOk()method.
-
_NumberDialog__onOk(ev)¶ Called when the Ok button is pushed. The entered value is stored and the dialog is closed. The value may be retrieved via the
GetValue()method.
-
__module__= 'fsleyes_widgets.numberdialog'¶
- parent – The