mailr12013 - /branches/bieri_gui/gui_bieri/analyses/auto_model_free.py


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

Header


Content

Posted by edward on December 28, 2010 - 23:36:
Author: bugman
Date: Tue Dec 28 23:36:07 2010
New Revision: 12013

URL: http://svn.gna.org/viewcvs/relax?rev=12013&view=rev
Log:
The virtual size of the auto-model-free about window is now being determined 
by its contents.

A temporary DC is created for this, and the contents placed in that DC.  The 
contents are later
created a second time, but in the correct DC.


Modified:
    branches/bieri_gui/gui_bieri/analyses/auto_model_free.py

Modified: branches/bieri_gui/gui_bieri/analyses/auto_model_free.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/analyses/auto_model_free.py?rev=12013&r1=12012&r2=12013&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/analyses/auto_model_free.py (original)
+++ branches/bieri_gui/gui_bieri/analyses/auto_model_free.py Tue Dec 28 
23:36:07 2010
@@ -122,6 +122,33 @@
                 if i < len(dauvergne_protocol.doc) and 
dauvergne_protocol.doc[i+1][0] == PARAGRAPH:
                     self.offset(10)
 
+
+    def virtual_size(self):
+        """Determine the virtual size of the window."""
+
+        # A temp window.
+        frame = wx.Frame(None, -1)
+        win = wx.Window(frame)
+
+        # A temp DC.
+        self.dc = wx.PaintDC(win)
+
+        # Build the widget within the temp DC.
+        self.build_widget()
+
+        # The virtual size.
+        self.virt_x = self.dim_x + 2*self.border
+        size_y = self.offset()
+        remainder = size_y - size_y / self.SCROLL_RATE * self.SCROLL_RATE
+        self.virt_y = size_y + remainder + self.border
+
+        # Destroy the temporary objects.
+        frame.Destroy()
+        win.Destroy()
+        self.dc.Destroy()
+
+        # Reset the offset.
+        self.offset(-self.offset())
 
 
 class Auto_model_free:




Related Messages


Powered by MHonArc, Updated Tue Dec 28 23:40:02 2010