Author: bugman
Date: Tue May 8 18:06:38 2012
New Revision: 16113
URL: http://svn.gna.org/viewcvs/relax?rev=16113&view=rev
Log:
For the Value wizard page element, the default can be the string or data for a
ComboBox now.
If the default is a data value, then this is translated to the string. This
allows the default in
the user function data objects to be either the string or data value, removing
a source of coding
errors.
Modified:
branches/uf_redesign/gui/wizard_elements.py
Modified: branches/uf_redesign/gui/wizard_elements.py
URL:
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/wizard_elements.py?rev=16113&r1=16112&r2=16113&view=diff
==============================================================================
--- branches/uf_redesign/gui/wizard_elements.py (original)
+++ branches/uf_redesign/gui/wizard_elements.py Tue May 8 18:06:38 2012
@@ -1365,7 +1365,14 @@
# Set the default selection.
if combo_default:
- self._field.SetStringSelection(combo_default)
+ # Translate if needed.
+ if combo_default in combo_choices:
+ string = combo_default
+ else:
+ string = combo_choices[combo_data.index(combo_default)]
+
+ # Set the selection.
+ self._field.SetStringSelection(string)
def SetValue(self, value):
_______________________________________________
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