10.7.2. Class cerebro.gui.InputDialog¶
-
class
cerebro.gui.
InputDialog
(type, title, label='', storeKey='')[source]¶ Parameters: Input dialog class.
Methods
display_format()
execute()
items()
max()
min()
set_display_format()
set_items()
set_range()
set_value()
type()
value()
dinput = cerebro.gui.input_dialog(cerebro.gui.InputDialog.TYPE_INT, 'Sample input', 'Enter') dinput.set_range(-100, 100) dinput.set_value(10) res = dinput.execute() if res == True: print('Entered value:', dinput.value())
-
display_format
()[source]¶ Returns: The format used to display the time/date of the date time edit. Applicable for the
cerebro.gui.InputDialog.TYPE_DATETIME
type only.See also
-
execute
()[source]¶ Returns: True, if user entered a value and pressed “Ok” button. Return type: bool Displays dialog window.
-
items
()[source]¶ Returns: list of items to select from. Return type: list(string,) Applicable for the
cerebro.gui.InputDialog.TYPE_COMBOBOX
type only.See also
-
max
()[source]¶ Returns: maximal input value. Applicable for the
cerebro.gui.InputDialog.TYPE_FLOAT
andcerebro.gui.InputDialog.TYPE_INT
types only.See also
-
min
()[source]¶ Returns: minimal input value. Applicable for the
cerebro.gui.InputDialog.TYPE_FLOAT
andcerebro.gui.InputDialog.TYPE_INT
types only.See also
-
set_display_format
(format)[source]¶ Parameters: format (string) – The format used to display the time/date of the date time edit. Sets the format used to display the time/date as a string.
For example:
dinput.set_display_format('yyyy.MM.dd hh:mm") # for example: 2014.01.01 13:09
Applicable for the
cerebro.gui.InputDialog.TYPE_DATETIME
type only.See also
-
set_items
(items)[source]¶ Parameters: items (list(string,)) – list of items to select from. Sets list of items to select from.
Applicable for the
cerebro.gui.InputDialog.TYPE_COMBOBOX
type only.See also
-
set_range
(min, max)[source]¶ Parameters: - min – minimal input value.
- max – maximal input value.
Sets minimal and maximal input values.
Applicable for the
cerebro.gui.InputDialog.TYPE_FLOAT
andcerebro.gui.InputDialog.TYPE_INT
types only.
-
set_value
(val)[source]¶ Parameters: val – default value. Sets value in input dialog.
Type of input argument is defined by
type of input dialog
.See also