Home | Trees | Indices | Help |
|
---|
|
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Rickard Lindberg, Roger Lindberg 2 # 3 # This file is part of Timeline. 4 # 5 # Timeline is free software: you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by 7 # the Free Software Foundation, either version 3 of the License, or 8 # (at your option) any later version. 9 # 10 # Timeline is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with Timeline. If not, see <http://www.gnu.org/licenses/>. 17 18 19 from timelinelib.canvas.data import TimePeriod 20 from timelinelib.wxgui.components.maincanvas.scrollbase import ScrollViewInputHandler 21 22248126 ScrollViewInputHandler.__init__(self, timeline_canvas) 27 self._state = state 28 self.timeline_canvas = timeline_canvas 29 self.initial_time = initial_time 30 self.last_valid_time = initial_time 31 self.current_time = initial_time32 36 3941 try: 42 self.current_time = self.timeline_canvas.GetTimeAt(self.last_x) 43 period = self.get_current_period() 44 self.last_valid_time = self.current_time 45 except ValueError: 46 period = self.get_last_valid_period() 47 self.timeline_canvas.SetPeriodSelection(period)48 51 5456 if t1 > t2: 57 start = t2 58 end = t1 59 else: 60 start = t1 61 end = t2 62 return TimePeriod( 63 self.timeline_canvas.Snap(start), 64 self.timeline_canvas.Snap(end))65 6971 self.end_action() 72 self._remove_selection() 73 self._state.change_to_no_op() 74 self._state.edit_ends()7577 self.timeline_canvas.SetPeriodSelection(None)78
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Mar 25 02:55:27 2020 | http://epydoc.sourceforge.net |