~ubuntu-branches/ubuntu/oneiric/python-chaco/oneiric

« back to all changes in this revision

Viewing changes to examples/demo/canvas/mp_move_tool.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-07-08 20:38:02 UTC
  • mfrom: (7.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110708203802-5t32e0ldv441yh90
Tags: 4.0.0-1
* New upstream release
* debian/control:
  - Depend on python-traitsui (Closes: #633604)
  - Bump Standards-Version to 3.9.2
* Update debian/watch file
* Remove debian/patches/* -- no longer needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
from traits.api import Int
 
3
from enable.tools.api import MoveTool
 
4
 
 
5
class MPMoveTool(MoveTool):
 
6
 
 
7
    cur_bid = Int(-1)
 
8
 
 
9
    def normal_blob_down(self, event):
 
10
        if self.cur_bid == -1:
 
11
            self.cur_bid = event.bid
 
12
            self.normal_left_down(event)
 
13
 
 
14
    def dragging_blob_up(self, event):
 
15
        if event.bid == self.cur_bid:
 
16
            self.cur_bid = -1
 
17
            self.normal_left_up(event)
 
18
 
 
19
 
 
20