@@ -764,9 +764,11 @@ def __init__(self, parent, id, figure):
764
764
self .Bind (wx .EVT_KEY_DOWN , self ._onKeyDown )
765
765
self .Bind (wx .EVT_KEY_UP , self ._onKeyUp )
766
766
self .Bind (wx .EVT_RIGHT_DOWN , self ._onRightButtonDown )
767
+ self .Bind (wx .EVT_RIGHT_DCLICK , self ._onRightButtonDown )
767
768
self .Bind (wx .EVT_RIGHT_UP , self ._onRightButtonUp )
768
769
self .Bind (wx .EVT_MOUSEWHEEL , self ._onMouseWheel )
769
770
self .Bind (wx .EVT_LEFT_DOWN , self ._onLeftButtonDown )
771
+ self .Bind (wx .EVT_LEFT_DCLICK , self ._onLeftButtonDown )
770
772
self .Bind (wx .EVT_LEFT_UP , self ._onLeftButtonUp )
771
773
self .Bind (wx .EVT_MOTION , self ._onMotion )
772
774
self .Bind (wx .EVT_LEAVE_WINDOW , self ._onLeave )
@@ -777,9 +779,11 @@ def __init__(self, parent, id, figure):
777
779
wx .EVT_KEY_DOWN (self , self ._onKeyDown )
778
780
wx .EVT_KEY_UP (self , self ._onKeyUp )
779
781
wx .EVT_RIGHT_DOWN (self , self ._onRightButtonDown )
782
+ wx .EVT_RIGHT_DCLICK (self , self ._onRightButtonDown )
780
783
wx .EVT_RIGHT_UP (self , self ._onRightButtonUp )
781
784
wx .EVT_MOUSEWHEEL (self , self ._onMouseWheel )
782
785
wx .EVT_LEFT_DOWN (self , self ._onLeftButtonDown )
786
+ wx .EVT_LEFT_DCLICK (self , self ._onLeftButtonDown )
783
787
wx .EVT_LEFT_UP (self , self ._onLeftButtonUp )
784
788
wx .EVT_MOTION (self , self ._onMotion )
785
789
wx .EVT_LEAVE_WINDOW (self , self ._onLeave )
@@ -1164,6 +1168,7 @@ def _onRightButtonDown(self, evt):
1164
1168
x = evt .GetX ()
1165
1169
y = self .figure .bbox .height () - evt .GetY ()
1166
1170
evt .Skip ()
1171
+ self .CaptureMouse ()
1167
1172
FigureCanvasBase .button_press_event (self , x , y , 3 , guiEvent = evt )
1168
1173
1169
1174
@@ -1172,13 +1177,15 @@ def _onRightButtonUp(self, evt):
1172
1177
x = evt .GetX ()
1173
1178
y = self .figure .bbox .height () - evt .GetY ()
1174
1179
evt .Skip ()
1180
+ self .ReleaseMouse ()
1175
1181
FigureCanvasBase .button_release_event (self , x , y , 3 , guiEvent = evt )
1176
1182
1177
1183
def _onLeftButtonDown (self , evt ):
1178
1184
"""Start measuring on an axis."""
1179
1185
x = evt .GetX ()
1180
1186
y = self .figure .bbox .height () - evt .GetY ()
1181
1187
evt .Skip ()
1188
+ self .CaptureMouse ()
1182
1189
FigureCanvasBase .button_press_event (self , x , y , 1 , guiEvent = evt )
1183
1190
1184
1191
def _onLeftButtonUp (self , evt ):
@@ -1187,6 +1194,7 @@ def _onLeftButtonUp(self, evt):
1187
1194
y = self .figure .bbox .height () - evt .GetY ()
1188
1195
#print 'release button', 1
1189
1196
evt .Skip ()
1197
+ self .ReleaseMouse ()
1190
1198
FigureCanvasBase .button_release_event (self , x , y , 1 , guiEvent = evt )
1191
1199
1192
1200
def _onMouseWheel (self , evt ):
0 commit comments