Delay part of the setup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -65,10 +65,13 @@ class ScrolledPanel( wx.PyScrolledWindow ):
|
|||||||
if rate_y:
|
if rate_y:
|
||||||
h += rate_y - (h % rate_y)
|
h += rate_y - (h % rate_y)
|
||||||
self.SetVirtualSize( (w, h) )
|
self.SetVirtualSize( (w, h) )
|
||||||
self.SetVirtualSizeHints( w, h )
|
self.SetScrollRate(rate_x, rate_y)
|
||||||
|
wx.CallAfter(self._SetupAfter) # scroll back to top after initial events
|
||||||
|
|
||||||
self.SetScrollRate(rate_x, rate_y)
|
|
||||||
wx.CallAfter(self.Scroll, 0, 0) # scroll back to top after initial events
|
def _SetupAfter(self):
|
||||||
|
self.SetVirtualSize(self.GetBestVirtualSize())
|
||||||
|
self.Scroll(0,0)
|
||||||
|
|
||||||
|
|
||||||
def OnChildFocus(self, evt):
|
def OnChildFocus(self, evt):
|
||||||
@@ -91,7 +94,6 @@ class ScrolledPanel( wx.PyScrolledWindow ):
|
|||||||
if cr.y < 0 and sppu_y > 0:
|
if cr.y < 0 and sppu_y > 0:
|
||||||
new_vs_y = vs_y + (cr.y / sppu_y)
|
new_vs_y = vs_y + (cr.y / sppu_y)
|
||||||
|
|
||||||
|
|
||||||
# For the right and bottom edges, scroll enough to show the
|
# For the right and bottom edges, scroll enough to show the
|
||||||
# whole control if possible, but if not just scroll such that
|
# whole control if possible, but if not just scroll such that
|
||||||
# the top/left edges are still visible
|
# the top/left edges are still visible
|
||||||
@@ -112,7 +114,6 @@ class ScrolledPanel( wx.PyScrolledWindow ):
|
|||||||
else:
|
else:
|
||||||
new_vs_y = vs_y + (cr.y / sppu_y)
|
new_vs_y = vs_y + (cr.y / sppu_y)
|
||||||
|
|
||||||
|
|
||||||
# if we need to adjust
|
# if we need to adjust
|
||||||
if new_vs_x != -1 or new_vs_y != -1:
|
if new_vs_x != -1 or new_vs_y != -1:
|
||||||
#print "%s: (%s, %s)" % (self.GetName(), new_vs_x, new_vs_y)
|
#print "%s: (%s, %s)" % (self.GetName(), new_vs_x, new_vs_y)
|
||||||
|
Reference in New Issue
Block a user