@@ -502,32 +502,32 @@ def __init__(self, parent, id, figure=None):
502502 self ._isDrawn = False
503503 self ._rubberband_rect = None
504504
505- self .Bind (wx .EVT_SIZE , self ._onSize )
506- self .Bind (wx .EVT_PAINT , self ._onPaint )
507- self .Bind (wx .EVT_CHAR_HOOK , self ._onKeyDown )
508- self .Bind (wx .EVT_KEY_UP , self ._onKeyUp )
509- self .Bind (wx .EVT_LEFT_DOWN , self ._onMouseButton )
510- self .Bind (wx .EVT_LEFT_DCLICK , self ._onMouseButton )
511- self .Bind (wx .EVT_LEFT_UP , self ._onMouseButton )
512- self .Bind (wx .EVT_MIDDLE_DOWN , self ._onMouseButton )
513- self .Bind (wx .EVT_MIDDLE_DCLICK , self ._onMouseButton )
514- self .Bind (wx .EVT_MIDDLE_UP , self ._onMouseButton )
515- self .Bind (wx .EVT_RIGHT_DOWN , self ._onMouseButton )
516- self .Bind (wx .EVT_RIGHT_DCLICK , self ._onMouseButton )
517- self .Bind (wx .EVT_RIGHT_UP , self ._onMouseButton )
518- self .Bind (wx .EVT_MOUSE_AUX1_DOWN , self ._onMouseButton )
519- self .Bind (wx .EVT_MOUSE_AUX1_UP , self ._onMouseButton )
520- self .Bind (wx .EVT_MOUSE_AUX2_DOWN , self ._onMouseButton )
521- self .Bind (wx .EVT_MOUSE_AUX2_UP , self ._onMouseButton )
522- self .Bind (wx .EVT_MOUSE_AUX1_DCLICK , self ._onMouseButton )
523- self .Bind (wx .EVT_MOUSE_AUX2_DCLICK , self ._onMouseButton )
524- self .Bind (wx .EVT_MOUSEWHEEL , self ._onMouseWheel )
525- self .Bind (wx .EVT_MOTION , self ._onMotion )
526- self .Bind (wx .EVT_LEAVE_WINDOW , self ._onLeave )
527- self .Bind (wx .EVT_ENTER_WINDOW , self ._onEnter )
528-
529- self .Bind (wx .EVT_MOUSE_CAPTURE_CHANGED , self ._onCaptureLost )
530- self .Bind (wx .EVT_MOUSE_CAPTURE_LOST , self ._onCaptureLost )
505+ self .Bind (wx .EVT_SIZE , self ._on_size )
506+ self .Bind (wx .EVT_PAINT , self ._on_paint )
507+ self .Bind (wx .EVT_CHAR_HOOK , self ._on_key_down )
508+ self .Bind (wx .EVT_KEY_UP , self ._on_key_up )
509+ self .Bind (wx .EVT_LEFT_DOWN , self ._on_mouse_button )
510+ self .Bind (wx .EVT_LEFT_DCLICK , self ._on_mouse_button )
511+ self .Bind (wx .EVT_LEFT_UP , self ._on_mouse_button )
512+ self .Bind (wx .EVT_MIDDLE_DOWN , self ._on_mouse_button )
513+ self .Bind (wx .EVT_MIDDLE_DCLICK , self ._on_mouse_button )
514+ self .Bind (wx .EVT_MIDDLE_UP , self ._on_mouse_button )
515+ self .Bind (wx .EVT_RIGHT_DOWN , self ._on_mouse_button )
516+ self .Bind (wx .EVT_RIGHT_DCLICK , self ._on_mouse_button )
517+ self .Bind (wx .EVT_RIGHT_UP , self ._on_mouse_button )
518+ self .Bind (wx .EVT_MOUSE_AUX1_DOWN , self ._on_mouse_button )
519+ self .Bind (wx .EVT_MOUSE_AUX1_UP , self ._on_mouse_button )
520+ self .Bind (wx .EVT_MOUSE_AUX2_DOWN , self ._on_mouse_button )
521+ self .Bind (wx .EVT_MOUSE_AUX2_UP , self ._on_mouse_button )
522+ self .Bind (wx .EVT_MOUSE_AUX1_DCLICK , self ._on_mouse_button )
523+ self .Bind (wx .EVT_MOUSE_AUX2_DCLICK , self ._on_mouse_button )
524+ self .Bind (wx .EVT_MOUSEWHEEL , self ._on_mouse_wheel )
525+ self .Bind (wx .EVT_MOTION , self ._on_motion )
526+ self .Bind (wx .EVT_LEAVE_WINDOW , self ._on_leave )
527+ self .Bind (wx .EVT_ENTER_WINDOW , self ._on_enter )
528+
529+ self .Bind (wx .EVT_MOUSE_CAPTURE_CHANGED , self ._on_capture_lost )
530+ self .Bind (wx .EVT_MOUSE_CAPTURE_LOST , self ._on_capture_lost )
531531
532532 self .SetBackgroundStyle (wx .BG_STYLE_PAINT ) # Reduce flicker.
533533 self .SetBackgroundColour (wx .WHITE )
@@ -645,25 +645,25 @@ def print_figure(self, filename, *args, **kwargs):
645645 if self ._isDrawn :
646646 self .draw ()
647647
648- def _onPaint (self , event ):
648+ def _on_paint (self , event ):
649649 """Called when wxPaintEvt is generated."""
650- _log .debug ("%s - _onPaint ()" , type (self ))
650+ _log .debug ("%s - _on_paint ()" , type (self ))
651651 drawDC = wx .PaintDC (self )
652652 if not self ._isDrawn :
653653 self .draw (drawDC = drawDC )
654654 else :
655655 self .gui_repaint (drawDC = drawDC )
656656 drawDC .Destroy ()
657657
658- def _onSize (self , event ):
658+ def _on_size (self , event ):
659659 """
660660 Called when wxEventSize is generated.
661661
662662 In this application we attempt to resize to fit the window, so it
663663 is better to take the performance hit and redraw the whole window.
664664 """
665665
666- _log .debug ("%s - _onSize ()" , type (self ))
666+ _log .debug ("%s - _on_size ()" , type (self ))
667667 sz = self .GetParent ().GetSizer ()
668668 if sz :
669669 si = sz .GetItem (self )
@@ -724,14 +724,14 @@ def _get_key(self, event):
724724
725725 return key
726726
727- def _onKeyDown (self , event ):
727+ def _on_key_down (self , event ):
728728 """Capture key press."""
729729 key = self ._get_key (event )
730730 FigureCanvasBase .key_press_event (self , key , guiEvent = event )
731731 if self :
732732 event .Skip ()
733733
734- def _onKeyUp (self , event ):
734+ def _on_key_up (self , event ):
735735 """Release key."""
736736 key = self ._get_key (event )
737737 FigureCanvasBase .key_release_event (self , key , guiEvent = event )
@@ -759,11 +759,11 @@ def _set_capture(self, capture=True):
759759 if capture :
760760 self .CaptureMouse ()
761761
762- def _onCaptureLost (self , event ):
762+ def _on_capture_lost (self , event ):
763763 """Capture changed or lost"""
764764 self ._set_capture (False )
765765
766- def _onMouseButton (self , event ):
766+ def _on_mouse_button (self , event ):
767767 """Start measuring on an axis."""
768768 event .Skip ()
769769 self ._set_capture (event .ButtonDown () or event .ButtonDClick ())
@@ -786,7 +786,7 @@ def _onMouseButton(self, event):
786786 elif event .ButtonUp ():
787787 self .button_release_event (x , y , button , guiEvent = event )
788788
789- def _onMouseWheel (self , event ):
789+ def _on_mouse_wheel (self , event ):
790790 """Translate mouse wheel events into matplotlib events"""
791791 # Determine mouse location
792792 x = event .GetX ()
@@ -806,19 +806,19 @@ def _onMouseWheel(self, event):
806806 self ._skipwheelevent = True
807807 FigureCanvasBase .scroll_event (self , x , y , step , guiEvent = event )
808808
809- def _onMotion (self , event ):
809+ def _on_motion (self , event ):
810810 """Start measuring on an axis."""
811811 x = event .GetX ()
812812 y = self .figure .bbox .height - event .GetY ()
813813 event .Skip ()
814814 FigureCanvasBase .motion_notify_event (self , x , y , guiEvent = event )
815815
816- def _onLeave (self , event ):
816+ def _on_leave (self , event ):
817817 """Mouse has left the window."""
818818 event .Skip ()
819819 FigureCanvasBase .leave_notify_event (self , guiEvent = event )
820820
821- def _onEnter (self , event ):
821+ def _on_enter (self , event ):
822822 """Mouse has entered the window."""
823823 x = event .GetX ()
824824 y = self .figure .bbox .height - event .GetY ()
@@ -937,7 +937,7 @@ def __init__(self, num, fig):
937937
938938 self .canvas .SetMinSize ((2 , 2 ))
939939
940- self .Bind (wx .EVT_CLOSE , self ._onClose )
940+ self .Bind (wx .EVT_CLOSE , self ._on_close )
941941
942942 @property
943943 def toolmanager (self ):
@@ -959,8 +959,8 @@ def get_figure_manager(self):
959959 _log .debug ("%s - get_figure_manager()" , type (self ))
960960 return self .figmgr
961961
962- def _onClose (self , event ):
963- _log .debug ("%s - onClose ()" , type (self ))
962+ def _on_close (self , event ):
963+ _log .debug ("%s - on_close ()" , type (self ))
964964 self .canvas .close_event ()
965965 self .canvas .stop_event_loop ()
966966 # set FigureManagerWx.frame to None to prevent repeated attempts to
@@ -1345,15 +1345,15 @@ def __init__(self, parent, help_entries):
13451345 grid_sizer .Add (label , 0 , 0 , 0 )
13461346 # finalize layout, create button
13471347 sizer .Add (grid_sizer , 0 , wx .ALL , 6 )
1348- OK = wx .Button (self , wx .ID_OK )
1349- sizer .Add (OK , 0 , wx .ALIGN_CENTER_HORIZONTAL | wx .ALL , 8 )
1348+ ok = wx .Button (self , wx .ID_OK )
1349+ sizer .Add (ok , 0 , wx .ALIGN_CENTER_HORIZONTAL | wx .ALL , 8 )
13501350 self .SetSizer (sizer )
13511351 sizer .Fit (self )
13521352 self .Layout ()
1353- self .Bind (wx .EVT_CLOSE , self .OnClose )
1354- OK .Bind (wx .EVT_BUTTON , self .OnClose )
1353+ self .Bind (wx .EVT_CLOSE , self ._on_close )
1354+ ok .Bind (wx .EVT_BUTTON , self ._on_close )
13551355
1356- def OnClose (self , event ):
1356+ def _on_close (self , event ):
13571357 _HelpDialog ._instance = None # remove global reference
13581358 self .DestroyLater ()
13591359 event .Skip ()
0 commit comments