@@ -739,19 +739,19 @@ def do_nothing(*args, **kwargs):
739739 bind (self , wx .EVT_KEY_DOWN , self ._onKeyDown )
740740 bind (self , wx .EVT_KEY_UP , self ._onKeyUp )
741741 bind (self , wx .EVT_RIGHT_DOWN , self ._onRightButtonDown )
742- bind (self , wx .EVT_RIGHT_DCLICK , self ._onRightButtonDown )
742+ bind (self , wx .EVT_RIGHT_DCLICK , self ._onRightButtonDClick )
743743 bind (self , wx .EVT_RIGHT_UP , self ._onRightButtonUp )
744744 bind (self , wx .EVT_MOUSEWHEEL , self ._onMouseWheel )
745745 bind (self , wx .EVT_LEFT_DOWN , self ._onLeftButtonDown )
746- bind (self , wx .EVT_LEFT_DCLICK , self ._onLeftButtonDown )
746+ bind (self , wx .EVT_LEFT_DCLICK , self ._onLeftButtonDClick )
747747 bind (self , wx .EVT_LEFT_UP , self ._onLeftButtonUp )
748748 bind (self , wx .EVT_MOTION , self ._onMotion )
749749 bind (self , wx .EVT_LEAVE_WINDOW , self ._onLeave )
750750 bind (self , wx .EVT_ENTER_WINDOW , self ._onEnter )
751751 bind (self , wx .EVT_IDLE , self ._onIdle )
752752 #Add middle button events
753753 bind (self , wx .EVT_MIDDLE_DOWN , self ._onMiddleButtonDown )
754- bind (self , wx .EVT_MIDDLE_DCLICK , self ._onMiddleButtonDown )
754+ bind (self , wx .EVT_MIDDLE_DCLICK , self ._onMiddleButtonDClick )
755755 bind (self , wx .EVT_MIDDLE_UP , self ._onMiddleButtonUp )
756756
757757 self .SetBackgroundStyle (wx .BG_STYLE_CUSTOM )
@@ -1271,6 +1271,13 @@ def _onRightButtonDown(self, evt):
12711271 self .CaptureMouse ()
12721272 FigureCanvasBase .button_press_event (self , x , y , 3 , guiEvent = evt )
12731273
1274+ def _onRightButtonDClick (self , evt ):
1275+ """Start measuring on an axis."""
1276+ x = evt .GetX ()
1277+ y = self .figure .bbox .height - evt .GetY ()
1278+ evt .Skip ()
1279+ self .CaptureMouse ()
1280+ FigureCanvasBase .button_press_event (self , x , y , 3 , dblclick = True ,guiEvent = evt )
12741281
12751282 def _onRightButtonUp (self , evt ):
12761283 """End measuring on an axis."""
@@ -1288,6 +1295,14 @@ def _onLeftButtonDown(self, evt):
12881295 self .CaptureMouse ()
12891296 FigureCanvasBase .button_press_event (self , x , y , 1 , guiEvent = evt )
12901297
1298+ def _onLeftButtonDClick (self , evt ):
1299+ """Start measuring on an axis."""
1300+ x = evt .GetX ()
1301+ y = self .figure .bbox .height - evt .GetY ()
1302+ evt .Skip ()
1303+ self .CaptureMouse ()
1304+ FigureCanvasBase .button_press_event (self , x , y , 1 , dblclick = True , guiEvent = evt )
1305+
12911306 def _onLeftButtonUp (self , evt ):
12921307 """End measuring on an axis."""
12931308 x = evt .GetX ()
@@ -1306,6 +1321,14 @@ def _onMiddleButtonDown(self, evt):
13061321 self .CaptureMouse ()
13071322 FigureCanvasBase .button_press_event (self , x , y , 2 , guiEvent = evt )
13081323
1324+ def _onMiddleButtonDClick (self , evt ):
1325+ """Start measuring on an axis."""
1326+ x = evt .GetX ()
1327+ y = self .figure .bbox .height - evt .GetY ()
1328+ evt .Skip ()
1329+ self .CaptureMouse ()
1330+ FigureCanvasBase .button_press_event (self , x , y , 2 , dblclick = True , guiEvent = evt )
1331+
13091332 def _onMiddleButtonUp (self , evt ):
13101333 """End measuring on an axis."""
13111334 x = evt .GetX ()
0 commit comments