mailr16113 - /branches/uf_redesign/gui/wizard_elements.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on May 08, 2012 - 18:06:
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):




Related Messages


Powered by MHonArc, Updated Tue May 08 18:40:01 2012