Author: bugman Date: Fri May 11 19:08:28 2012 New Revision: 16244 URL: http://svn.gna.org/viewcvs/relax?rev=16244&view=rev Log: The can_be_none value is now propagated into the Combo_list GUI element. Modified: branches/uf_redesign/gui/components/combo_list.py branches/uf_redesign/gui/wizard_elements.py Modified: branches/uf_redesign/gui/components/combo_list.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/components/combo_list.py?rev=16244&r1=16243&r2=16244&view=diff ============================================================================== --- branches/uf_redesign/gui/components/combo_list.py (original) +++ branches/uf_redesign/gui/components/combo_list.py Fri May 11 19:08:28 2012 @@ -35,7 +35,7 @@ class Combo_list: """The combo list GUI element.""" - def __init__(self, parent, sizer, desc, value_type=None, n=1, choices=None, data=None, default=None, evt_fn=None, tooltip=None, divider=None, padding=0, spacer=None, read_only=True): + def __init__(self, parent, sizer, desc, value_type=None, n=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. @param parent: The parent GUI element. @@ -66,6 +66,8 @@ @type spacer: None or int @keyword read_only: A flag which if True means that text cannot be typed into the combo box widget. @type read_only: bool + @keyword can_be_none: A flag which specifies if the element is allowed to have the None value. + @type can_be_none: bool """ # Store some args. @@ -79,6 +81,7 @@ self._tooltip = tooltip self._padding = padding self._read_only = read_only + self._can_be_none = can_be_none # The value types. if value_type in ['float', 'num']: @@ -297,7 +300,7 @@ self._data = deepcopy(self._choices) # Handle None in combo boxes by prepending a None element to the lists. - if self.can_be_none: + if self._can_be_none: self._choices.insert(0, '') self._data.insert(0, None) Modified: branches/uf_redesign/gui/wizard_elements.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/wizard_elements.py?rev=16244&r1=16243&r2=16244&view=diff ============================================================================== --- branches/uf_redesign/gui/wizard_elements.py (original) +++ branches/uf_redesign/gui/wizard_elements.py Fri May 11 19:08:28 2012 @@ -584,7 +584,7 @@ read_only = False # Set up the Combo_list object. - self._field = Combo_list(parent, sizer, desc, value_type=value_type, n=combo_list_size, choices=combo_choices, data=combo_data, default=default, tooltip=tooltip, read_only=read_only) + self._field = Combo_list(parent, sizer, desc, value_type=value_type, n=combo_list_size, choices=combo_choices, data=combo_data, default=default, tooltip=tooltip, read_only=read_only, can_be_none=can_be_none) # Unknown field. else: