"Fossies" - the Fresh Open Source Software Archive  

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

base_list.py  (relax-4.1.3.src.tar.bz2):base_list.py  (relax-5.0.0.src.tar.bz2)
skipping to change at line 31 skipping to change at line 31
############################################################################### ###############################################################################
# Module docstring. # Module docstring.
"""Module containing the base GUI element for listing things.""" """Module containing the base GUI element for listing things."""
# 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 gui.components.menu import build_menu_item from gui.components.menu import build_menu_item
from gui.fonts import font from gui.fonts import font
from gui.misc import add_border from gui.misc import add_border
from gui.string_conv import str_to_gui from gui.string_conv import str_to_gui
from gui.uf_objects import Uf_storage; uf_store = Uf_storage() from gui.uf_objects import Uf_storage; uf_store = Uf_storage()
from status import Status; status = Status() from status import Status; status = Status()
from user_functions.data import Uf_info; uf_info = Uf_info() from user_functions.data import Uf_info; uf_info = Uf_info()
class Base_list(object): class Base_list(object):
"""The GUI element for listing the software used in the analysis.""" """The GUI element for listing the software used in the analysis."""
skipping to change at line 171 skipping to change at line 172
button.SetFont(font.normal) button.SetFont(font.normal)
button.SetMinSize(self.button_size) button.SetMinSize(self.button_size)
# Add to the sizer. # Add to the sizer.
button_sizer.Add(button, 0, 0, 0) button_sizer.Add(button, 0, 0, 0)
# Bind the method. # Bind the method.
self.parent.Bind(wx.EVT_BUTTON, self.button_info[i]['method'], butto n) self.parent.Bind(wx.EVT_BUTTON, self.button_info[i]['method'], butto n)
# Set the tooltip. # Set the tooltip.
button.SetToolTipString(self.button_info[i]['tooltip']) button.SetToolTip(wx.ToolTip(self.button_info[i]['tooltip']))
# Store as a class object. # Store as a class object.
setattr(self, self.button_info[i]['object'], button) setattr(self, self.button_info[i]['object'], button)
# Spacing. # Spacing.
if self.button_spacing: if self.button_spacing:
button_sizer.AddSpacer(self.button_spacing) button_sizer.AddSpacer(self.button_spacing)
def build_element(self): def build_element(self):
"""Build the grid.""" """Build the grid."""
skipping to change at line 224 skipping to change at line 225
# The number of rows. # The number of rows.
n = self.element.GetItemCount() n = self.element.GetItemCount()
# Size of the header, plus a bit. # Size of the header, plus a bit.
head = self.height_char + 10 head = self.height_char + 10
# Size of the table central element. # Size of the table central element.
centre = (self.height_char + 6) * n centre = (self.height_char + 6) * n
# Size of the scrollbar for the end of the table. # Size of the scrollbar for the end of the table.
foot = wx.SystemSettings_GetMetric(wx.SYS_HSCROLL_Y) foot = wx.SystemSettings.GetMetric(wx.SYS_HSCROLL_Y)
# Sum. # Sum.
height = head + centre + foot height = head + centre + foot
# Set the minimum size, and force a redraw. # Set the minimum size, and force a redraw.
self.element.SetMinSize((-1, height)) self.element.SetMinSize((-1, height))
self.element.Layout() self.element.Layout()
# Unfreeze. # Unfreeze.
self.element.Thaw() self.element.Thaw()
skipping to change at line 355 skipping to change at line 356
# Initialise the menu. # Initialise the menu.
menu = wx.Menu() menu = wx.Menu()
# Loop over the menu items. # Loop over the menu items.
for i in range(len(popup_menus)): for i in range(len(popup_menus)):
# Alias. # Alias.
info = popup_menus[i] info = popup_menus[i]
# Add the menu item. # Add the menu item.
menu.AppendItem(build_menu_item(menu, id=info['id'], text=info['text '], icon=info['icon'])) build_menu_item(menu, id=info['id'], text=info['text'], icon=info['i con'])
# Bind clicks. # Bind clicks.
self.element.Bind(wx.EVT_MENU, info['method'], id=info['id']) self.element.Bind(wx.EVT_MENU, info['method'], id=info['id'])
# Pop up the menu. # Pop up the menu.
if status.show_gui: if status.show_gui:
self.element.PopupMenu(menu) self.element.PopupMenu(menu)
# Cleanup. # Cleanup.
menu.Destroy() menu.Destroy()
 End of changes. 4 change blocks. 
3 lines changed or deleted 4 lines changed or added

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