mailr15996 - /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 05, 2012 - 20:54:
Author: bugman
Date: Sat May  5 20:54:56 2012
New Revision: 15996

URL: http://svn.gna.org/viewcvs/relax?rev=15996&view=rev
Log:
The list wizard GUI elements no longer show empty lists.


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=15996&r1=15995&r2=15996&view=diff
==============================================================================
--- branches/uf_redesign/gui/wizard_elements.py (original)
+++ branches/uf_redesign/gui/wizard_elements.py Sat May  5 20:54:56 2012
@@ -355,6 +355,14 @@
             raise RelaxError("Unknown element type '%s'." % 
self.element_type)
 
 
+    def Clear(self):
+        """Special method for clearing or resetting the GUI element."""
+
+        # Clear the value from a TextCtrl or ComboBox.
+        if self.element_type in ['default', 'combo_list']:
+            self._field.Clear()
+
+
     def GetValue(self):
         """Special method for returning the value of the GUI element.
 
@@ -417,8 +425,16 @@
             win.ShowModal()
             win.Close()
 
+        # Get the value.
+        value = win.GetValue()
+
+        # Empty list.
+        if not len(value):
+            self.Clear()
+
         # Set the values.
-        self.SetValue(win.GetValue())
+        else:
+            self.SetValue(value)
 
         # Destroy the window.
         del win




Related Messages


Powered by MHonArc, Updated Sat May 05 21:00:02 2012