Home | Trees | Indices | Help |
|
---|
|
1 # Copyright (C) 2009, 2010, 2011 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.db.objects import TimePeriod 20 from timelinelib.view.scrollbase import ScrollViewInputHandler 21 22248226 ScrollViewInputHandler.__init__(self, controller) 27 self.controller = controller 28 self.initial_time = initial_time 29 self.last_valid_time = initial_time 30 self.current_time = initial_time31 35 3840 self.current_time = self.controller.get_time(self.last_x) 41 try: 42 period = self.get_current_period() 43 self.last_valid_time = self.current_time 44 except ValueError: 45 period = self.get_last_valid_period() 46 self.controller.view_properties.period_selection = (period.start_time, period.end_time) 47 self.controller._redraw_timeline()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.controller.get_timeline().get_time_type(), 64 self.controller.get_drawer().snap(start), 65 self.controller.get_drawer().snap(end))66 70 75 79
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Aug 3 03:56:46 2013 | http://epydoc.sourceforge.net |