"""
The user defined Canvas class inherited from TimelineCanvas.
"""


import wx

from timelinelib.canvas import TimelineCanvas


class Canvas(TimelineCanvas):

    def __init__(self, parent):
        self._parent = parent
        TimelineCanvas.__init__(self, parent)
        self.Bind(wx.EVT_LEFT_DOWN, self._on_left_down)

    def _on_left_down(self, evt):
        self.CenterAtCursor(evt)
