Phoenix Logo

phoenix_title wx.lib.floatcanvas.NavCanvas.NavCanvas

NavCanvas encloses a FloatCanvas in a Panel and adds a Navigation toolbar.


class_hierarchy Class Hierarchy

Inheritance diagram for class NavCanvas:

super_classes Known Superclasses

wx.Panel


method_summary Methods Summary

__init__ Default class constructor.
AddToolbarModeButtons Add the mode buttons to the tool bar.
AddToolbarZoomButton Add the zoom button to the tool bar.
BuildToolbar Build the default tool bar, can be over-ridden in a subclass to add
HideShowHack Hack to hide and show button on toolbar to get around OS-X bug on
SetMode Event handler to set the mode.
ZoomToFit Event handler to zoom to fit.

api Class API



class NavCanvas(wx.Panel)

NavCanvas encloses a FloatCanvas in a Panel and adds a Navigation toolbar.


Methods



__init__(self, parent, id = wx.ID_ANY, size = wx.DefaultSize, **kwargs)

Default class constructor.

Parameters:
  • parent (wx.Window) – parent window. Must not be None;
  • id (integer) – window identifier. A value of -1 indicates a default value;
  • size – a tuple or wx.Size
  • **kwargs – will be passed on to FloatCanvas


AddToolbarModeButtons(self, tb, Modes)

Add the mode buttons to the tool bar.

Parameters:
  • tb (ToolBar) – the toolbar instance
  • Modes (list) – a list of modes to add, out of the box valid modes are subclassed from GUIBase or modes can also be user defined.


AddToolbarZoomButton(self, tb)

Add the zoom button to the tool bar.

Parameters:tb (ToolBar) – the toolbar instance


BuildToolbar(self)

Build the default tool bar, can be over-ridden in a subclass to add extra tools etc.



HideShowHack(self)

Hack to hide and show button on toolbar to get around OS-X bug on wxPython2.8 on OS-X



SetMode(self, event)

Event handler to set the mode.



ZoomToFit(self, event)

Event handler to zoom to fit.