10.7.2. Class cerebro.gui.InputDialog

class cerebro.gui.InputDialog(type, title, label='', storeKey='')[source]
Parameters:
  • type (int) – type of the input value.
  • title (string) – dialog title.
  • label (string) – text label.
  • store_key (string) – key to restore the last of the values entered.

Input dialog class.

Methods

_images/capi_gui_input.png
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.

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

set_items().

max()[source]
Returns:maximal input value.

Applicable for the cerebro.gui.InputDialog.TYPE_FLOAT and cerebro.gui.InputDialog.TYPE_INT types only.

See also

set_range().

min()[source]
Returns:minimal input value.

Applicable for the cerebro.gui.InputDialog.TYPE_FLOAT and cerebro.gui.InputDialog.TYPE_INT types only.

See also

set_range().

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

display_format().

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

items().

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 and cerebro.gui.InputDialog.TYPE_INT types only.

See also

max(), min().

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

value().

type()[source]
Returns:type of input value.
Return type:int
value()[source]
Returns:value entered by user.

Type of input argument is defined by type of input dialog.

See also

set_value().