Author: bugman Date: Thu May 3 10:44:27 2012 New Revision: 15895 URL: http://svn.gna.org/viewcvs/relax?rev=15895&view=rev Log: Created a Clear() wizard page method for clearing a specific GUI element. This is currently only implemented for the wizard_elements.Base_value class. Modified: 1.3/gui/wizard.py 1.3/gui/wizard_elements.py Modified: 1.3/gui/wizard.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/wizard.py?rev=15895&r1=15894&r2=15895&view=diff ============================================================================== --- 1.3/gui/wizard.py (original) +++ 1.3/gui/wizard.py Thu May 3 10:44:27 2012 @@ -259,6 +259,17 @@ self.sep.SetValue(str_to_gui("white space")) else: self.sep.SetValue(str_to_gui(ds.relax_gui.free_file_format.sep)) + + + def Clear(self, key): + """Special wizard method for clearing the value of the GUI element corresponding to the key. + + @param key: The key value of the desired GUI element. + @type key: str + """ + + # Call the element's method. + self._elements[key].Clear() def GetValue(self, key): Modified: 1.3/gui/wizard_elements.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/wizard_elements.py?rev=15895&r1=15894&r2=15895&view=diff ============================================================================== --- 1.3/gui/wizard_elements.py (original) +++ 1.3/gui/wizard_elements.py Thu May 3 10:44:27 2012 @@ -167,11 +167,12 @@ self.conversion_fns() - def conversion_fns(self): - """Dummy method for setting up the conversion functions. - - This should define the self.convert_to_gui() and self.convert_from_gui() function aliases. - """ + 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 ['text', 'combo']: + self._field.Clear() def GetValue(self): @@ -208,6 +209,13 @@ if self._field.GetClientData(i) == value: self._field.SetSelection(i) break + + + def conversion_fns(self): + """Dummy method for setting up the conversion functions. + + This should define the self.convert_to_gui() and self.convert_from_gui() function aliases. + """