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.wxgui.components.maincanvas.inputhandler import InputHandler 20 21 22 # dragscroll timer interval in milliseconds 23 DRAGSCROLL_TIMER_MSINTERVAL = 300 24 # timeline. The scroll zone areas are found at the beginning and at the 25 # end of the timeline. 26 SCROLL_ZONE_WIDTH = 20 27 2830 346536 self.last_x = cursor.x 37 if self._in_scroll_zone(cursor.x) and not self.timer_running: 38 self.timeline_canvas.start_dragscroll_timer(milliseconds=DRAGSCROLL_TIMER_MSINTERVAL) 39 self.timer_running = True4042 self.timeline_canvas.stop_dragscroll_timer()4345 if self._in_scroll_zone(self.last_x): 46 if self.last_x < SCROLL_ZONE_WIDTH: 47 direction = 1 48 else: 49 direction = -1 50 self.timeline_canvas.Scroll(direction * 0.1) 51 self.view_scrolled()52 5557 """ 58 Return True if x is within the left hand or right hand area 59 where timed scrolling shall start/continue. 60 """ 61 width, _ = self.timeline_canvas.GetSizeTuple() 62 if width - x < SCROLL_ZONE_WIDTH or x < SCROLL_ZONE_WIDTH: 63 return True 64 return False
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Dec 19 02:55:28 2018 | http://epydoc.sourceforge.net |