"Fossies" - the Fresh Open Source Software Archive  

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

dir.py  (relax-4.1.3.src.tar.bz2):dir.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 graphics import fetch_icon from graphics import fetch_icon
from gui.filedialog import RelaxDirDialog from gui.filedialog import RelaxDirDialog
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 status import Status; status = Status() from status import Status; status = Status()
class Selector_dir: class Selector_dir:
"""Wizard GUI element for selecting directories.""" """Wizard GUI element for selecting directories."""
skipping to change at line 94 skipping to change at line 95
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.
self._field = wx.TextCtrl(parent, -1, default) self._field = wx.TextCtrl(parent, -1, default)
self._field.SetMinSize((-1, height_element)) self._field.SetMinSize((-1, height_element))
self._field.SetFont(font.normal) self._field.SetFont(font.normal)
sub_sizer.Add(self._field, 1, wx.ADJUST_MINSIZE|wx.ALIGN_CENTER_VERTICAL , 0) sub_sizer.Add(self._field, 1, wx.ADJUST_MINSIZE|wx.ALIGN_CENTER_VERTICAL , 0)
# The directory selection object. # The directory selection object.
obj = RelaxDirDialog(parent, field=self._field, message=message, default Path=default, style=style) obj = RelaxDirDialog(parent, field=self._field, message=message, default Path=default, style=style)
# A little spacing. # A little spacing.
sub_sizer.AddSpacer(5) sub_sizer.AddSpacer(5)
# The file selection button. # The file selection button.
button = wx.BitmapButton(parent, -1, wx.Bitmap(fetch_icon('oxygen.action s.document-open-folder'), wx.BITMAP_TYPE_ANY)) button = wx.BitmapButton(parent, -1, wx.Bitmap(fetch_icon('oxygen.action s.document-open-folder'), wx.BITMAP_TYPE_ANY))
button.SetMinSize((height_element, height_element)) button.SetMinSize((height_element, height_element))
button.SetToolTipString("Select the directory.") button.SetToolTip(wx.ToolTip("Select the directory."))
sub_sizer.Add(button, 0, wx.ADJUST_MINSIZE|wx.ALIGN_CENTER_VERTICAL, 0) sub_sizer.Add(button, 0, wx.ADJUST_MINSIZE|wx.ALIGN_CENTER_VERTICAL, 0)
parent.Bind(wx.EVT_BUTTON, obj.select_event, button) parent.Bind(wx.EVT_BUTTON, obj.select_event, button)
# Right padding. # Right padding.
sub_sizer.AddSpacer(padding) sub_sizer.AddSpacer(padding)
# Add to the main sizer (followed by stretchable spacing). # Add to the main sizer (followed by stretchable spacing).
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._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 from the TextCtrl. # Clear the value from the TextCtrl.
self._field.Clear() self._field.Clear()
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. 4 change blocks. 
4 lines changed or deleted 8 lines changed or added

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