"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gui/analyses/elements/bool_element.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_element.py  (relax-4.1.3.src.tar.bz2):bool_element.py  (relax-5.0.0.src.tar.bz2)
############################################################################### ###############################################################################
# # # #
# Copyright (C) 2009-2010 Michael Bieri # # Copyright (C) 2009-2010 Michael Bieri #
# Copyright (C) 2009-2011,2013 Edward d'Auvergne # # Copyright (C) 2009-2011,2013,2016 Edward d'Auvergne #
# # # #
# This file is part of the program relax (http://www.nmr-relax.com). # # This file is part of the program relax (http://www.nmr-relax.com). #
# # # #
# This program is free software: you can redistribute it and/or modify # # This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by # # it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or # # the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. # # (at your option) any later version. #
# # # #
# This program is distributed in the hope that it will be useful, # # This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of # # but WITHOUT ANY WARRANTY; without even the implied warranty of #
skipping to change at line 31 skipping to change at line 31
############################################################################### ###############################################################################
# Module docstring. # Module docstring.
"""Module containing the base class for all frames.""" """Module containing the base class for all frames."""
# Python module imports. # Python module imports.
import wx import wx
import wx.lib.buttons import wx.lib.buttons
# relax module imports. # relax module imports.
import dep_check
from graphics import fetch_icon from graphics import fetch_icon
from gui.fonts import font from gui.fonts import font
from gui.string_conv import str_to_gui from gui.string_conv import str_to_gui
class Boolean_ctrl: class Boolean_ctrl:
"""The analysis specific text control. """The analysis specific text control.
This consists of three elements: wx.StaticText, wx.TextCtrl, and wx.Button. This consists of three elements: wx.StaticText, wx.TextCtrl, and wx.Button.
""" """
skipping to change at line 87 skipping to change at line 88
self.label = wx.StaticText(parent, -1, text) self.label = wx.StaticText(parent, -1, text)
self.label.SetMinSize((width_text, -1)) self.label.SetMinSize((width_text, -1))
self.label.SetFont(font.normal) self.label.SetFont(font.normal)
sizer.Add(self.label, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) sizer.Add(self.label, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
# The size for all elements, based on this text. # The size for all elements, based on this text.
size = self.label.GetSize() size = self.label.GetSize()
size_horizontal = size[1] + 8 size_horizontal = size[1] + 8
# Spacer. # Spacer.
sizer.AddSpacer((spacer, -1)) if dep_check.wx_classic:
sizer.AddSpacer((spacer, -1))
else:
sizer.AddSpacer(spacer)
# The text input field. # The text input field.
self.field = control(parent, -1, str_to_gui(default)) self.field = control(parent, -1, str_to_gui(default))
self.field.SetMinSize((-1, size_horizontal)) self.field.SetMinSize((-1, size_horizontal))
self.field.SetFont(font.normal) self.field.SetFont(font.normal)
colour = parent.GetBackgroundColour() colour = parent.GetBackgroundColour()
self.field.SetOwnBackgroundColour(colour) self.field.SetOwnBackgroundColour(colour)
sizer.Add(self.field, 1, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) sizer.Add(self.field, 1, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
# Spacer. # Spacer.
sizer.AddSpacer((spacer, -1)) if dep_check.wx_classic:
sizer.AddSpacer((spacer, -1))
else:
sizer.AddSpacer(spacer)
# Add the button. # Add the button.
self.button = wx.lib.buttons.ThemedGenBitmapTextButton(parent, -1, None, str_to_gui(button_text)) self.button = wx.lib.buttons.ThemedGenBitmapTextButton(parent, -1, None, str_to_gui(button_text))
if default == True: if default == True:
self.button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.medi a-record-relax-green'), wx.BITMAP_TYPE_ANY)) self.button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.medi a-record-relax-green'), wx.BITMAP_TYPE_ANY))
else: else:
self.button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.medi a-record'), wx.BITMAP_TYPE_ANY)) self.button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.medi a-record'), wx.BITMAP_TYPE_ANY))
self.button.SetMinSize((width_button, size_horizontal)) self.button.SetMinSize((width_button, size_horizontal))
self.button.SetFont(font.normal) self.button.SetFont(font.normal)
parent.Bind(wx.EVT_BUTTON, self.toggle, self.button) parent.Bind(wx.EVT_BUTTON, self.toggle, self.button)
sizer.Add(self.button, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) sizer.Add(self.button, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
# Add the element to the box. # Add the element to the box.
box.Add(sizer, 0, wx.ALL|wx.EXPAND, 0) box.Add(sizer, 0, wx.ALL|wx.EXPAND, 0)
# Tooltip. # Tooltip.
if tooltip: if tooltip:
self.label.SetToolTipString(tooltip) self.label.SetToolTip(wx.ToolTip(tooltip))
self.field.SetToolTipString(tooltip) self.field.SetToolTip(wx.ToolTip(tooltip))
if tooltip_button: if tooltip_button:
self.button.SetToolTipString(tooltip_button) self.button.SetToolTip(wx.ToolTip(tooltip_button))
def Enable(self, enable=True): def Enable(self, enable=True):
"""Enable or disable the element for user input. """Enable or disable the element for user input.
@keyword enable: The flag specifying if the element should be enabled or disabled. @keyword enable: The flag specifying if the element should be enabled or disabled.
@type enable: bool @type enable: bool
""" """
# Call the button method. # Call the button method.
self.button.Enable(enable) self.button.Enable(enable)
 End of changes. 6 change blocks. 
6 lines changed or deleted 13 lines changed or added

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