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 import wx 20 21 from timelinelib.db.objects import PeriodTooLongError 22 from timelinelib.view.scrollbase import ScrollViewInputHandler 23 24267728 ScrollViewInputHandler.__init__(self, controller) 29 self.controller = controller 30 self.status_bar = status_bar 31 self.event = event 32 self.direction = direction 33 self.timer_running = False34 3840 ScrollViewInputHandler.left_mouse_up(self) 41 self._clear_status_text() 42 self.controller.change_input_handler_to_no_op()43 4648 if self.event.locked: 49 return 50 new_time = self.controller.get_time(self.last_x) 51 new_snapped_time = self.controller.get_drawer().snap(new_time) 52 if self.direction == wx.LEFT: 53 new_start = new_snapped_time 54 new_end = self.event.time_period.end_time 55 if new_start > new_end: 56 new_start = new_end 57 else: 58 new_start = self.event.time_period.start_time 59 new_end = new_snapped_time 60 if new_end < new_start: 61 new_end = new_start 62 try: 63 self.event.update_period(new_start, new_end) 64 except PeriodTooLongError: 65 self.status_bar.set_text(_("Period is too long")) 66 else: 67 self._clear_status_text() 68 if self.event.is_container(): 69 self._adjust_container_edges() 70 self.controller.redraw_timeline()7173 self.event.strategy._set_time_period()7476 self.status_bar.set_text("")
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Aug 3 03:56:34 2013 | http://epydoc.sourceforge.net |