Esempio n. 1
0
 def do_scroll_event(self, event):
     if event.direction == gtk.gdk.SCROLL_UP:
         Zoomable.zoomIn()
     elif event.direction == gtk.gdk.SCROLL_DOWN:
         Zoomable.zoomOut()
     # TODO: seek timeline back/forward
     elif event.direction == gtk.gdk.SCROLL_LEFT:
         pass
     elif event.direction == gtk.gdk.SCROLL_RIGHT:
         pass
Esempio n. 2
0
 def do_scroll_event(self, event):
     if event.direction == gtk.gdk.SCROLL_UP:
         Zoomable.zoomIn()
     elif event.direction == gtk.gdk.SCROLL_DOWN:
         Zoomable.zoomOut()
     # TODO: seek timeline back/forward
     elif event.direction == gtk.gdk.SCROLL_LEFT:
         pass
     elif event.direction == gtk.gdk.SCROLL_RIGHT:
         pass
Esempio n. 3
0
 def do_scroll_event(self, event):
     if event.state & gtk.gdk.SHIFT_MASK:
         # shift + scroll => vertical (up/down) scroll
         if event.direction == gtk.gdk.SCROLL_LEFT:
             event.direction = gtk.gdk.SCROLL_UP
         elif event.direction == gtk.gdk.SCROLL_RIGHT:
             event.direction = gtk.gdk.SCROLL_DOWN
         event.state &= ~gtk.gdk.SHIFT_MASK
     elif event.state & gtk.gdk.CONTROL_MASK:
         # zoom + scroll => zooming (up: zoom in)
         if event.direction == gtk.gdk.SCROLL_UP:
             Zoomable.zoomIn()
             return True
         elif event.direction == gtk.gdk.SCROLL_DOWN:
             Zoomable.zoomOut()
             return True
         return False
     else:
         if event.direction == gtk.gdk.SCROLL_UP:
             event.direction = gtk.gdk.SCROLL_LEFT
         elif event.direction == gtk.gdk.SCROLL_DOWN:
             event.direction = gtk.gdk.SCROLL_RIGHT
     return goocanvas.Canvas.do_scroll_event(self, event)
Esempio n. 4
0
 def do_scroll_event(self, event):
     if event.state & gtk.gdk.SHIFT_MASK:
         # shift + scroll => vertical (up/down) scroll
         if event.direction == gtk.gdk.SCROLL_LEFT:
             event.direction = gtk.gdk.SCROLL_UP
         elif event.direction == gtk.gdk.SCROLL_RIGHT:
             event.direction = gtk.gdk.SCROLL_DOWN
         event.state &= ~gtk.gdk.SHIFT_MASK
     elif event.state & gtk.gdk.CONTROL_MASK:
         # zoom + scroll => zooming (up: zoom in)
         if event.direction == gtk.gdk.SCROLL_UP:
             Zoomable.zoomIn()
             return True
         elif event.direction == gtk.gdk.SCROLL_DOWN:
             Zoomable.zoomOut()
             return True
         return False
     else:
         if event.direction == gtk.gdk.SCROLL_UP:
             event.direction = gtk.gdk.SCROLL_LEFT
         elif event.direction == gtk.gdk.SCROLL_DOWN:
             event.direction = gtk.gdk.SCROLL_RIGHT
     return goocanvas.Canvas.do_scroll_event(self, event)