Author: bugman Date: Fri May 4 18:24:55 2012 New Revision: 15979 URL: http://svn.gna.org/viewcvs/relax?rev=15979&view=rev Log: Expanded the wizard page element_int() method to accept all the args of element_string(). All these args will be handled properly by the Integer class as this derives from Base_value. Modified: branches/uf_redesign/gui/wizard.py Modified: branches/uf_redesign/gui/wizard.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/wizard.py?rev=15979&r1=15978&r2=15979&view=diff ============================================================================== --- branches/uf_redesign/gui/wizard.py (original) +++ branches/uf_redesign/gui/wizard.py Fri May 4 18:24:55 2012 @@ -579,34 +579,8 @@ return combo - def element_int(self, key=None, sizer=None, desc=None, tooltip=None, divider=None, padding=0, spacer=None): + def element_int(self, key=None, element_type='text', sizer=None, desc=None, combo_choices=None, combo_data=None, combo_default=None, tooltip=None, divider=None, padding=0, spacer=None, read_only=False): """Set up the integer element and store it. - - @keyword key: The dictionary key to store the element with. - @type key: str - @keyword sizer: The sizer to put the input field widget into. - @type sizer: wx.Sizer instance - @keyword desc: The text description. - @type desc: str - @keyword tooltip: The tooltip which appears on hovering over the text or input field. - @type tooltip: str - @keyword divider: The optional position of the divider. If None, the class variable _div_left will be used. - @type divider: None or int - @keyword padding: Spacing to the left and right of the widgets. - @type padding: int - @keyword spacer: The amount of spacing to add below the field in pixels. If None, a stretchable spacer will be used. - @type spacer: None or int - """ - - # Create the element. - element = Integer(name=key, parent=self, sizer=sizer, desc=desc, tooltip=tooltip, divider=divider, padding=padding, spacer=spacer) - - # Store it. - self._elements[key] = element - - - def element_string(self, key=None, element_type='text', sizer=None, desc=None, combo_choices=None, combo_data=None, combo_default=None, tooltip=None, divider=None, padding=0, spacer=None, read_only=False): - """Set up the string element and store it. @keyword key: The dictionary key to store the element with. @type key: str @@ -635,6 +609,42 @@ """ # Create the element. + element = Integer(name=key, parent=self, element_type=element_type, sizer=sizer, desc=desc, combo_choices=combo_choices, combo_data=combo_data, combo_default=combo_default, tooltip=tooltip, divider=divider, padding=padding, spacer=spacer, read_only=read_only) + + # Store it. + self._elements[key] = element + + + def element_string(self, key=None, element_type='text', sizer=None, desc=None, combo_choices=None, combo_data=None, combo_default=None, tooltip=None, divider=None, padding=0, spacer=None, read_only=False): + """Set up the string element and store it. + + @keyword key: The dictionary key to store the element with. + @type key: str + @keyword element_type: The type of GUI element to create. If set to 'text', a wx.TextCtrl element will be used. If set to 'combo', a wx.ComboBox element will be used. + @type element_type: str + @keyword sizer: The sizer to put the input field widget into. + @type sizer: wx.Sizer instance + @keyword desc: The text description. + @type desc: str + @keyword combo_choices: The list of choices to present to the user. This is only used if the element_type is set to 'combo'. + @type combo_choices: list of str + @keyword combo_data: The data returned by a call to GetValue(). This is only used if the element_type is set to 'combo'. If supplied, it should be the same length at the combo_choices list. If not supplied, the combo_choices list will be used for the returned data. + @type combo_data: list + @keyword combo_default: The default value of the ComboBox. This is only used if the element_type is set to 'combo'. + @type combo_default: str or None + @keyword tooltip: The tooltip which appears on hovering over the text or input field. + @type tooltip: str + @keyword divider: The optional position of the divider. If None, the class variable _div_left will be used. + @type divider: None or int + @keyword padding: Spacing to the left and right of the widgets. + @type padding: int + @keyword spacer: The amount of spacing to add below the field in pixels. If None, a stretchable spacer will be used. + @type spacer: None or int + @keyword read_only: A flag which if True means that the text of the element cannot be edited. + @type read_only: bool + """ + + # Create the element. element = String(name=key, parent=self, element_type=element_type, sizer=sizer, desc=desc, combo_choices=combo_choices, combo_data=combo_data, combo_default=combo_default, tooltip=tooltip, divider=divider, padding=padding, spacer=spacer, read_only=read_only) # Store it.