def UpdateScrollPos(self, event):
if (event.Dragging() and self.SelectedElement is not None) or self.rubberBand.IsShown():
position = event.GetPosition()
move_window = wx.Point()
window_size = self.Editor.GetClientSize()
xstart, ystart = self.GetViewStart()
if position.x < SCROLL_ZONE and xstart > 0:
move_window.x = -1
elif position.x > window_size[0] - SCROLL_ZONE:
move_window.x = 1
if position.y < SCROLL_ZONE and ystart > 0:
move_window.y = -1
elif position.y > window_size[1] - SCROLL_ZONE:
move_window.y = 1
if move_window.x != 0 or move_window.y != 0:
self.RefreshVisibleElements(xp=xstart + move_window.x, yp=ystart + move_window.y)
self.Scroll(xstart + move_window.x, ystart + move_window.y)
self.RefreshScrollBars(move_window.x, move_window.y)
评论列表
文章目录