"Fossies" - the Fresh Open Source Software Archive  

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

uf_objects.py  (relax-4.1.3.src.tar.bz2):uf_objects.py  (relax-5.0.0.src.tar.bz2)
skipping to change at line 33 skipping to change at line 33
"""Module containing the special objects for auto-generating the GUI user functi ons and classes.""" """Module containing the special objects for auto-generating the GUI user functi ons and classes."""
# Python module imports. # Python module imports.
from re import search from re import search
import wx import wx
from wx import FD_OPEN, FD_SAVE from wx import FD_OPEN, FD_SAVE
from wx.lib import scrolledpanel from wx.lib import scrolledpanel
import sys import sys
# relax module imports. # relax module imports.
import dep_check
import lib.arg_check import lib.arg_check
from graphics import fetch_icon from graphics import fetch_icon
from gui.components.free_file_format import Free_file_format from gui.components.free_file_format import Free_file_format
from gui.components.menu import build_menu_item from gui.components.menu import build_menu_item
from gui.errors import gui_raise from gui.errors import gui_raise
from gui.fonts import font from gui.fonts import font
from gui.input_elements.bool import Selector_bool from gui.input_elements.bool import Selector_bool
from gui.input_elements.dir import Selector_dir from gui.input_elements.dir import Selector_dir
from gui.input_elements.file import Selector_file, Selector_file_multiple from gui.input_elements.file import Selector_file, Selector_file_multiple
from gui.input_elements.sequence import Sequence from gui.input_elements.sequence import Sequence
skipping to change at line 93 skipping to change at line 94
if search('\.', name): if search('\.', name):
class_name, uf_name = name.split('.') class_name, uf_name = name.split('.')
else: else:
class_name = None class_name = None
# Generate a sub menu. # Generate a sub menu.
if class_name: if class_name:
if class_name not in class_list: if class_name not in class_list:
# Add the last sub menu. # Add the last sub menu.
if class_item != None: if class_item != None:
menu.AppendItem(class_item) if dep_check.wx_classic:
menu.AppendItem(class_item)
else:
menu.Append(class_item)
# Get the user function class data object. # Get the user function class data object.
class_data = uf_info.get_class(class_name) class_data = uf_info.get_class(class_name)
# Create the menu entry. # Create the menu entry.
class_item = build_menu_item(menu, id=-1, text=class_data.menu_t ext, icon=fetch_icon(class_data.gui_icon, size='16x16')) class_item = build_menu_item(menu, id=-1, text=class_data.menu_t ext, icon=fetch_icon(class_data.gui_icon, size='16x16'), append=False)
# Initialise the sub menu. # Initialise the sub menu.
sub_menu = wx.Menu() sub_menu = wx.Menu()
class_item.SetSubMenu(sub_menu) class_item.SetSubMenu(sub_menu)
# Add the class name to the list to block further sub menu creat ion. # Add the class name to the list to block further sub menu creat ion.
class_list.append(class_name) class_list.append(class_name)
# Create the user function menu entry. # Create the user function menu entry.
sub_menu.AppendItem(build_menu_item(sub_menu, id=uf_store[name]._uf_ id, text=data.menu_text, icon=fetch_icon(data.gui_icon, size='16x16'))) build_menu_item(sub_menu, id=uf_store[name]._uf_id, text=data.menu_t ext, icon=fetch_icon(data.gui_icon, size='16x16'))
# No sub menu. # No sub menu.
else: else:
# Add the last sub menu. # Add the last sub menu.
if class_item != None: if class_item != None:
menu.AppendItem(class_item) if dep_check.wx_classic:
menu.AppendItem(class_item)
else:
menu.Append(class_item)
class_item = None class_item = None
# The menu item. # The menu item.
menu.AppendItem(build_menu_item(menu, id=uf_store[name]._uf_id, text =data.menu_text, icon=fetch_icon(data.gui_icon, size='16x16'))) build_menu_item(menu, id=uf_store[name]._uf_id, text=data.menu_text, icon=fetch_icon(data.gui_icon, size='16x16'), append=True)
# New menu. # New menu.
if menu_index == 0 and not search(pattern, name): if menu_index == 0 and not search(pattern, name):
menu = menu2 menu = menu2
menu_index = 1 menu_index = 1
# Bind the menu item to the parent. # Bind the menu item to the parent.
parent.Bind(wx.EVT_MENU, parent.uf_call, id=uf_store[name]._uf_id) parent.Bind(wx.EVT_MENU, parent.uf_call, id=uf_store[name]._uf_id)
# Add the very last sub menu. # Add the very last sub menu.
if class_item != None: if class_item != None:
menu.AppendItem(class_item) if dep_check.wx_classic:
menu.AppendItem(class_item)
else:
menu.Append(class_item)
# Add the user function menu to the menu bar. # Add the user function menu to the menu bar.
title1 = "&User functions (a-m)" title1 = "&User functions (a-m)"
title2 = "&User functions (n-z)" title2 = "&User functions (n-z)"
menubar.Append(menu1, title1) menubar.Append(menu1, title1)
menubar.Append(menu2, title2) menubar.Append(menu2, title2)
# Return the menu IDs. # Return the menu IDs.
return [menubar.FindMenu(title1), menubar.FindMenu(title2)] return [menubar.FindMenu(title1), menubar.FindMenu(title2)]
skipping to change at line 683 skipping to change at line 693
text_types = [] text_types = []
# The user function name. # The user function name.
name = "The %s user function" % self.name name = "The %s user function" % self.name
text = wx.StaticText(panel, -1, name, style=wx.TE_MULTILINE) text = wx.StaticText(panel, -1, name, style=wx.TE_MULTILINE)
text.SetFont(font.subtitle) text.SetFont(font.subtitle)
text_elements.append(text) text_elements.append(text)
text_types.append('title') text_types.append('title')
# The text size, then spacing after the title. # The text size, then spacing after the title.
x, y = text.GetSizeTuple() x, y = text.GetSize()
tot_y += y tot_y += y
tot_y += spacing tot_y += spacing
# The synopsis. # The synopsis.
if self.uf_data.title: if self.uf_data.title:
# The text. # The text.
text = wx.StaticText(panel, -1, self.uf_data.title, style=wx.TE_MULT ILINE) text = wx.StaticText(panel, -1, self.uf_data.title, style=wx.TE_MULT ILINE)
# Formatting. # Formatting.
text.SetFont(font.normal_italic) text.SetFont(font.normal_italic)
# The text size. # The text size.
x, y = text.GetSizeTuple() x, y = text.GetSize()
tot_y += y tot_y += y
# The spacing after the element. # The spacing after the element.
tot_y += spacing tot_y += spacing
# Append the text objects. # Append the text objects.
text_elements.append(text) text_elements.append(text)
text_types.append('synopsis') text_types.append('synopsis')
# The description sections. # The description sections.
skipping to change at line 776 skipping to change at line 786
elif type in ['table', 'verbatim', 'prompt']: elif type in ['table', 'verbatim', 'prompt']:
text_obj.SetFont(font.modern_small) text_obj.SetFont(font.modern_small)
else: else:
text_obj.SetFont(font.normal) text_obj.SetFont(font.normal)
# Wrap the paragraphs and lists (with spacing for scrollbars ). # Wrap the paragraphs and lists (with spacing for scrollbars ).
if type in ['paragraph', 'list', 'item list']: if type in ['paragraph', 'list', 'item list']:
text_obj.Wrap(self._main_size - 20) text_obj.Wrap(self._main_size - 20)
# The text size. # The text size.
x, y = text_obj.GetSizeTuple() x, y = text_obj.GetSize()
tot_y += y tot_y += y
# The spacing after each element (except the last). # The spacing after each element (except the last).
tot_y += spacing tot_y += spacing
# The spacing before each section (not including the first). # The spacing before each section (not including the first).
if i != 0 and type == 'title': if i != 0 and type == 'title':
tot_y += spacing tot_y += spacing
# Append the text objects. # Append the text objects.
 End of changes. 10 change blocks. 
9 lines changed or deleted 19 lines changed or added

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