mailr13875 - /branches/gui_testing/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 July 26, 2011 - 12:04:
Author: bugman
Date: Tue Jul 26 12:04:16 2011
New Revision: 13875

URL: http://svn.gna.org/viewcvs/relax?rev=13875&view=rev
Log:
Better layout of the spectra list GUI element.

The minimum height is now being set and there is no longer spacing below the 
list.


Modified:
    branches/gui_testing/gui/components/spectrum.py

Modified: branches/gui_testing/gui/components/spectrum.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/components/spectrum.py?rev=13875&r1=13874&r2=13875&view=diff
==============================================================================
--- branches/gui_testing/gui/components/spectrum.py (original)
+++ branches/gui_testing/gui/components/spectrum.py Tue Jul 26 12:04:16 2011
@@ -96,7 +96,6 @@
         # Initialise the element.
         box_centre.AddSpacer(self.spacing)
         self.init_element(box_centre)
-        box_centre.AddSpacer(self.spacing)
 
         # Build the element.
         self.build_element()
@@ -143,6 +142,7 @@
             self.element.DeleteColumn(i)
 
         # Expand the number of rows to match the number of spectrum IDs, and 
add the IDs.
+        n = 0
         if hasattr(cdp, 'spectrum_ids'):
             # The number of IDs.
             n = len(cdp.spectrum_ids)
@@ -170,6 +170,11 @@
         event = wx.PyCommandEvent(wx.EVT_SIZE.typeId, self.parent.GetId())
         wx.PostEvent(self.parent.GetEventHandler(), event)
 
+        # Set the minimum height.
+        height = self.height_base + self.height_char * n
+        self.element.SetMinSize((-1, height))
+        self.element.Layout()
+
         # Unfreeze.
         self.element.Thaw()
 
@@ -196,6 +201,10 @@
 
         # Properties.
         self.element.SetFont(font.normal)
+
+        # Store the base heights.
+        self.height_base = self.element.GetSize()[1]
+        self.height_char = self.element.GetCharHeight()
 
         # Bind some events.
         self.element.Bind(wx.EVT_SIZE, self.resize)




Related Messages


Powered by MHonArc, Updated Tue Jul 26 12:20:03 2011