"Fossies" - the Fresh Open Source Software Archive  

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

controller.py  (relax-4.1.3.src.tar.bz2):controller.py  (relax-5.0.0.src.tar.bz2)
############################################################################### ###############################################################################
# # # #
# Copyright (C) 2010 Michael Bieri # # Copyright (C) 2010 Michael Bieri #
# Copyright (C) 2010-2014 Edward d'Auvergne # # Copyright (C) 2010-2014,2019 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 32 skipping to change at line 32
# Module docstring. # Module docstring.
"""Log window of relax GUI controlling all calculations.""" """Log window of relax GUI controlling all calculations."""
# Python module imports. # Python module imports.
import sys import sys
import wx import wx
import wx.stc import wx.stc
# relax module imports. # relax module imports.
import dep_check
from graphics import IMAGE_PATH, fetch_icon from graphics import IMAGE_PATH, fetch_icon
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.icons import Relax_icons from gui.icons import Relax_icons
from gui.misc import add_border, bitmap_setup from gui.misc import add_border, bitmap_setup
from gui.string_conv import str_to_gui from gui.string_conv import str_to_gui
from info import Info_box from info import Info_box
from lib.compat import Queue from lib.compat import Queue
from lib.io import SplitIO from lib.io import SplitIO
from pipe_control.pipes import cdp_name from pipe_control.pipes import cdp_name
skipping to change at line 184 skipping to change at line 185
sub_sizer.Add(gauge, 3, wx.EXPAND|wx.ALL, 0) sub_sizer.Add(gauge, 3, wx.EXPAND|wx.ALL, 0)
# Add the sizer. # Add the sizer.
sizer.Add(sub_sizer, 0, wx.ALL|wx.EXPAND, 0) sizer.Add(sub_sizer, 0, wx.ALL|wx.EXPAND, 0)
# Spacing. # Spacing.
sizer.AddSpacer(self.spacer) sizer.AddSpacer(self.spacer)
# Tooltip. # Tooltip.
if tooltip: if tooltip:
text.SetToolTipString(tooltip) text.SetToolTip(wx.ToolTip(tooltip))
gauge.SetToolTipString(tooltip) gauge.SetToolTip(wx.ToolTip(tooltip))
# Return the gauge. # Return the gauge.
return gauge return gauge
def add_relax_logo(self, sizer): def add_relax_logo(self, sizer):
"""Add the relax logo to the sizer. """Add the relax logo to the sizer.
@param sizer: The sizer element to pack the relax logo into. @param sizer: The sizer element to pack the relax logo into.
@type sizer: wx.Sizer instance @type sizer: wx.Sizer instance
""" """
skipping to change at line 245 skipping to change at line 246
sub_sizer.Add(field, 3, wx.ALIGN_CENTER_VERTICAL, 0) sub_sizer.Add(field, 3, wx.ALIGN_CENTER_VERTICAL, 0)
# Add the sizer. # Add the sizer.
sizer.Add(sub_sizer, 0, wx.ALL|wx.EXPAND, 0) sizer.Add(sub_sizer, 0, wx.ALL|wx.EXPAND, 0)
# Spacing. # Spacing.
sizer.AddSpacer(self.spacer) sizer.AddSpacer(self.spacer)
# Tooltip. # Tooltip.
if tooltip: if tooltip:
text.SetToolTipString(tooltip) text.SetToolTip(wx.ToolTip(tooltip))
field.SetToolTipString(tooltip) field.SetToolTip(wx.ToolTip(tooltip))
# Handle key events. # Handle key events.
field.Bind(wx.EVT_KEY_DOWN, self.handler_key_down) field.Bind(wx.EVT_KEY_DOWN, self.handler_key_down)
# Return the control. # Return the control.
return field return field
def analysis_key(self): def analysis_key(self):
"""Return the key for the current analysis' status object. """Return the key for the current analysis' status object.
skipping to change at line 627 skipping to change at line 628
# Flag for scrolling to the bottom. # Flag for scrolling to the bottom.
self.at_end = True self.at_end = True
# Turn on line wrapping. # Turn on line wrapping.
self.SetWrapMode(wx.stc.STC_WRAP_WORD) self.SetWrapMode(wx.stc.STC_WRAP_WORD)
# Create the standard style (style num 0). # Create the standard style (style num 0).
self.StyleSetFont(0, font.modern_small) self.StyleSetFont(0, font.modern_small)
# Create the STDERR style (style num 1). # Create the STDERR style (style num 1).
self.StyleSetForeground(1, wx.NamedColour('red')) if dep_check.wx_classic:
colour = wx.NamedColour('red')
else:
colour = wx.Colour('red')
self.StyleSetForeground(1, colour)
self.StyleSetFont(1, font.modern_small) self.StyleSetFont(1, font.modern_small)
# Create the relax prompt style (style num 2). # Create the relax prompt style (style num 2).
self.StyleSetForeground(2, wx.NamedColour('blue')) if dep_check.wx_classic:
colour = wx.NamedColour('blue')
else:
colour = wx.Colour('blue')
self.StyleSetForeground(2, colour)
self.StyleSetFont(2, font.modern_small_bold) self.StyleSetFont(2, font.modern_small_bold)
# Create the relax warning style (style num 3). # Create the relax warning style (style num 3).
self.StyleSetForeground(3, wx.NamedColour('orange red')) if dep_check.wx_classic:
colour = wx.NamedColour('orange red')
else:
colour = wx.Colour('orange red')
self.StyleSetForeground(3, colour)
self.StyleSetFont(3, font.modern_small) self.StyleSetFont(3, font.modern_small)
# Create the relax debugging style (style num 4). # Create the relax debugging style (style num 4).
self.StyleSetForeground(4, wx.NamedColour('dark green')) if dep_check.wx_classic:
colour = wx.NamedColour('dark green')
else:
colour = wx.Colour('dark green')
self.StyleSetForeground(4, colour)
self.StyleSetFont(4, font.modern_small) self.StyleSetFont(4, font.modern_small)
# Initilise the find dialog. # Initilise the find dialog.
self.find_dlg = None self.find_dlg = None
# The data for the find dialog. # The data for the find dialog.
self.find_data = wx.FindReplaceData() self.find_data = wx.FindReplaceData()
self.find_data.SetFlags(wx.FR_DOWN) self.find_data.SetFlags(wx.FR_DOWN)
# Turn off the pop up menu. # Turn off the pop up menu.
skipping to change at line 1085 skipping to change at line 1102
"""Override the StyledTextCtrl pop up menu. """Override the StyledTextCtrl pop up menu.
@param event: The wx event. @param event: The wx event.
@type event: wx event @type event: wx event
""" """
# Create the menu. # Create the menu.
menu = wx.Menu() menu = wx.Menu()
# Add the entries. # Add the entries.
menu.AppendItem(build_menu_item(menu, id=MENU_ID_FIND, text="&Find", ico n=fetch_icon('oxygen.actions.edit-find', "16x16"))) build_menu_item(menu, id=MENU_ID_FIND, text="&Find", icon=fetch_icon('ox ygen.actions.edit-find', "16x16"))
menu.AppendSeparator() menu.AppendSeparator()
menu.AppendItem(build_menu_item(menu, id=MENU_ID_COPY, text="&Copy", ico build_menu_item(menu, id=MENU_ID_COPY, text="&Copy", icon=fetch_icon('ox
n=fetch_icon('oxygen.actions.edit-copy', "16x16"))) ygen.actions.edit-copy', "16x16"))
menu.AppendItem(build_menu_item(menu, id=MENU_ID_SELECT_ALL, text="&Sele build_menu_item(menu, id=MENU_ID_SELECT_ALL, text="&Select all", icon=fe
ct all", icon=fetch_icon('oxygen.actions.edit-select-all', "16x16"))) tch_icon('oxygen.actions.edit-select-all', "16x16"))
menu.AppendSeparator() menu.AppendSeparator()
menu.AppendItem(build_menu_item(menu, id=MENU_ID_ZOOM_IN, text="Zoom &in build_menu_item(menu, id=MENU_ID_ZOOM_IN, text="Zoom &in", icon=fetch_ic
", icon=fetch_icon('oxygen.actions.zoom-in', "16x16"))) on('oxygen.actions.zoom-in', "16x16"))
menu.AppendItem(build_menu_item(menu, id=MENU_ID_ZOOM_OUT, text="Zoom &o build_menu_item(menu, id=MENU_ID_ZOOM_OUT, text="Zoom &out", icon=fetch_
ut", icon=fetch_icon('oxygen.actions.zoom-out', "16x16"))) icon('oxygen.actions.zoom-out', "16x16"))
menu.AppendItem(build_menu_item(menu, id=MENU_ID_ZOOM_ORIG, text="Origin build_menu_item(menu, id=MENU_ID_ZOOM_ORIG, text="Original &zoom", icon=
al &zoom", icon=fetch_icon('oxygen.actions.zoom-original', "16x16"))) fetch_icon('oxygen.actions.zoom-original', "16x16"))
menu.AppendSeparator() menu.AppendSeparator()
menu.AppendItem(build_menu_item(menu, id=MENU_ID_GOTO_START, text="&Go t build_menu_item(menu, id=MENU_ID_GOTO_START, text="&Go to start", icon=f
o start", icon=fetch_icon('oxygen.actions.go-top', "16x16"))) etch_icon('oxygen.actions.go-top', "16x16"))
menu.AppendItem(build_menu_item(menu, id=MENU_ID_GOTO_END, text="&Go to build_menu_item(menu, id=MENU_ID_GOTO_END, text="&Go to end", icon=fetch
end", icon=fetch_icon('oxygen.actions.go-bottom', "16x16"))) _icon('oxygen.actions.go-bottom', "16x16"))
# Pop up the menu. # Pop up the menu.
if status.show_gui: if status.show_gui:
self.PopupMenu(menu) self.PopupMenu(menu)
# Cleanup. # Cleanup.
menu.Destroy() menu.Destroy()
def write(self): def write(self):
"""Write the text in the log queue to the log control.""" """Write the text in the log queue to the log control."""
 End of changes. 12 change blocks. 
24 lines changed or deleted 41 lines changed or added

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