Author: bugman Date: Thu May 10 14:22:20 2012 New Revision: 16187 URL: http://svn.gna.org/viewcvs/relax?rev=16187&view=rev Log: Improved the titles of the Sequence and Sequence_2D GUI element for the user functions. The 'desc_short' user function arg property is now used to create the title rather than the 'name' value. Modified: branches/uf_redesign/gui/uf_objects.py branches/uf_redesign/gui/wizard.py branches/uf_redesign/gui/wizard_elements.py Modified: branches/uf_redesign/gui/uf_objects.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/uf_objects.py?rev=16187&r1=16186&r2=16187&view=diff ============================================================================== --- branches/uf_redesign/gui/uf_objects.py (original) +++ branches/uf_redesign/gui/uf_objects.py Thu May 10 14:22:20 2012 @@ -251,7 +251,7 @@ if isinstance(arg['dim'], int): dim = arg['dim'] - self.element_sequence(key=arg['name'], default=arg['default'], element_type=arg['wiz_element_type'], seq_type=seq_type, value_type=value_type, dim=dim, min=arg['min'], max=arg['max'], sizer=sizer, desc=desc, combo_choices=arg['wiz_combo_choices'], combo_data=arg['wiz_combo_data'], combo_list_size=arg['wiz_combo_list_size'], tooltip=arg['desc'], single_value=single_value, read_only=arg['wiz_read_only'], can_be_none=arg['can_be_none']) + self.element_sequence(key=arg['name'], default=arg['default'], element_type=arg['wiz_element_type'], seq_type=seq_type, value_type=value_type, dim=dim, min=arg['min'], max=arg['max'], sizer=sizer, desc=desc, desc_short=arg['desc_short'], combo_choices=arg['wiz_combo_choices'], combo_data=arg['wiz_combo_data'], combo_list_size=arg['wiz_combo_list_size'], tooltip=arg['desc'], single_value=single_value, read_only=arg['wiz_read_only'], can_be_none=arg['can_be_none']) # 2D sequence types. elif arg['py_type'] in ['float_list_of_lists', 'int_list_of_lists', 'num_list_of_lists', 'str_list_of_lists', 'float_tuple_of_tuples', 'int_tuple_of_tuples', 'num_tuple_of_tuples', 'str_tuple_of_tuples']: @@ -269,7 +269,7 @@ else: value_type = 'str' - self.element_sequence_2D(key=arg['name'], default=arg['default'], sizer=sizer, element_type=arg['wiz_element_type'], seq_type=seq_type, value_type=value_type, dim=arg['dim'], min=arg['min'], max=arg['max'], titles=arg['list_titles'], desc=desc, combo_choices=arg['wiz_combo_choices'], combo_data=arg['wiz_combo_data'], combo_list_size=arg['wiz_combo_list_size'], tooltip=arg['desc'], read_only=arg['wiz_read_only'], can_be_none=arg['can_be_none']) + self.element_sequence_2D(key=arg['name'], default=arg['default'], sizer=sizer, element_type=arg['wiz_element_type'], seq_type=seq_type, value_type=value_type, dim=arg['dim'], min=arg['min'], max=arg['max'], titles=arg['list_titles'], desc=desc, desc_short=arg['desc_short'], combo_choices=arg['wiz_combo_choices'], combo_data=arg['wiz_combo_data'], combo_list_size=arg['wiz_combo_list_size'], tooltip=arg['desc'], read_only=arg['wiz_read_only'], can_be_none=arg['can_be_none']) # Unknown type. else: Modified: branches/uf_redesign/gui/wizard.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/wizard.py?rev=16187&r1=16186&r2=16187&view=diff ============================================================================== --- branches/uf_redesign/gui/wizard.py (original) +++ branches/uf_redesign/gui/wizard.py Thu May 10 14:22:20 2012 @@ -683,7 +683,7 @@ self._elements[key] = element - def element_sequence(self, key=None, default=None, sizer=None, element_type='default', seq_type=None, value_type=None, dim=None, min=None, max=None, desc=None, combo_choices=None, combo_data=None, combo_list_size=None, tooltip=None, divider=None, padding=0, spacer=None, single_value=False, read_only=False, can_be_none=False): + def element_sequence(self, key=None, default=None, sizer=None, element_type='default', seq_type=None, value_type=None, dim=None, min=None, max=None, desc=None, desc_short=None, combo_choices=None, combo_data=None, combo_list_size=None, tooltip=None, divider=None, padding=0, spacer=None, single_value=False, read_only=False, can_be_none=False): """Set up the element and store it. @keyword key: The dictionary key to store the element with. @@ -706,6 +706,8 @@ @type max: int @keyword desc: The text description. @type desc: str + @keyword desc_short: The short description. + @type desc_short: str @keyword combo_choices: The list of choices to present to the user. This is only used if the element_type is set to 'combo'. @type combo_choices: list of str @keyword combo_data: 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. @@ -729,13 +731,13 @@ """ # Create the element. - element = Sequence(name=key, default=default, element_type=element_type, seq_type=seq_type, value_type=value_type, dim=dim, min=min, max=max, parent=self, sizer=sizer, desc=desc, combo_choices=combo_choices, combo_data=combo_data, combo_list_size=combo_list_size, tooltip=tooltip, divider=divider, padding=padding, spacer=spacer, single_value=single_value, read_only=read_only, can_be_none=can_be_none) + element = Sequence(name=desc_short, default=default, element_type=element_type, seq_type=seq_type, value_type=value_type, dim=dim, min=min, max=max, parent=self, sizer=sizer, desc=desc, combo_choices=combo_choices, combo_data=combo_data, combo_list_size=combo_list_size, tooltip=tooltip, divider=divider, padding=padding, spacer=spacer, single_value=single_value, read_only=read_only, can_be_none=can_be_none) # Store it. self._elements[key] = element - def element_sequence_2D(self, key=None, default=None, sizer=None, element_type='default', seq_type=None, value_type=None, dim=None, min=None, max=None, titles=None, desc=None, combo_choices=None, combo_data=None, combo_list_size=None, tooltip=None, divider=None, padding=0, spacer=None, read_only=False, can_be_none=False): + def element_sequence_2D(self, key=None, default=None, sizer=None, element_type='default', seq_type=None, value_type=None, dim=None, min=None, max=None, titles=None, desc=None, desc_short=None, combo_choices=None, combo_data=None, combo_list_size=None, tooltip=None, divider=None, padding=0, spacer=None, read_only=False, can_be_none=False): """Set up the element and store it. @keyword key: The dictionary key to store the element with. @@ -760,6 +762,8 @@ @type titles: list of str @keyword desc: The text description. @type desc: str + @keyword desc_short: The short description. + @type desc_short: str @keyword combo_choices: The list of choices to present to the user. This is only used if the element_type is set to 'combo'. @type combo_choices: list of str @keyword combo_data: 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. @@ -781,7 +785,7 @@ """ # Create the element. - element = Sequence_2D(name=key, parent=self, default=default, sizer=sizer, element_type=element_type, seq_type=seq_type, value_type=value_type, dim=dim, min=min, max=max, titles=titles, desc=desc, combo_choices=combo_choices, combo_data=combo_data, combo_list_size=combo_list_size, tooltip=tooltip, divider=divider, padding=padding, spacer=spacer, read_only=read_only, can_be_none=can_be_none) + element = Sequence_2D(name=desc_short, parent=self, default=default, sizer=sizer, element_type=element_type, seq_type=seq_type, value_type=value_type, dim=dim, min=min, max=max, titles=titles, desc=desc, combo_choices=combo_choices, combo_data=combo_data, combo_list_size=combo_list_size, tooltip=tooltip, divider=divider, padding=padding, spacer=spacer, read_only=read_only, can_be_none=can_be_none) # Store it. self._elements[key] = element Modified: branches/uf_redesign/gui/wizard_elements.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/wizard_elements.py?rev=16187&r1=16186&r2=16187&view=diff ============================================================================== --- branches/uf_redesign/gui/wizard_elements.py (original) +++ branches/uf_redesign/gui/wizard_elements.py Thu May 10 14:22:20 2012 @@ -860,7 +860,7 @@ raise RelaxError("Unknown base data type '%s'." % value_type) # The title of the dialog. - title = "The sequence of %s" % name + title = "Edit the %s values." % name # Set up the dialog. wx.Dialog.__init__(self, None, id=-1, title=title)