"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gui/input_elements/spin_id.py" between
relax-4.1.3.src.tar.bz2 and relax-5.0.0.src.tar.bz2

About: relax allows the study of molecular dynamics through the analysis of experimental NMR data. Organic molecules, proteins, RNA, DNA, sugars, and other biomolecules are all supported.

spin_id.py  (relax-4.1.3.src.tar.bz2):spin_id.py  (relax-5.0.0.src.tar.bz2)
skipping to change at line 30 skipping to change at line 30
############################################################################### ###############################################################################
# Module docstring. # Module docstring.
"""GUI element for the user input of spin IDs.""" """GUI element for the user input of spin IDs."""
# Python module imports. # Python module imports.
from copy import deepcopy from copy import deepcopy
import wx import wx
# relax module imports. # relax module imports.
import dep_check
from gui.fonts import font from gui.fonts import font
from gui.string_conv import gui_to_str, str_to_gui from gui.string_conv import gui_to_str, str_to_gui
from lib.errors import RelaxError from lib.errors import RelaxError
from pipe_control.mol_res_spin import id_string_doc from pipe_control.mol_res_spin import id_string_doc
class Spin_id: class Spin_id:
"""GUI element for the input of spin ID strings.""" """GUI element for the input of spin ID strings."""
def __init__(self, name=None, default=None, parent=None, element_type='defau lt', sizer=None, desc="spin ID string", combo_choices=None, combo_data=None, too ltip=None, divider=None, padding=0, spacer=None, height_element=27, can_be_none= True): def __init__(self, name=None, default=None, parent=None, element_type='defau lt', sizer=None, desc="spin ID string", combo_choices=None, combo_data=None, too ltip=None, divider=None, padding=0, spacer=None, height_element=27, can_be_none= True):
"""Set up the base spin ID element. """Set up the base spin ID element.
skipping to change at line 104 skipping to change at line 105
text = wx.StaticText(parent, -1, desc, style=wx.ALIGN_LEFT) text = wx.StaticText(parent, -1, desc, style=wx.ALIGN_LEFT)
text.SetFont(font.normal) text.SetFont(font.normal)
sub_sizer.Add(text, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0) sub_sizer.Add(text, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 0)
# The divider. # The divider.
if not divider: if not divider:
raise RelaxError("The divider position has not been supplied.") raise RelaxError("The divider position has not been supplied.")
# Spacing. # Spacing.
x, y = text.GetSize() x, y = text.GetSize()
sub_sizer.AddSpacer((divider - x, 0)) if dep_check.wx_classic:
sub_sizer.AddSpacer((divider - x, 0))
else:
sub_sizer.AddSpacer(divider - x)
# The input field. # The input field.
style = wx.CB_DROPDOWN style = wx.CB_DROPDOWN
self._field = wx.ComboBox(parent, -1, '', style=style) self._field = wx.ComboBox(parent, -1, '', style=style)
# Update the choices. # Update the choices.
self.UpdateChoices(combo_choices=combo_choices, combo_data=combo_data, c ombo_default=default) self.UpdateChoices(combo_choices=combo_choices, combo_data=combo_data, c ombo_default=default)
# Set up the input field. # Set up the input field.
self._field.SetMinSize((50, height_element)) self._field.SetMinSize((50, height_element))
skipping to change at line 144 skipping to change at line 148
# Add the ID string documentation to the tooltip. # Add the ID string documentation to the tooltip.
for type, element in id_string_doc.element_loop(): for type, element in id_string_doc.element_loop():
if type == 'paragraph': if type == 'paragraph':
# Initial spacing. # Initial spacing.
tooltip += '\n\n' tooltip += '\n\n'
# The text. # The text.
tooltip += element tooltip += element
# Set the tooltip. # Set the tooltip.
text.SetToolTipString(tooltip) text.SetToolTip(wx.ToolTip(tooltip))
self._field.SetToolTipString(tooltip) self._field.SetToolTip(wx.ToolTip(tooltip))
def Clear(self): def Clear(self):
"""Special method for clearing or resetting the GUI element.""" """Special method for clearing or resetting the GUI element."""
# Clear the value. # Clear the value.
self._field.Clear() self._field.Clear()
self._field.SetValue('') self._field.SetValue('')
def GetValue(self): def GetValue(self):
"""Special method for returning the value of the GUI element. """Special method for returning the value of the GUI element.
 End of changes. 3 change blocks. 
3 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)