Package gui :: Package input_elements :: Module sequence_2D :: Class Sequence_2D
[hide private]
[frames] | no frames]

Class Sequence_2D

source code


Wizard GUI element for the input of all types of 2D Python sequence objects.

The supported Python types include:

Instance Methods [hide private]
 
__init__(self, name=None, default=None, parent=None, sizer=None, element_type='default', seq_type=None, value_type=None, dim=None, min=0, max=1000, titles=None, desc=None, combo_choices=None, combo_data=None, combo_list_min=None, tooltip=None, divider=None, padding=0, spacer=None, height_element=27, read_only=False, can_be_none=False)
Set up the element.
source code
 
open_dialog(self, event)
Open a special dialog for inputting a list of text values.
source code
 
selection_win_show(self)
Show the selection window.
source code

Inherited from sequence.Sequence: Clear, GetValue, SetValue, UpdateChoices, selection_win_data

Method Details [hide private]

__init__(self, name=None, default=None, parent=None, sizer=None, element_type='default', seq_type=None, value_type=None, dim=None, min=0, max=1000, titles=None, desc=None, combo_choices=None, combo_data=None, combo_list_min=None, tooltip=None, divider=None, padding=0, spacer=None, height_element=27, read_only=False, can_be_none=False)
(Constructor)

source code 

Set up the element.

Parameters:
  • name (str) - The name of the element to use in titles, etc.
  • default (2D sequence object) - The default value of the element.
  • parent (wx.Panel instance) - The wizard GUI element.
  • sizer (wx.Sizer instance) - The sizer to put the input field widget into.
  • element_type (str) - The type of GUI element to create. If set to 'default', the wx.TextCtrl element with a button to bring up a dialog with ListCtrl will be used. If set to 'combo_list', the special gui.components.combo_list.Combo_list element will be used.
  • seq_type (str) - The type of Python sequence. This should be one of 'list' or 'tuple'.
  • value_type (str) - The type of Python object that the value should be. This can be one of 'float', 'int', or 'str'.
  • dim (int, tuple of int or None) - The dimensions that a list or tuple must conform to. For a 1D sequence, this can be a single value or a tuple of possible sizes. For a 2D sequence (a numpy matrix or list of lists), this must be a tuple of the fixed dimension sizes, e.g. a 3x5 matrix should be specified as (3, 5).
  • min (int) - For a SpinCtrl, the minimum value allowed.
  • max (int) - For a SpinCtrl, the maximum value allowed.
  • titles (list of str) - The titles of each of the elements of the fixed width second dimension.
  • desc (str) - The text description.
  • 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_list_min (int or None) - The minimum length for the Combo_list object.
  • 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 class variable _div_left will be used.
  • 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.
  • height_element (int) - The height in pixels of the GUI element.
  • read_only (bool) - A flag which if True means that the text of the element cannot be edited.
  • can_be_none (bool) - A flag which specifies if the element is allowed to have the None value.
Overrides: sequence.Sequence.__init__

open_dialog(self, event)

source code 

Open a special dialog for inputting a list of text values.

Parameters:
  • event (wx event) - The wx event.
Overrides: sequence.Sequence.open_dialog

selection_win_show(self)

source code 

Show the selection window.

Overrides: sequence.Sequence.selection_win_show