Author: bugman Date: Thu May 3 09:45:01 2012 New Revision: 15890 URL: http://svn.gna.org/viewcvs/relax?rev=15890&view=rev Log: The wizard page element_string() method now accepts all the combo box args (and a read_only arg). 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=15890&r1=15889&r2=15890&view=diff ============================================================================== --- 1.3/gui/wizard.py (original) +++ 1.3/gui/wizard.py Thu May 3 09:45:01 2012 @@ -577,27 +577,37 @@ self._elements[key] = element - def element_string(self, key=None, sizer=None, desc=None, tooltip=None, divider=None, padding=0, spacer=None): + 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=True): """Set up the string 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 + @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, sizer=sizer, desc=desc, tooltip=tooltip, divider=divider, padding=padding, spacer=spacer) + 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. self._elements[key] = element