"Fossies" - the Fresh Open Source Software Archive  

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

free_file_format.py  (relax-4.1.3.src.tar.bz2):free_file_format.py  (relax-5.0.0.src.tar.bz2)
skipping to change at line 29 skipping to change at line 29
# along with this program. If not, see <http://www.gnu.org/licenses/>. # # along with this program. If not, see <http://www.gnu.org/licenses/>. #
# # # #
############################################################################### ###############################################################################
# Python module imports. # Python module imports.
import wx import wx
from wx.lib import buttons from wx.lib import buttons
# relax module imports. # relax module imports.
from data_store import Relax_data_store; ds = Relax_data_store() from data_store import Relax_data_store; ds = Relax_data_store()
import dep_check
from graphics import IMAGE_PATH, fetch_icon from graphics import IMAGE_PATH, fetch_icon
from gui.fonts import font from gui.fonts import font
from gui.icons import Relax_icons from gui.icons import Relax_icons
from gui.input_elements.value import Value from gui.input_elements.value import Value
from gui.message import Question from gui.message import Question
from gui.misc import bitmap_setup from gui.misc import bitmap_setup
from gui.string_conv import gui_to_int, gui_to_str, int_to_gui, str_to_gui from gui.string_conv import gui_to_int, gui_to_str, int_to_gui, str_to_gui
from gui.wizards.wiz_objects import Wiz_page from gui.wizards.wiz_objects import Wiz_page
from lib.errors import RelaxError from lib.errors import RelaxError
from status import Status; status = Status() from status import Status; status = Status()
skipping to change at line 150 skipping to change at line 151
self.set_vals() self.set_vals()
# Buttons! # Buttons!
if self.save_flag or self.reset_flag: if self.save_flag or self.reset_flag:
# Add a save button. # Add a save button.
if self.save_flag: if self.save_flag:
# Build the button. # Build the button.
button = buttons.ThemedGenBitmapTextButton(self.parent, -1, None , "") button = buttons.ThemedGenBitmapTextButton(self.parent, -1, None , "")
button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.docum ent-save', "22x22"), wx.BITMAP_TYPE_ANY)) button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.docum ent-save', "22x22"), wx.BITMAP_TYPE_ANY))
button.SetFont(font.normal) button.SetFont(font.normal)
button.SetToolTipString("Save the free file format settings with in the relax data store.") button.SetToolTip(wx.ToolTip("Save the free file format settings within the relax data store."))
button.SetMinSize(self.size_square_button) button.SetMinSize(self.size_square_button)
# Add the button. # Add the button.
button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0)
# Padding. # Padding.
button_sizer.AddSpacer(self.padding) button_sizer.AddSpacer(self.padding)
# Bind the click event. # Bind the click event.
self.parent.Bind(wx.EVT_BUTTON, self.save, button) self.parent.Bind(wx.EVT_BUTTON, self.save, button)
# Add a reset button. # Add a reset button.
if self.reset_flag: if self.reset_flag:
# Build the button. # Build the button.
button = buttons.ThemedGenBitmapTextButton(self.parent, -1, None , "") button = buttons.ThemedGenBitmapTextButton(self.parent, -1, None , "")
button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.edit- delete', "22x22"), wx.BITMAP_TYPE_ANY)) button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.edit- delete', "22x22"), wx.BITMAP_TYPE_ANY))
button.SetFont(font.normal) button.SetFont(font.normal)
button.SetToolTipString("Reset the free file format settings to the original values.") button.SetToolTip(wx.ToolTip("Reset the free file format setting s to the original values."))
button.SetMinSize(self.size_square_button) button.SetMinSize(self.size_square_button)
# Add the button. # Add the button.
button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0)
# Bind the click event. # Bind the click event.
self.parent.Bind(wx.EVT_BUTTON, self.reset, button) self.parent.Bind(wx.EVT_BUTTON, self.reset, button)
# Add the button sizer to the widget (with spacing). # Add the button sizer to the widget (with spacing).
main_sizer.AddSpacer(self.padding) main_sizer.AddSpacer(self.padding)
skipping to change at line 201 skipping to change at line 202
text = wx.StaticText(self.parent, -1, "Free format file settings", style =wx.ALIGN_LEFT) text = wx.StaticText(self.parent, -1, "Free format file settings", 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 self.divider: if not self.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((self.divider - x, 0)) if dep_check.wx_classic:
sub_sizer.AddSpacer((self.divider - x, 0))
else:
sub_sizer.AddSpacer(self.divider - x)
# Initialise the text input field. # Initialise the text input field.
self.field = wx.TextCtrl(self.parent, -1, '') self.field = wx.TextCtrl(self.parent, -1, '')
self.field.SetEditable(False) self.field.SetEditable(False)
colour = self.parent.GetBackgroundColour() colour = self.parent.GetBackgroundColour()
self.field.SetOwnBackgroundColour(colour) self.field.SetOwnBackgroundColour(colour)
self.field.SetMinSize((50, self.height_element)) self.field.SetMinSize((50, self.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)
# A little spacing. # A little spacing.
sub_sizer.AddSpacer(5) sub_sizer.AddSpacer(5)
# The edit button. # The edit button.
button = wx.BitmapButton(self.parent, -1, wx.Bitmap(fetch_icon("oxygen.a ctions.document-properties"), wx.BITMAP_TYPE_ANY)) button = wx.BitmapButton(self.parent, -1, wx.Bitmap(fetch_icon("oxygen.a ctions.document-properties"), wx.BITMAP_TYPE_ANY))
button.SetMinSize((self.height_element, self.height_element)) button.SetMinSize((self.height_element, self.height_element))
button.SetToolTipString("Open the free file format editing window.") button.SetToolTip(wx.ToolTip("Open the free file format editing window." ))
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)
self.parent.Bind(wx.EVT_BUTTON, self.open_window, button) self.parent.Bind(wx.EVT_BUTTON, self.open_window, button)
# Right padding. # Right padding.
sub_sizer.AddSpacer(self.padding) sub_sizer.AddSpacer(self.padding)
# Add to the main sizer. # Add to the main sizer.
self.sizer.Add(sub_sizer, 1, wx.EXPAND|wx.ALL, 0) self.sizer.Add(sub_sizer, 1, wx.EXPAND|wx.ALL, 0)
# Spacing below the widget. # Spacing below the widget.
if self.spacer == None: if self.spacer == None:
self.sizer.AddStretchSpacer() self.sizer.AddStretchSpacer()
else: else:
self.sizer.AddSpacer(self.spacer) self.sizer.AddSpacer(self.spacer)
# Tooltip. # Tooltip.
tooltip = "The free file format settings." tooltip = "The free file format settings."
text.SetToolTipString(tooltip) text.SetToolTip(wx.ToolTip(tooltip))
self.field.SetToolTipString(tooltip) self.field.SetToolTip(wx.ToolTip(tooltip))
# Set the values. # Set the values.
self.set_vals() self.set_vals()
def GetValue(self): def GetValue(self):
"""Return the free file format settings as a keyword dictionary. """Return the free file format settings as a keyword dictionary.
@return: The dictionary of free file format settings. @return: The dictionary of free file format settings.
@rtype: dict @rtype: dict
""" """
skipping to change at line 589 skipping to change at line 593
""" """
# Create a horizontal layout for the buttons. # Create a horizontal layout for the buttons.
button_sizer = wx.BoxSizer(wx.HORIZONTAL) button_sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(button_sizer, 0, wx.ALIGN_CENTER|wx.ALL, 0) sizer.Add(button_sizer, 0, wx.ALIGN_CENTER|wx.ALL, 0)
# The save button. # The save button.
button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Sav e") button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Sav e")
button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.document-save ', "22x22"), wx.BITMAP_TYPE_ANY)) button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.document-save ', "22x22"), wx.BITMAP_TYPE_ANY))
button.SetFont(font.normal) button.SetFont(font.normal)
button.SetToolTipString("Save the free file format settings within the r elax data store.") button.SetToolTip(wx.ToolTip("Save the free file format settings within the relax data store."))
button.SetMinSize(self.SIZE_BUTTON) button.SetMinSize(self.SIZE_BUTTON)
button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0)
self.Bind(wx.EVT_BUTTON, self.save, button) self.Bind(wx.EVT_BUTTON, self.save, button)
# Spacer. # Spacer.
button_sizer.AddSpacer(20) button_sizer.AddSpacer(20)
# The reset button. # The reset button.
button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Res et") button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Res et")
button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.edit-delete', "22x22"), wx.BITMAP_TYPE_ANY)) button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.edit-delete', "22x22"), wx.BITMAP_TYPE_ANY))
button.SetFont(font.normal) button.SetFont(font.normal)
button.SetToolTipString("Reset the free file format settings to the orig inal values.") button.SetToolTip(wx.ToolTip("Reset the free file format settings to the original values."))
button.SetMinSize(self.SIZE_BUTTON) button.SetMinSize(self.SIZE_BUTTON)
button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0)
self.Bind(wx.EVT_BUTTON, self.reset, button) self.Bind(wx.EVT_BUTTON, self.reset, button)
# Spacer. # Spacer.
button_sizer.AddSpacer(20) button_sizer.AddSpacer(20)
# The cancel button. # The cancel button.
button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Can cel") button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Can cel")
button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.dialog-cancel ', "22x22"), wx.BITMAP_TYPE_ANY)) button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.dialog-cancel ', "22x22"), wx.BITMAP_TYPE_ANY))
 End of changes. 8 change blocks. 
8 lines changed or deleted 12 lines changed or added

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