libgui/GuiCanvasPanel.py:{onPanelScroll,__init__}(): reset cursor on EVT_SCROLLWIN_LINE{DOWN,UP}.

This commit is contained in:
Lucio Andrés Illanes Albornoz 2019-09-09 19:03:14 +02:00
parent 3b47b4afa9
commit c88d2221e2

View File

@ -131,6 +131,15 @@ class GuiCanvasPanel(wx.ScrolledWindow):
def onPanelSize(self, event): def onPanelSize(self, event):
self._updateScrollBars(); event.Skip(); self._updateScrollBars(); event.Skip();
# }}} # }}}
# {{{ onPanelScroll(self, event)
def onPanelScroll(self, event):
if self.canvas.dirtyCursor:
viewRect = self.GetViewStart()
eventDc = self.backend.getDeviceContext(self, viewRect)
self.backend.drawCursorMaskWithJournal(self.canvas.journal, eventDc, viewRect)
self.canvas.dirtyCursor = False
event.Skip()
# }}}
# #
# __init__(self, parent, parentFrame, backend, canvas, defaultCanvasPos, defaultCanvasSize, defaultCellSize, interface): initialisation method # __init__(self, parent, parentFrame, backend, canvas, defaultCanvasPos, defaultCanvasSize, defaultCellSize, interface): initialisation method
@ -149,6 +158,8 @@ class GuiCanvasPanel(wx.ScrolledWindow):
for eventType in (wx.EVT_LEFT_DOWN, wx.EVT_MOTION, wx.EVT_RIGHT_DOWN): for eventType in (wx.EVT_LEFT_DOWN, wx.EVT_MOTION, wx.EVT_RIGHT_DOWN):
self.Bind(eventType, self.onPanelInput) self.Bind(eventType, self.onPanelInput)
self.Bind(wx.EVT_PAINT, self.onPanelPaint) self.Bind(wx.EVT_PAINT, self.onPanelPaint)
self.Bind(wx.EVT_SCROLLWIN_LINEDOWN, self.onPanelScroll)
self.Bind(wx.EVT_SCROLLWIN_LINEUP, self.onPanelScroll)
self.Bind(wx.EVT_SIZE, self.onPanelSize) self.Bind(wx.EVT_SIZE, self.onPanelSize)
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120 # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120