Author: bugman
Date: Mon May 7 20:09:45 2012
New Revision: 16075
URL: http://svn.gna.org/viewcvs/relax?rev=16075&view=rev
Log:
Eliminated the wiz_combo_default and combo_default args from the GUI
auto-generated user functions.
These are now provided by the 'default' arg.
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=16075&r1=16074&r2=16075&view=diff
==============================================================================
--- branches/uf_redesign/gui/uf_objects.py (original)
+++ branches/uf_redesign/gui/uf_objects.py Mon May 7 20:09:45 2012
@@ -213,7 +213,7 @@
# Value types.
elif arg['py_type'] in ['float', 'int', 'num', 'str']:
- self.element_value(key=arg['name'], default=arg['default'],
element_type=arg['wiz_element_type'], value_type=arg['py_type'], sizer=sizer,
desc=desc, combo_choices=arg['wiz_combo_choices'],
combo_data=arg['wiz_combo_data'], combo_default=arg['wiz_combo_default'],
tooltip=arg['desc'], read_only=arg['wiz_read_only'])
+ self.element_value(key=arg['name'], default=arg['default'],
element_type=arg['wiz_element_type'], value_type=arg['py_type'], sizer=sizer,
desc=desc, combo_choices=arg['wiz_combo_choices'],
combo_data=arg['wiz_combo_data'], tooltip=arg['desc'],
read_only=arg['wiz_read_only'])
# Bool type.
elif arg['py_type'] == 'bool':
@@ -240,7 +240,7 @@
if arg['py_type'] in ['float_or_float_list',
'int_or_int_list', 'num_or_num_list', 'str_or_str_list',
'float_or_float_tuple', 'int_or_int_tuple', 'num_or_num_tuple',
'str_or_str_tuple']:
single_value = True
- self.element_sequence(key=arg['name'], default=arg['default'],
element_type=arg['wiz_element_type'], seq_type=seq_type, value_type=value_type,
sizer=sizer, desc=desc, combo_choices=arg['wiz_combo_choices'],
combo_data=arg['wiz_combo_data'], combo_default=arg['wiz_combo_default'],
combo_list_size=arg['wiz_combo_list_size'], tooltip=arg['desc'],
single_value=single_value, read_only=arg['wiz_read_only'])
+ self.element_sequence(key=arg['name'], default=arg['default'],
element_type=arg['wiz_element_type'], seq_type=seq_type, value_type=value_type,
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'])
# String list of lists.
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']:
@@ -258,7 +258,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, titles=arg['list_titles'], desc=desc,
combo_choices=arg['wiz_combo_choices'], combo_data=arg['wiz_combo_data'],
combo_default=arg['wiz_combo_default'],
combo_list_size=arg['wiz_combo_list_size'], tooltip=arg['desc'],
read_only=arg['wiz_read_only'])
+ 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, 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'])
# Unknown type.
else:
Modified: branches/uf_redesign/gui/wizard.py
URL:
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/wizard.py?rev=16075&r1=16074&r2=16075&view=diff
==============================================================================
--- branches/uf_redesign/gui/wizard.py (original)
+++ branches/uf_redesign/gui/wizard.py Mon May 7 20:09:45 2012
@@ -679,7 +679,7 @@
self._elements[key] = element
- def element_sequence(self, key=None, default=None, sizer=None,
element_type='default', seq_type=None, value_type=None, desc=None,
combo_choices=None, combo_data=None, combo_default=None, combo_list_size=None,
tooltip=None, divider=None, padding=0, spacer=None, single_value=False,
read_only=False):
+ def element_sequence(self, key=None, default=None, sizer=None,
element_type='default', seq_type=None, value_type=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):
"""Set up the element and store it.
@keyword key: The dictionary key to store the element
with.
@@ -700,8 +700,6 @@
@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.
@type combo_data: list
- @keyword combo_default: The default value of the ComboBox. This
is only used if the element_type is set to 'combo'.
- @type combo_default: str or None
@keyword combo_list_size: The number of initial entries in a
Combo_list object.
@type combo_list_size: int or None
@keyword tooltip: The tooltip which appears on hovering over
the text or input field.
@@ -719,13 +717,13 @@
"""
# Create the element.
- element = Sequence(name=key, default=default,
element_type=element_type, seq_type=seq_type, value_type=value_type,
parent=self, sizer=sizer, desc=desc, combo_choices=combo_choices,
combo_data=combo_data, combo_default=combo_default,
combo_list_size=combo_list_size, tooltip=tooltip, divider=divider,
padding=padding, spacer=spacer, single_value=single_value, read_only=read_only)
+ element = Sequence(name=key, default=default,
element_type=element_type, seq_type=seq_type, value_type=value_type,
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)
# 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, titles=None, desc=None,
combo_choices=None, combo_data=None, combo_default=None, combo_list_size=None,
tooltip=None, divider=None, padding=0, spacer=None, read_only=False):
+ def element_sequence_2D(self, key=None, default=None, sizer=None,
element_type='default', seq_type=None, value_type=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):
"""Set up the element and store it.
@keyword key: The dictionary key to store the element
with.
@@ -748,8 +746,6 @@
@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.
@type combo_data: list
- @keyword combo_default: The default value of the ComboBox. This
is only used if the element_type is set to 'combo'.
- @type combo_default: str or None
@keyword combo_list_size: The number of initial entries in a
Combo_list object.
@type combo_list_size: int or None
@keyword tooltip: The tooltip which appears on hovering over
the text or input field.
@@ -765,13 +761,13 @@
"""
# 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, titles=titles, desc=desc, combo_choices=combo_choices,
combo_data=combo_data, combo_default=combo_default,
combo_list_size=combo_list_size, tooltip=tooltip, divider=divider,
padding=padding, spacer=spacer, read_only=read_only)
+ element = Sequence_2D(name=key, parent=self, default=default,
sizer=sizer, element_type=element_type, seq_type=seq_type,
value_type=value_type, 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)
# Store it.
self._elements[key] = element
- def element_value(self, key=None, default=None, element_type='text',
value_type=None, sizer=None, desc=None, combo_choices=None, combo_data=None,
combo_default=None, tooltip=None, divider=None, padding=0, spacer=None,
read_only=False):
+ def element_value(self, key=None, default=None, element_type='text',
value_type=None, sizer=None, desc=None, combo_choices=None, combo_data=None,
tooltip=None, divider=None, padding=0, spacer=None, read_only=False):
"""Set up the string element and store it.
@keyword key: The dictionary key to store the element with.
@@ -790,8 +786,6 @@
@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.
@type combo_data: list
- @keyword combo_default: The default value of the ComboBox. This is
only used if the element_type is set to 'combo'.
- @type combo_default: str or None
@keyword tooltip: The tooltip which appears on hovering over the
text or input field.
@type tooltip: str
@keyword divider: The optional position of the divider. If
None, the class variable _div_left will be used.
@@ -805,7 +799,7 @@
"""
# Create the element.
- element = Value(name=key, parent=self, default=default,
element_type=element_type, value_type=value_type, sizer=sizer, desc=desc,
combo_choices=combo_choices, combo_data=combo_data,
combo_default=combo_default, tooltip=tooltip, divider=divider, padding=padding,
spacer=spacer, read_only=read_only)
+ element = Value(name=key, parent=self, default=default,
element_type=element_type, value_type=value_type, sizer=sizer, desc=desc,
combo_choices=combo_choices, combo_data=combo_data, tooltip=tooltip,
divider=divider, padding=padding, spacer=spacer, read_only=read_only)
# 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=16075&r1=16074&r2=16075&view=diff
==============================================================================
--- branches/uf_redesign/gui/wizard_elements.py (original)
+++ branches/uf_redesign/gui/wizard_elements.py Mon May 7 20:09:45 2012
@@ -54,7 +54,7 @@
- tuple of strings
"""
- def __init__(self, name=None, default=None, parent=None,
element_type='default', seq_type=None, value_type=None, sizer=None, desc=None,
combo_choices=None, combo_data=None, combo_default=None, combo_list_size=None,
tooltip=None, divider=None, padding=0, spacer=None, single_value=False,
read_only=False):
+ def __init__(self, name=None, default=None, parent=None,
element_type='default', seq_type=None, value_type=None, sizer=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):
"""Set up the element.
@keyword name: The name of the element to use in titles,
etc.
@@ -77,8 +77,6 @@
@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.
@type combo_data: list
- @keyword combo_default: The default value of the ComboBox. This
is only used if the element_type is set to 'combo'.
- @type combo_default: str or None
@keyword combo_list_size: The number of initial entries in a
Combo_list object.
@type combo_list_size: int or None
@keyword tooltip: The tooltip which appears on hovering over
the text or input field.
@@ -186,7 +184,7 @@
read_only = False
# Set up the Combo_list object.
- self._field = Combo_list(parent, sizer, desc, n=combo_list_size,
choices=combo_choices, data=combo_data, default=combo_default, tooltip=tooltip,
read_only=read_only)
+ self._field = Combo_list(parent, sizer, desc, n=combo_list_size,
choices=combo_choices, data=combo_data, default=default, tooltip=tooltip,
read_only=read_only)
# Unknown field.
else:
@@ -682,7 +680,7 @@
- tuple of strings
"""
- def __init__(self, name=None, default=None, parent=None, sizer=None,
element_type='default', seq_type=None, value_type=None, titles=None, desc=None,
combo_choices=None, combo_data=None, combo_default=None, combo_list_size=None,
tooltip=None, divider=None, padding=0, spacer=None, read_only=False):
+ def __init__(self, name=None, default=None, parent=None, sizer=None,
element_type='default', seq_type=None, value_type=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):
"""Set up the element.
@keyword name: The name of the element to use in titles,
etc.
@@ -707,8 +705,6 @@
@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.
@type combo_data: list
- @keyword combo_default: The default value of the ComboBox. This
is only used if the element_type is set to 'combo'.
- @type combo_default: str or None
@keyword combo_list_size: The number of initial entries in a
Combo_list object.
@type combo_list_size: int or None
@keyword tooltip: The tooltip which appears on hovering over
the text or input field.
@@ -727,7 +723,7 @@
self.titles = titles
# Initialise the base class.
- Sequence.__init__(self, name=name, default=default, parent=parent,
sizer=sizer, element_type=element_type, seq_type=seq_type,
value_type=value_type, desc=desc, combo_choices=combo_choices,
combo_data=combo_data, combo_default=combo_default,
combo_list_size=combo_list_size, tooltip=tooltip, divider=divider,
padding=padding, spacer=spacer, read_only=read_only)
+ Sequence.__init__(self, name=name, default=default, parent=parent,
sizer=sizer, element_type=element_type, seq_type=seq_type,
value_type=value_type, 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)
def open_dialog(self, event):
@@ -1107,7 +1103,7 @@
- strings
"""
- def __init__(self, name=None, default=None, parent=None,
element_type='text', value_type=None, sizer=None, desc=None,
combo_choices=None, combo_data=None, combo_default=None, tooltip=None,
divider=None, padding=0, spacer=None, read_only=False):
+ def __init__(self, name=None, default=None, parent=None,
element_type='text', value_type=None, sizer=None, desc=None,
combo_choices=None, combo_data=None, tooltip=None, divider=None, padding=0,
spacer=None, read_only=False):
"""Set up the base value element.
@keyword name: The name of the element to use in titles, etc.
@@ -1128,8 +1124,6 @@
@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.
@type combo_data: list
- @keyword combo_default: The default value of the ComboBox. This is
only used if the element_type is set to 'combo'.
- @type combo_default: str or None
@keyword tooltip: The tooltip which appears on hovering over the
text or input field.
@type tooltip: str
@keyword divider: The optional position of the divider. If
None, the class variable _div_left will be used.
@@ -1215,7 +1209,7 @@
self._field = wx.ComboBox(parent, -1, '', style=style)
# Update the choices.
- self.ResetChoices(combo_choices=combo_choices,
combo_data=combo_data, combo_default=combo_default)
+ self.ResetChoices(combo_choices=combo_choices,
combo_data=combo_data, combo_default=default)
# Unknown field.
else:
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits