Package gui :: Package input_elements :: Module combo_list :: Class Combo_list
[hide private]
[frames] | no frames]

Class Combo_list

source code

The combo list GUI element.

Instance Methods [hide private]
 
__init__(self, parent, sizer, desc, value_type=None, n=1, min_length=1, choices=None, data=None, default=None, evt_fn=None, tooltip=None, divider=None, padding=0, spacer=None, read_only=True, can_be_none=False)
Build the combo box list widget for a list of list selections.
source code
 
_add(self, event)
Add a new combo box.
source code
 
_build_row(self, text=None)
Construct a row of the GUI element.
source code
 
_delete(self, event)
Add a new combo box.
source code
list
GetValue(self)
Return the value represented by this GUI element.
source code
 
SetValue(self, value=None, index=None)
Special method for setting the value of the GUI element.
source code
 
UpdateChoices(self, combo_choices=None, combo_data=None, combo_default=None)
Special wizard method for updating the list of choices in a ComboBox type element.
source code
Method Details [hide private]

__init__(self, parent, sizer, desc, value_type=None, n=1, min_length=1, choices=None, data=None, default=None, evt_fn=None, tooltip=None, divider=None, padding=0, spacer=None, read_only=True, can_be_none=False)
(Constructor)

source code 

Build the combo box list widget for a list of list selections.

Parameters:
  • parent (wx object instance) - The parent GUI element.
  • sizer (wx.Sizer instance) - The sizer to put the combo box widget into.
  • desc (str) - The text description.
  • value_type (str) - The type of Python object that the value should be. This can be one of 'float', 'int', or 'str'.
  • n (int) - The number of initial entries.
  • min_length (int) - The minimum length for the Combo_list object.
  • choices (list of str) - The list of choices (all combo boxes will have the same list).
  • data (list) - The data returned by a call to GetValue(). This is only used if the element_type is set to 'combo'. If supplied, it should be the same length at the choices list. If not supplied, the choices list will be used for the returned data.
  • default (str or None) - The default value of the ComboBox. This is only used if the element_type is set to 'combo'.
  • evt_fn (func) - The event handling function.
  • tooltip (str) - The tooltip which appears on hovering over the text or input field.
  • divider (None or int) - The optional position of the divider. If None, the parent class variable _div_left will be used if present.
  • padding (int) - Spacing to the left and right of the widgets.
  • spacer (None or int) - The amount of spacing to add below the field in pixels. If None, a stretchable spacer will be used.
  • read_only (bool) - A flag which if True means that text cannot be typed into the combo box widget.
  • can_be_none (bool) - A flag which specifies if the element is allowed to have the None value.

_add(self, event)

source code 

Add a new combo box.

Parameters:
  • event (wx event) - The wx event.

_build_row(self, text=None)

source code 

Construct a row of the GUI element.

Parameters:
  • text - The text description of the

_delete(self, event)

source code 

Add a new combo box.

Parameters:
  • event (wx event) - The wx event.

GetValue(self)

source code 

Return the value represented by this GUI element.

Returns: list
The list of choices.

SetValue(self, value=None, index=None)

source code 

Special method for setting the value of the GUI element.

Parameters:
  • value (value or list of values) - The value to set.
  • index (int) - The index of the value to set.

UpdateChoices(self, combo_choices=None, combo_data=None, combo_default=None)

source code 

Special wizard method for updating the list of choices in a ComboBox type element.

Parameters:
  • combo_choices (list of str) - The list of choices to present to the user. This is only used if the element_type is set to 'combo'.
  • combo_data (list) - The data returned by a call to GetValue(). This is only used if the element_type is set to 'combo'. If supplied, it should be the same length at the combo_choices list. If not supplied, the combo_choices list will be used for the returned data.
  • combo_default (str or None) - The default value of the ComboBox. This is only used if the element_type is set to 'combo'.