mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-22 15:26:37 +00:00
MiRCART.py:MiRCARTTool{,Rect}: cleaned up.
This commit is contained in:
parent
16065401e8
commit
968d07050e
30
MiRCART.py
30
MiRCART.py
@ -130,10 +130,8 @@ class MiRCARTCanvas(wx.Panel):
|
|||||||
eventPoint = event.GetLogicalPosition(eventDc)
|
eventPoint = event.GetLogicalPosition(eventDc)
|
||||||
mapPoint = self._eventPointToMapPoint(eventPoint)
|
mapPoint = self._eventPointToMapPoint(eventPoint)
|
||||||
for tool in self.canvasTools:
|
for tool in self.canvasTools:
|
||||||
if event.Dragging():
|
mapPatches = tool.onMouseEvent(event, mapPoint, event.Dragging(), \
|
||||||
mapPatches = tool.onMouseMotion(event, mapPoint, event.LeftIsDown(), event.RightIsDown())
|
event.LeftIsDown(), event.RightIsDown())
|
||||||
else:
|
|
||||||
mapPatches = tool.onMouseDown(event, mapPoint, event.LeftIsDown(), event.RightIsDown())
|
|
||||||
self._processMapPatches(mapPatches, eventDc, tmpDc, mapPoint)
|
self._processMapPatches(mapPatches, eventDc, tmpDc, mapPoint)
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ onPaint(self, event): XXX
|
# {{{ onPaint(self, event): XXX
|
||||||
@ -206,12 +204,8 @@ class MiRCARTTool():
|
|||||||
"""XXX"""
|
"""XXX"""
|
||||||
parentCanvas = None
|
parentCanvas = None
|
||||||
|
|
||||||
# {{{ onMouseDown(self, event, mapPoint, isLeftDown, isRightDown): XXX
|
# {{{ onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): XXX
|
||||||
def onMouseDown(self, event, mapPoint, isLeftDown, isRightDown):
|
def onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown):
|
||||||
pass
|
|
||||||
# }}}
|
|
||||||
# {{{ onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown): XXX
|
|
||||||
def onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown):
|
|
||||||
pass
|
pass
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ __init__(self, parentCanvas): initialisation method
|
# {{{ __init__(self, parentCanvas): initialisation method
|
||||||
@ -222,8 +216,8 @@ class MiRCARTTool():
|
|||||||
class MiRCARTToolRect(MiRCARTTool):
|
class MiRCARTToolRect(MiRCARTTool):
|
||||||
"""XXX"""
|
"""XXX"""
|
||||||
|
|
||||||
# {{{ _draw(self, event, mapPoint, isLeftDown, isRightDown): XXX
|
# {{{ onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown): XXX
|
||||||
def _draw(self, event, mapPoint, isLeftDown, isRightDown):
|
def onMouseEvent(self, event, mapPoint, isDragging, isLeftDown, isRightDown):
|
||||||
if isLeftDown:
|
if isLeftDown:
|
||||||
return [[False, [[0, 0, \
|
return [[False, [[0, 0, \
|
||||||
self.parentCanvas.mircFg, \
|
self.parentCanvas.mircFg, \
|
||||||
@ -243,18 +237,6 @@ class MiRCARTToolRect(MiRCARTTool):
|
|||||||
self.parentCanvas.mircFg, \
|
self.parentCanvas.mircFg, \
|
||||||
self.parentCanvas.mircFg, " "]]]]
|
self.parentCanvas.mircFg, " "]]]]
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ onMouseDown(self, event, mapPoint, isLeftDown, isRightDown): XXX
|
|
||||||
def onMouseDown(self, event, mapPoint, isLeftDown, isRightDown):
|
|
||||||
return self._draw(event, mapPoint, isLeftDown, isRightDown)
|
|
||||||
# }}}
|
|
||||||
# {{{ onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown): XXX
|
|
||||||
def onMouseMotion(self, event, mapPoint, isLeftDown, isRightDown):
|
|
||||||
return self._draw(event, mapPoint, isLeftDown, isRightDown)
|
|
||||||
# }}}
|
|
||||||
# {{{ __init__(self, parentCanvas): initialisation method
|
|
||||||
def __init__(self, parentCanvas):
|
|
||||||
super().__init__(parentCanvas)
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
class MiRCARTFrame(wx.Frame):
|
class MiRCARTFrame(wx.Frame):
|
||||||
"""XXX"""
|
"""XXX"""
|
||||||
|
Loading…
Reference in New Issue
Block a user