Example #1
0
 def _scrollEventCb(self, canvas, event):
     if event.state & gtk.gdk.SHIFT_MASK:
         # shift + scroll => vertical (up/down) scroll
         if event.direction == gtk.gdk.SCROLL_UP:
             self.scroll_up()
         elif event.direction == gtk.gdk.SCROLL_DOWN:
             self.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:
             self.scroll_left()
         elif event.direction == gtk.gdk.SCROLL_DOWN:
             self.scroll_right()
     return True
Example #2
0
 def _scrollEventCb(self, canvas, event):
     if event.state & gtk.gdk.SHIFT_MASK:
         # shift + scroll => vertical (up/down) scroll
         if event.direction == gtk.gdk.SCROLL_UP:
             self.scroll_up()
         elif event.direction == gtk.gdk.SCROLL_DOWN:
             self.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:
             self.scroll_left()
         elif event.direction == gtk.gdk.SCROLL_DOWN:
             self.scroll_right()
     return True
Example #3
0
 def _zoomOutCb(self, unused_action):
     Zoomable.zoomOut()