mailr14218 - in /branches/gui_testing/gui/analyses: __init__.py auto_model_free.py auto_rx_base.py elements.py spin_ctrl.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on August 06, 2011 - 21:17:
Author: bugman
Date: Sat Aug  6 21:17:37 2011
New Revision: 14218

URL: http://svn.gna.org/viewcvs/relax?rev=14218&view=rev
Log:
Renamed the spin_ctrl module to elements to store all of the special analysis 
elements.


Added:
    branches/gui_testing/gui/analyses/elements.py
      - copied unchanged from r14211, 
branches/gui_testing/gui/analyses/spin_ctrl.py
Removed:
    branches/gui_testing/gui/analyses/spin_ctrl.py
Modified:
    branches/gui_testing/gui/analyses/__init__.py
    branches/gui_testing/gui/analyses/auto_model_free.py
    branches/gui_testing/gui/analyses/auto_rx_base.py

Modified: branches/gui_testing/gui/analyses/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/__init__.py?rev=14218&r1=14217&r2=14218&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/__init__.py (original)
+++ branches/gui_testing/gui/analyses/__init__.py Sat Aug  6 21:17:37 2011
@@ -51,10 +51,10 @@
            'auto_r2',
            'auto_rx_base',
            'base',
+           'elements',
            'relax_control',
            'results_analysis',
-           'results',
-           'spin_ctrl']
+           'results']
 
 
 class Analysis_controller:

Modified: branches/gui_testing/gui/analyses/auto_model_free.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/auto_model_free.py?rev=14218&r1=14217&r2=14218&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/auto_model_free.py (original)
+++ branches/gui_testing/gui/analyses/auto_model_free.py Sat Aug  6 21:17:37 
2011
@@ -42,7 +42,7 @@
 # relax GUI module imports.
 from gui.about import About_base
 from gui.analyses.base import Base_analysis
-from gui.analyses.spin_ctrl import Spin_ctrl
+from gui.analyses.elements import Spin_ctrl
 from gui.analyses.execute import Execute
 from gui.base_classes import Container
 from gui.components.relax_data import Relax_data_list

Modified: branches/gui_testing/gui/analyses/auto_rx_base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/auto_rx_base.py?rev=14218&r1=14217&r2=14218&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/auto_rx_base.py (original)
+++ branches/gui_testing/gui/analyses/auto_rx_base.py Sat Aug  6 21:17:37 2011
@@ -40,7 +40,7 @@
 # relax GUI module imports.
 from gui.analyses.base import Base_analysis, Spectral_error_type_page
 from gui.analyses.execute import Execute
-from gui.analyses.spin_ctrl import Spin_ctrl
+from gui.analyses.elements import Spin_ctrl
 from gui.base_classes import Container
 from gui.components.spectrum import Spectra_list
 from gui.filedialog import opendir

Removed: branches/gui_testing/gui/analyses/spin_ctrl.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/spin_ctrl.py?rev=14217&view=auto
==============================================================================
--- branches/gui_testing/gui/analyses/spin_ctrl.py (original)
+++ branches/gui_testing/gui/analyses/spin_ctrl.py (removed)
@@ -1,134 +1,0 @@
-###############################################################################
-#                                                                            
 #
-# Copyright (C) 2009 Michael Bieri                                           
 #
-# Copyright (C) 2010-2011 Edward d'Auvergne                                  
 #
-#                                                                            
 #
-# This file is part of the program relax.                                    
 #
-#                                                                            
 #
-# relax is free software; you can redistribute it and/or modify              
 #
-# it under the terms of the GNU General Public License as published by       
 #
-# the Free Software Foundation; either version 2 of the License, or          
 #
-# (at your option) any later version.                                        
 #
-#                                                                            
 #
-# relax is distributed in the hope that it will be useful,                   
 #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of             
 #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              
 #
-# GNU General Public License for more details.                               
 #
-#                                                                            
 #
-# You should have received a copy of the GNU General Public License          
 #
-# along with relax; if not, write to the Free Software                       
 #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
 #
-#                                                                            
 #
-###############################################################################
-
-# Module docstring.
-"""Module containing the base class for all frames."""
-
-# Python module imports.
-import wx
-
-# relax GUI module imports.
-from gui.fonts import font
-
-
-class Spin_ctrl:
-    """The analysis specific spin control."""
-
-    def __init__(self, box, parent, text="", default=0, min=0, max=1000, 
tooltip=None, control=wx.SpinCtrl, width_text=200, width_button=80, spacer=0):
-        """Create a text selection element using a spinner for the frame.
-
-        This consists of a horizontal layout with a static text element and 
a spin control
-
-        @param box:             The box element to pack the structure file 
selection GUI element into.
-        @type box:              wx.BoxSizer instance
-        @param parent:          The parent GUI element.
-        @type parent:           wx object
-        @keyword text:          The static text.
-        @type text:             str
-        @keyword default:       The default value of the control.
-        @type default:          int
-        @keyword min:           The minimum value allowed.
-        @type min:              int
-        @keyword max:           The maximum value allowed.
-        @type max:              int
-        @keyword tooltip:      The tooltip which appears on hovering over 
the text or spin control.
-        @type tooltip:         str
-        @keyword control:       The control class to use.
-        @type control:          wx.SpinCtrl derived class
-        @keyword width_text:    The width of the text element.
-        @type width_text:       int
-        @keyword width_button:  The width of the button.
-        @type width_button:     int
-        @keyword spacer:        The horizontal spacing between the elements.
-        @type spacer:           int
-        @return:                The text control object.
-        @rtype:                 control object
-        """
-
-        # Horizontal packing for this element.
-        sizer = wx.BoxSizer(wx.HORIZONTAL)
-
-        # The label.
-        self.label = wx.StaticText(parent, -1, text)
-        self.label.SetMinSize((width_text, -1))
-        self.label.SetFont(font.normal)
-        sizer.Add(self.label, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 
0)
-
-        # The size for all elements, based on this text.
-        size = self.label.GetSize()
-        size_horizontal = size[1] + 8
-
-        # Spacer.
-        sizer.AddSpacer((spacer, -1))
-
-        # The spin control.
-        self.control = control(parent, -1, text, min=min, max=max)
-        self.control.SetFont(font.normal)
-        sizer.Add(self.control, 1, wx.ALIGN_CENTER_VERTICAL, 0)
-
-        # Spacer.
-        sizer.AddSpacer((spacer, -1))
-
-        # No button, so add a spacer.
-        sizer.AddSpacer((width_button, -1))
-
-        # Tooltip.
-        if tooltip:
-            self.label.SetToolTipString(tooltip)
-            self.control.SetToolTipString(tooltip)
-
-        # Add the element to the box.
-        box.Add(sizer, 0, wx.ALL|wx.EXPAND, 0)
-
-
-    def Enable(self, enable=True):
-        """Enable or disable the window for user input.
-
-        @keyword enable:    The flag specifying if the control should be 
enabled or disabled.
-        @type enable:       bool
-        """
-
-        # Call the control's method.
-        self.control.Enable(enable)
-
-
-    def GetValue(self):
-        """Set the value of the control.
-
-        @return:    The value of the spin control.
-        @rtype:     int
-        """
-
-        # Get the value from the spin control.
-        return self.control.GetValue()
-
-
-    def SetValue(self, value):
-        """Set the value of the control.
-
-        @param value:   The value to set the spin control to.
-        @type value:    int
-        """
-
-        # Set the value of the spin control.
-        return self.control.SetValue(value)




Related Messages


Powered by MHonArc, Updated Sat Aug 06 22:00:02 2011