"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gui/input_elements/bool.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.

bool.py  (relax-4.1.3.src.tar.bz2):bool.py  (relax-5.0.0.src.tar.bz2)
skipping to change at line 29 skipping to change at line 29
# # # #
############################################################################### ###############################################################################
# Module docstring. # Module docstring.
"""Module containing a set of special GUI elements to be used in the relax wizar ds.""" """Module containing a set of special GUI elements to be used in the relax wizar ds."""
# Python module imports. # Python module imports.
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 bool_to_gui, gui_to_bool from gui.string_conv import bool_to_gui, gui_to_bool
from lib.errors import RelaxError from lib.errors import RelaxError
from status import Status; status = Status() from status import Status; status = Status()
class Selector_bool: class Selector_bool:
"""Wizard GUI element for boolean selection.""" """Wizard GUI element for boolean selection."""
def __init__(self, name=None, parent=None, element_type='default', sizer=Non e, desc=None, tooltip=None, divider=None, padding=0, spacer=None, height_element =27, default=True): def __init__(self, name=None, parent=None, element_type='default', sizer=Non e, desc=None, tooltip=None, divider=None, padding=0, spacer=None, height_element =27, default=True):
"""Build the boolean selector widget for selecting between True and Fals e. """Build the boolean selector widget for selecting between True and Fals e.
skipping to change at line 86 skipping to change at line 87
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 combo box element. # The combo box element.
style = wx.CB_DROPDOWN | wx.CB_READONLY style = wx.CB_DROPDOWN | wx.CB_READONLY
self.combo = wx.ComboBox(parent, -1, value=bool_to_gui(default), style=s tyle, choices=['True', 'False']) self.combo = wx.ComboBox(parent, -1, value=bool_to_gui(default), style=s tyle, choices=['True', 'False'])
self.combo.SetMinSize((50, height_element)) self.combo.SetMinSize((50, height_element))
self.combo.SetFont(font.normal) self.combo.SetFont(font.normal)
sub_sizer.Add(self.combo, 1, wx.ADJUST_MINSIZE|wx.ALIGN_CENTER_VERTICAL, 0) sub_sizer.Add(self.combo, 1, wx.ADJUST_MINSIZE|wx.ALIGN_CENTER_VERTICAL, 0)
# Right padding. # Right padding.
sub_sizer.AddSpacer(padding) sub_sizer.AddSpacer(padding)
skipping to change at line 109 skipping to change at line 113
sizer.Add(sub_sizer, 1, wx.EXPAND|wx.ALL, 0) sizer.Add(sub_sizer, 1, wx.EXPAND|wx.ALL, 0)
# Spacing below the widget. # Spacing below the widget.
if spacer == None: if spacer == None:
sizer.AddStretchSpacer() sizer.AddStretchSpacer()
else: else:
sizer.AddSpacer(spacer) sizer.AddSpacer(spacer)
# Tooltip. # Tooltip.
if tooltip: if tooltip:
text.SetToolTipString(tooltip) text.SetToolTip(wx.ToolTip(tooltip))
self.combo.SetToolTipString(tooltip) self.combo.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."""
# Reset to the default. # Reset to the default.
self.combo.SetStringSelection(bool_to_gui(self.default)) self.combo.SetStringSelection(bool_to_gui(self.default))
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)