mailr12878 - /1.3/gui/components/spectrum.py


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

Header


Content

Posted by edward on June 07, 2011 - 16:19:
Author: bugman
Date: Tue Jun  7 16:19:42 2011
New Revision: 12878

URL: http://svn.gna.org/viewcvs/relax?rev=12878&view=rev
Log:
Added a title and nicer spacing for the relaxation peak lists GUI element.


Modified:
    1.3/gui/components/spectrum.py

Modified: 1.3/gui/components/spectrum.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/components/spectrum.py?rev=12878&r1=12877&r2=12878&view=diff
==============================================================================
--- 1.3/gui/components/spectrum.py (original)
+++ 1.3/gui/components/spectrum.py Tue Jun  7 16:19:42 2011
@@ -66,10 +66,15 @@
         self.parent = parent
         self.data = data
         self.label = label
-        self.box = box
+
+        # GUI variables.
+        self.spacing = 10
 
         # The number of rows.
         self.num_rows = 50
+
+        # Add peak list selection header.
+        self.peak_list_header(box)
 
         # Sizer
         sizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -112,7 +117,7 @@
         sizer.Add(button_sizer, 0, 0, 0)
 
         # Grid of peak list file names and relaxation time
-        self.peaklist = wx.grid.Grid(self.parent, -1, size=(1, 300))
+        self.peaklist = wx.grid.Grid(self.parent, -1, size=(1, 230))
 
         # Create entries
         self.peaklist.CreateGrid(self.num_rows, 2)
@@ -126,11 +131,13 @@
         # Bind some events.
         self.peaklist.Bind(wx.grid.EVT_GRID_EDITOR_SHOWN, self.editor)
 
-        # Add grid to sizer
+        # Add grid to sizer, with spacing.
         sizer.Add(self.peaklist, -1, wx.EXPAND, 0)
 
         # Pack box
+        box.AddSpacer(self.spacing)
         box.Add(sizer, 0, wx.EXPAND, 0)
+        box.AddSpacer(self.spacing)
 
 
     def editor(self, event):
@@ -246,6 +253,26 @@
                 error_message('Not all files could be loaded.')
 
 
+    def peak_list_header(self, box):
+        """Add header for peak list section
+
+        @param box:     The box element to pack the structure file selection 
GUI element into.
+        @type box:      wx.BoxSizer instance
+        """
+
+        # Horizontal packing for this element.
+        sizer = wx.BoxSizer(wx.HORIZONTAL)
+
+        # The label.
+        label = wx.StaticText(self.parent, -1, "\nData points:", 
style=wx.ALIGN_RIGHT)
+        label.SetMinSize((230, 40))
+        label.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
+        sizer.Add(label, 0, 
wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
+
+        # Add the element to the box.
+        box.Add(sizer, 0, wx.ADJUST_MINSIZE, 0)
+
+
     def sync_ds(self, upload=False):
         """Synchronise the rx analysis frame and the relax data store, both 
ways.
 




Related Messages


Powered by MHonArc, Updated Tue Jun 07 16:40:01 2011