Author: bugman Date: Sun Apr 21 15:11:53 2013 New Revision: 19533 URL: http://svn.gna.org/viewcvs/relax?rev=19533&view=rev Log: The Text_ctrl analysis frame GUI elements now have separate tooltips for the buttons. This is to give a hint to the user as to what the button does. Modified: trunk/gui/analyses/auto_model_free.py trunk/gui/analyses/auto_noe.py trunk/gui/analyses/auto_rx_base.py trunk/gui/analyses/base.py trunk/gui/analyses/elements/text_element.py Modified: trunk/gui/analyses/auto_model_free.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/auto_model_free.py?rev=19533&r1=19532&r2=19533&view=diff ============================================================================== --- trunk/gui/analyses/auto_model_free.py (original) +++ trunk/gui/analyses/auto_model_free.py Sun Apr 21 15:11:53 2013 @@ -511,7 +511,7 @@ Text_ctrl(box, self, text="The data pipe bundle:", default=self.data.pipe_bundle, tooltip="This is the data pipe bundle associated with this analysis.", editable=False, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) # Add the results directory GUI element. - self.field_results_dir = Text_ctrl(box, self, text="Results directory:", icon=paths.icon_16x16.open_folder, default=self.data.save_dir, tooltip="The directory in which all automatically created files will be saved.", fn=self.results_directory, button=True, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) + self.field_results_dir = Text_ctrl(box, self, text="Results directory:", icon=paths.icon_16x16.open_folder, default=self.data.save_dir, tooltip="The directory in which all automatically created files will be saved.", tooltip_button="Select the results directory.", fn=self.results_directory, button=True, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) # Add the spin GUI element. self.add_spin_systems(box, self) @@ -541,7 +541,7 @@ self.max_iter = Spin_ctrl(box, self, text="Maximum interations:", default=self.data.max_iter, tooltip="The maximum number of iterations for the protocol. This is the limit for the global looping over the optimisation of the model-free models, model elimination, model selection and then optimisation of the diffusion tensor.", min=25, max=100, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) # The calculation mode. - self.mode = Text_ctrl(box, self, text="Protocol mode:", default='Fully automated', tooltip="Select if the dauvergne_protocol analysis will be fully automated or whether the individual global models will be optimised separately.", icon=paths.icon_16x16.system_run, fn=self.mode_dialog, editable=False, button=True, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) + self.mode = Text_ctrl(box, self, text="Protocol mode:", default='Fully automated', tooltip="Select if the dauvergne_protocol analysis will be fully automated or whether the individual global models will be optimised separately.", tooltip_button="Open the protocol mode selection window.", icon=paths.icon_16x16.system_run, fn=self.mode_dialog, editable=False, button=True, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) # Stretchable spacing (with a minimal space). box.AddSpacer(30) Modified: trunk/gui/analyses/auto_noe.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/auto_noe.py?rev=19533&r1=19532&r2=19533&view=diff ============================================================================== --- trunk/gui/analyses/auto_noe.py (original) +++ trunk/gui/analyses/auto_noe.py Sun Apr 21 15:11:53 2013 @@ -203,7 +203,7 @@ self.field_nmr_frq = Text_ctrl(box, self, text="NMR frequency label [MHz]:", default=self.data.frq, tooltip="This label is added to the output files. For example if the label is '600', the NOE values will be located in the file 'noe.600.out'.", width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) # Add the results directory GUI element. - self.field_results_dir = Text_ctrl(box, self, text="Results directory:", icon=paths.icon_16x16.open_folder, default=self.data.save_dir, tooltip="The directory in which all automatically created files will be saved.", fn=self.results_directory, button=True, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) + self.field_results_dir = Text_ctrl(box, self, text="Results directory:", icon=paths.icon_16x16.open_folder, default=self.data.save_dir, tooltip="The directory in which all automatically created files will be saved.", tooltip_button="Select the results directory.", fn=self.results_directory, button=True, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) # Add the spin GUI element. self.add_spin_systems(box, self) Modified: trunk/gui/analyses/auto_rx_base.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/auto_rx_base.py?rev=19533&r1=19532&r2=19533&view=diff ============================================================================== --- trunk/gui/analyses/auto_rx_base.py (original) +++ trunk/gui/analyses/auto_rx_base.py Sun Apr 21 15:11:53 2013 @@ -214,7 +214,7 @@ self.field_nmr_frq = Text_ctrl(box, self, text="NMR frequency label [MHz]:", default=self.data.frq, tooltip="This label is added to the output files. For example if the label is '600', the %s values will be located in the file '%s.600.out'." % (self.label, self.label.lower()), width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) # Add the results directory GUI element. - self.field_results_dir = Text_ctrl(box, self, text="Results directory:", icon=paths.icon_16x16.open_folder, default=self.data.save_dir, tooltip="The directory in which all automatically created files will be saved.", fn=self.results_directory, button=True, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) + self.field_results_dir = Text_ctrl(box, self, text="Results directory:", icon=paths.icon_16x16.open_folder, default=self.data.save_dir, tooltip="The directory in which all automatically created files will be saved.", tooltip_button="Select the results directory.", fn=self.results_directory, button=True, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) # Add the spin GUI element. self.add_spin_systems(box, self) Modified: trunk/gui/analyses/base.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/base.py?rev=19533&r1=19532&r2=19533&view=diff ============================================================================== --- trunk/gui/analyses/base.py (original) +++ trunk/gui/analyses/base.py Sun Apr 21 15:11:53 2013 @@ -215,7 +215,7 @@ """ # Add the element. - self.spin_systems = Text_ctrl(box, self, text="Spin systems:", button_text=" Spin editor", default=self.spin_count(), tooltip="The currently loaded molecule, residue, and spin sequence.", icon=paths.icon_16x16.spin, fn=self.launch_spin_editor, editable=False, button=True, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) + self.spin_systems = Text_ctrl(box, self, text="Spin systems:", button_text=" Spin editor", default=self.spin_count(), tooltip="The currently loaded molecule, residue and spin sequence.", tooltip_button="Launch the spin editor window for modifying the molecule, residue and spin sequence.", icon=paths.icon_16x16.spin, fn=self.launch_spin_editor, editable=False, button=True, width_text=self.width_text, width_button=self.width_button, spacer=self.spacer_horizontal) def add_static_text(self, box, parent, text='', width=-1, height=-1): Modified: trunk/gui/analyses/elements/text_element.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/elements/text_element.py?rev=19533&r1=19532&r2=19533&view=diff ============================================================================== --- trunk/gui/analyses/elements/text_element.py (original) +++ trunk/gui/analyses/elements/text_element.py Sun Apr 21 15:11:53 2013 @@ -39,42 +39,46 @@ This consists of three elements: wx.StaticText, wx.TextCtrl, and wx.Button. """ - def __init__(self, box, parent, text="", default="", tooltip=None, button_text=" Change", control=wx.TextCtrl, icon=icon_16x16.open, fn=None, editable=True, button=False, width_text=200, width_button=80, spacer=0): + def __init__(self, box, parent, text="", default="", tooltip=None, tooltip_button=None, button_text=" Change", control=wx.TextCtrl, icon=icon_16x16.open, fn=None, editable=True, button=False, width_text=200, width_button=80, spacer=0): """Create a text selection element for the frame. This consists of a horizontal layout with a static text element, a text control, and an optional button. - @param box: The box element to pack the structure file selection GUI element into. - @type box: wx.BoxSizer instance - @param parent: The parent GUI element. - @type parent: wx object - @keyword text: The static text. - @type text: str - @keyword default: The default text of the control. - @type default: str - @keyword tooltip: The tooltip which appears on hovering over the text or input field. - @type tooltip: str - @keyword button_text: The text to display on the button. - @type button_text: str - @keyword control: The control class to use. - @type control: wx.TextCtrl derived class - @keyword icon: The path of the icon to use for the button. - @type icon: str - @keyword fn: The function or method to execute when clicking on the button. If this is a string, then an equivalent function will be searched for in the control object. - @type fn: func or str - @keyword editable: A flag specifying if the control is editable or not. - @type editable: bool - @keyword button: A flag which if True will cause a button to appear. - @type button: bool - @keyword width_text: The width of the text element. - @type width_text: int - @keyword width_button: The width of the button. - @type width_button: int - @keyword spacer: The horizontal spacing between the elements. - @type spacer: int + @param box: The box element to pack the structure file selection GUI element into. + @type box: wx.BoxSizer instance + @param parent: The parent GUI element. + @type parent: wx object + @keyword text: The static text. + @type text: str + @keyword default: The default text of the control. + @type default: str + @keyword tooltip: The tooltip which appears on hovering over the text or input field. + @type tooltip: str + @keyword tooltip_button: The separate tooltip for the button. + @type tooltip_button: str + @keyword button_text: The text to display on the button. + @type button_text: str + @keyword control: The control class to use. + @type control: wx.TextCtrl derived class + @keyword icon: The path of the icon to use for the button. + @type icon: str + @keyword fn: The function or method to execute when clicking on the button. If this is a string, then an equivalent function will be searched for in the control object. + @type fn: func or str + @keyword editable: A flag specifying if the control is editable or not. + @type editable: bool + @keyword button: A flag which if True will cause a button to appear. + @type button: bool + @keyword width_text: The width of the text element. + @type width_text: int + @keyword width_button: The width of the button. + @type width_button: int + @keyword spacer: The horizontal spacing between the elements. + @type spacer: int """ # Horizontal packing for this element. + print + print text sizer = wx.BoxSizer(wx.HORIZONTAL) # The label. @@ -129,8 +133,14 @@ if tooltip: self.label.SetToolTipString(tooltip) self.field.SetToolTipString(tooltip) - if button: - self.button.SetToolTipString(tooltip) + if button and tooltip_button: + print "hello" + self.button.SetToolTipString(tooltip_button) + else: + print "no?" + print button + print tooltip + print tooltip_button def Enable(self, enable=True):