Author: bugman Date: Fri Sep 6 09:50:22 2013 New Revision: 20867 URL: http://svn.gna.org/viewcvs/relax?rev=20867&view=rev Log: Modified many of the spectrum list GUI element action_*() methods for the GUI tests. These now take the 'item' keyword argument which overrides the ListCtrl.GetFirstSelected() call. This ListCtrl call cannot be reliably simulated on all operating systems, so the item keyword argument can be used to explicitly select list items. Modified: branches/relax_disp/gui/components/spectrum.py Modified: branches/relax_disp/gui/components/spectrum.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/gui/components/spectrum.py?rev=20867&r1=20866&r2=20867&view=diff ============================================================================== --- branches/relax_disp/gui/components/spectrum.py (original) +++ branches/relax_disp/gui/components/spectrum.py Fri Sep 6 09:50:22 2013 @@ -79,15 +79,18 @@ super(Spectra_list, self).__init__(gui=gui, parent=parent, box=box, id=id, proportion=proportion, button_placement=button_placement) - def action_relax_disp_cpmg_frq(self, event): + def action_relax_disp_cpmg_frq(self, event=None, item=None): """Launch the relax_disp.cpmg_frq user function. - @param event: The wx event. - @type event: wx event - """ - - # The current selection. - item = self.element.GetFirstSelected() + @keyword event: The wx event. + @type event: wx event + @keyword item: This is for debugging purposes only, to allow the GUI tests to select items without worrying about OS dependent wxPython bugs. + @type item: None or int + """ + + # The current selection. + if item == None: + item = self.element.GetFirstSelected() # The spectrum ID. id = gui_to_str(self.element.GetItemText(item)) @@ -104,15 +107,18 @@ uf_store['relax_disp.cpmg_frq'](frq=frq, spectrum_id=id) - def action_relax_disp_exp_type(self, event): + def action_relax_disp_exp_type(self, event=None, item=None): """Launch the relax_disp.exp_type user function. - @param event: The wx event. - @type event: wx event - """ - - # The current selection. - item = self.element.GetFirstSelected() + @keyword event: The wx event. + @type event: wx event + @keyword item: This is for debugging purposes only, to allow the GUI tests to select items without worrying about OS dependent wxPython bugs. + @type item: None or int + """ + + # The current selection. + if item == None: + item = self.element.GetFirstSelected() # The spectrum ID. id = gui_to_str(self.element.GetItemText(item)) @@ -154,15 +160,18 @@ uf_store['relax_disp.spin_lock_field'](frq=nu1, spectrum_id=id) - def action_relax_fit_relax_time(self, event): + def action_relax_fit_relax_time(self, event=None, item=None): """Launch the relax_fit.relax_time user function. - @param event: The wx event. - @type event: wx event - """ - - # The current selection. - item = self.element.GetFirstSelected() + @keyword event: The wx event. + @type event: wx event + @keyword item: This is for debugging purposes only, to allow the GUI tests to select items without worrying about OS dependent wxPython bugs. + @type item: None or int + """ + + # The current selection. + if item == None: + item = self.element.GetFirstSelected() # The spectrum ID. id = gui_to_str(self.element.GetItemText(item)) @@ -179,15 +188,18 @@ uf_store['relax_fit.relax_time'](time=time, spectrum_id=id) - def action_spectrometer_frq(self, event): + def action_spectrometer_frq(self, event=None, item=None): """Launch the spectrometer.frequency user function. - @param event: The wx event. - @type event: wx event - """ - - # The current selection. - item = self.element.GetFirstSelected() + @keyword event: The wx event. + @type event: wx event + @keyword item: This is for debugging purposes only, to allow the GUI tests to select items without worrying about OS dependent wxPython bugs. + @type item: None or int + """ + + # The current selection. + if item == None: + item = self.element.GetFirstSelected() # The spectrum ID. id = gui_to_str(self.element.GetItemText(item))