dabo Commit
Revision 5117
Date: 2009-03-07 07:07:18 -0800 (Sat, 07 Mar 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5117

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

Log:
Noticed some strange layout issues that would happen when scrolling a 
dScrollPanel that contained several aligned objects. Added a layout call; also 
refactored the two directional methods to call a common behavior method.


Diff:
Modified: trunk/dabo/ui/uiwx/dPanel.py
===================================================================
--- trunk/dabo/ui/uiwx/dPanel.py        2009-03-06 22:34:02 UTC (rev 5116)
+++ trunk/dabo/ui/uiwx/dPanel.py        2009-03-07 15:07:18 UTC (rev 5117)
@@ -221,15 +221,19 @@
 
        def scrollHorizontally(self, amt):
                """Change the horizontal scroll position by 'amt' units."""
-               x,y = self.GetViewStart()
-               self.Scroll(x+amt, y)
+               self._scroll(amt, 0)
 
 
        def scrollVertically(self, amt):
                """Change the vertical scroll position by 'amt' units."""
+               # Y scrolling is a negative change
+               self._scroll(0, -amt)
+
+
+       def _scroll(self, xOff, yOff):
                x,y = self.GetViewStart()
-               # Scrolling is reversed in the y-axis, so subtract
-               self.Scroll(x, y-amt)
+               self.Scroll(x+xOff, y+yOff)
+               dabo.ui.callAfterInterval(250, self.layout)
 
 
        def pageLeft(self):



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to