Author: bugman Date: Wed May 2 12:12:30 2012 New Revision: 15868 URL: http://svn.gna.org/viewcvs/relax?rev=15868&view=rev Log: Created a new infrastructure in the wizards for handling more advanced GUI elements. The _elements dictionary has been created to store the full GUI elements within the wizard. The GetValue() and SetValue() methods have been created as a front end to the specific GUI element's equivalent methods. Modified: 1.3/gui/wizard.py Modified: 1.3/gui/wizard.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/wizard.py?rev=15868&r1=15867&r2=15868&view=diff ============================================================================== --- 1.3/gui/wizard.py (original) +++ 1.3/gui/wizard.py Wed May 2 12:12:30 2012 @@ -95,6 +95,9 @@ # Initilise some variables. self.exec_status = False + # The wizard GUI element storage. + self._elements = {} + # Pack a sizer into the panel. box_main = wx.BoxSizer(wx.HORIZONTAL) self.SetSizer(box_main) @@ -255,6 +258,32 @@ self.sep.SetValue(str_to_gui("white space")) else: self.sep.SetValue(str_to_gui(ds.relax_gui.free_file_format.sep)) + + + def GetValue(self, key): + """Special wizard method for getting the value of the GUI element corresponding to the key. + + @param key: The key value of the desired GUI element. + @type key: str + @return: The value that the specific GUI element's GetValue() method returns. + @rtype: unknown + """ + + # Call the element's method. + return self._element[key].GetValue() + + + def SetValue(self, key, value): + """Special wizard method for setting the value of the GUI element corresponding to the key. + + @param key: The key value of the desired GUI element. + @type key: str + @param value: The value that the specific GUI element's SetValue() method expects. + @type value: unknown + """ + + # Call the element's method. + self._element[key].SetValue(value) def add_artwork(self, sizer):