dabo Commit
Revision 2929
Date: 2007-03-17 12:22:59 -0700 (Sat, 17 Mar 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/2929

Changed:
U   trunk/dabo/ui/uiwx/dPemMixin.py

Log:
Fixed setHeight and setWidth to not change the opposite dimension to a fixed 
value. Instead, -1 is passed which tells wxPython to not change it from the 
current value, but also that wxPython can still automatically adjust it when
necessary, such as when we've zoomed in on the font.

Previously, setting a fixed width on a textbox also would set a fixed height,
and when we zoomed in, the textbox wouldn't grow in height to accommodate the
increased font size.

Originally, I thought the growing behavior was dependent on having a sizer
that could grow, but today I discovered it was dependent on not having a 
fixed size set on the object. 


Diff:
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py     2007-03-17 19:00:30 UTC (rev 2928)
+++ trunk/dabo/ui/uiwx/dPemMixin.py     2007-03-17 19:22:59 UTC (rev 2929)
@@ -1830,7 +1830,7 @@
 
        def _setHeight(self, val):
                if self._constructed():
-                       newSize = self.GetSize()[0], int(val)
+                       newSize = (-1, int(val))
                        if isinstance(self, (wx.Frame, wx.Dialog) ):
                                self.SetSize(newSize)
                        else:
@@ -2266,7 +2266,7 @@
 
        def _setWidth(self, val):
                if self._constructed():
-                       newSize = int(val), self.GetSize()[1]
+                       newSize = (int(val), -1)
                        if isinstance(self, (wx.Frame, wx.Dialog) ):
                                self.SetSize(newSize)
                        else:




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to