mailr13823 - /branches/gui_testing/gui/analyses/base.py


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

Header


Content

Posted by edward on July 22, 2011 - 11:51:
Author: bugman
Date: Fri Jul 22 11:51:25 2011
New Revision: 13823

URL: http://svn.gna.org/viewcvs/relax?rev=13823&view=rev
Log:
The virtual width of the analysis GUI elements now matches the real width.

The horizontal scrollbar has also been disabled.


Modified:
    branches/gui_testing/gui/analyses/base.py

Modified: branches/gui_testing/gui/analyses/base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/base.py?rev=13823&r1=13822&r2=13823&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/base.py (original)
+++ branches/gui_testing/gui/analyses/base.py Fri Jul 22 11:51:25 2011
@@ -71,6 +71,9 @@
         # Execute the base class method.
         super(Base_analysis, self).__init__(*args, **kwds)
 
+        # Determine the size of the scrollers.
+        self.width_vscroll = wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X)
+
         # Pack a sizer into the panel.
         box_main = wx.BoxSizer(wx.HORIZONTAL)
         self.SetSizer(box_main)
@@ -83,7 +86,10 @@
 
         # Set up the scrolled panel.
         self.SetAutoLayout(True)
-        self.SetupScrolling(scroll_x=True, scroll_y=True)
+        self.SetupScrolling(scroll_x=False, scroll_y=True)
+
+        # Bind resize events.
+        self.Bind(wx.EVT_SIZE, self.resize)
 
 
     def add_button_open(self, box, parent, icon=paths.icon_16x16.open, 
text=" Change", fn=None, width=-1, height=-1):
@@ -531,6 +537,19 @@
         self.gui.show_tree(None)
 
 
+    def resize(self, event):
+        """The spin editor GUI element.
+
+        @param event:   The wx event.
+        @type event:    wx event
+        """
+
+        # Set the virtual size to have the width of the visible size and the 
height of the virtual size.
+        x = self.GetSize()[0] - self.width_vscroll
+        y = self.GetVirtualSize()[1]
+        self.SetVirtualSize((x, y))
+
+
     def spin_count(self):
         """Count the number of loaded spins, returning a string formatted as 
'xxx spins loaded'.
 




Related Messages


Powered by MHonArc, Updated Fri Jul 22 12:00:02 2011