Author: bugman Date: Fri May 4 18:57:53 2012 New Revision: 15983 URL: http://svn.gna.org/viewcvs/relax?rev=15983&view=rev Log: Created the element_dir_sel() and element_file_sel() wizard page methods. This will require the selector objects to be written! 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=15983&r1=15982&r2=15983&view=diff ============================================================================== --- branches/uf_redesign/gui/wizard.py (original) +++ branches/uf_redesign/gui/wizard.py Fri May 4 18:57:53 2012 @@ -41,7 +41,7 @@ from gui.misc import add_border, bool_to_gui, gui_to_int, gui_to_str, int_to_gui, open_file, protected_exec, str_to_gui from gui.message import Question from gui import paths -from gui.wizard_elements import Integer, String, String_list, String_list_of_lists +from gui.wizard_elements import Integer, Selector_file, Selector_dir, String, String_list, String_list_of_lists class Wiz_page(wx.Panel): @@ -577,6 +577,62 @@ # Return the combo box element. return combo + + + def element_dir_sel(self, key=None, sizer=None, desc=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 + @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 = Selector_dir(name=key, parent=self, sizer=sizer, desc=desc, tooltip=tooltip, divider=divider, padding=padding, spacer=spacer, read_only=read_only) + + # Store it. + self._elements[key] = element + + + def element_file_sel(self, key=None, sizer=None, desc=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 + @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 = Selector_file(name=key, parent=self, sizer=sizer, desc=desc, tooltip=tooltip, divider=divider, padding=padding, spacer=spacer, read_only=read_only) + + # Store it. + self._elements[key] = element 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):