.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.floatcanvas.NavCanvas

.. highlight:: python



.. _wx.lib.floatcanvas.NavCanvas.NavCanvas:

==========================================================================================================================================
|phoenix_title|  **wx.lib.floatcanvas.NavCanvas.NavCanvas**
==========================================================================================================================================

:class:`~lib.floatcanvas.NavCanvas.NavCanvas` encloses a
:class:`~lib.floatcanvas.FloatCanvas.FloatCanvas` in a :class:`Panel` and
adds a Navigation toolbar.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>NavCanvas</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.floatcanvas.NavCanvas.NavCanvas_inheritance.png" alt="Inheritance diagram of NavCanvas" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="39,5,140,35"/> <area shape="rect" id="node2" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="91,83,201,112"/> <area shape="rect" id="node4" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="86,160,207,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="164,5,245,35"/> <area shape="rect" id="node6" href="wx.Window.html" title="wx.Window" alt="" coords="102,237,191,267"/> <area shape="rect" id="node5" href="wx.Panel.html" title="wx.Panel" alt="" coords="109,315,184,344"/> <area shape="rect" id="node7" href="wx.lib.floatcanvas.NavCanvas.NavCanvas.html" title="wx.lib.floatcanvas.NavCanvas.NavCanvas" alt="" coords="4,392,288,421"/> </map> 
   </p>

|


|super_classes| Known Superclasses
==================================

:class:`wx.Panel`

|


|method_summary| Methods Summary
================================

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


|


|api| Class API
===============


.. class:: NavCanvas(wx.Panel)

   :class:`~lib.floatcanvas.NavCanvas.NavCanvas` encloses a
   :class:`~lib.floatcanvas.FloatCanvas.FloatCanvas` in a :class:`Panel` and
   adds a Navigation toolbar.

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

      Default class constructor.
      
      :param wx.Window `parent`: parent window. Must not be ``None``;
      :param integer `id`: window identifier. A value of -1 indicates a default value;
      :param `size`: a tuple or :class:`wx.Size`
      :param `**kwargs`: will be passed on to :class:`~lib.floatcanvas.FloatCanvas.FloatCanvas`


   .. method:: AddToolbarModeButtons(self, tb, Modes)

      Add the mode buttons to the tool bar.
      
      :param ToolBar `tb`: the toolbar instance
      :param list `Modes`: a list of modes to add, out of the box valid modes
       are subclassed from :class:`~lib.floatcanvas.GUIMode.GUIBase` or modes
       can also be user defined.


   .. method:: AddToolbarZoomButton(self, tb)

      Add the zoom button to the tool bar.
      
      :param ToolBar `tb`: the toolbar instance


   .. method:: BuildToolbar(self)

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


   .. method:: HideShowHack(self)

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


   .. method:: SetMode(self, event)

      Event handler to set the mode.


   .. method:: ZoomToFit(self, event)

      Event handler to zoom to fit.


