.. wxPython Phoenix documentation

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

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

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.zoombar

.. highlight:: python



.. _wx.lib.agw.zoombar.ZoomBarImage:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.zoombar.ZoomBarImage**
==========================================================================================================================================

This simple class holds information about a :class:`ZoomBar` button, such as normal
bitmaps, disabled bitmap, button label, etc...



|

|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>ZoomBarImage</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.agw.zoombar.ZoomBarImage_inheritance.png" alt="Inheritance diagram of ZoomBarImage" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.zoombar.ZoomBarImage.html" title="wx.lib.agw.zoombar.ZoomBarImage" alt="" coords="5,5,261,35"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.__init__`                                Default class constructor.
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.Enable`                                  Enables/disables a button.
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.GetBitmap`                               Returns the button bitmap, which may be a scaled up version of the original
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.GetLabel`                                Returns the button label (if any).
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.GetPosition`                             Returns the button position.
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.GetSize`                                 Returns the button size.
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.IsEnabled`                               Returns ``True`` if the button is enabled, ``False`` otherwise.
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.IsZoomed`                                Returns ``True`` if the button is zoomed, ``False`` otherwise.
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.LoopScales`                              Caches the bitmaps at various zoom levels to avoid calling every time
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.SetCenterZoom`                           Sets to zoom from the center.
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.SetLabel`                                Sets the button label.
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.SetSize`                                 Sets the button size.
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.SetupProps`                              Set up the button position and size.
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.SetZoomFactor`                           Sets the zoom factor for the button. Larger number gives a greater zoom
:meth:`~wx.lib.agw.zoombar.ZoomBarImage.ZoomImage`                               Zooms the button bitmap depending on the mouse x position.
================================================================================ ================================================================================


|


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


.. class:: ZoomBarImage(object)

   This simple class holds information about a :class:`ZoomBar` button, such as normal
   bitmaps, disabled bitmap, button label, etc...

   .. method:: __init__(self, parent, bitmap, disabledBmp=wx.NullBitmap, label="")

      Default class constructor.
      
      :param `parent`: the main :class:`ZoomBar` window;
      :param `bitmap`: the button bitmap, an instance of :class:`wx.Bitmap`;
      :param `disabledBmp`: the button bitmap when the button is in a disabled
       state;
      :param `label`: the button label.


   .. method:: Enable(self, enable=True)

      Enables/disables a button.
      
      :param `enable`: ``True`` to enable a button, ``False`` to disable it.


   .. method:: GetBitmap(self)

      Returns the button bitmap, which may be a scaled up version of the original
      bitmap is the button is being zoomed.


   .. method:: GetLabel(self)

      Returns the button label (if any). 


   .. method:: GetPosition(self)

      Returns the button position. 


   .. method:: GetSize(self)

      Returns the button size. 


   .. method:: IsEnabled(self)

      Returns ``True`` if the button is enabled, ``False`` otherwise. 


   .. method:: IsZoomed(self)

      Returns ``True`` if the button is zoomed, ``False`` otherwise. 


   .. method:: LoopScales(self, size)

      Caches the bitmaps at various zoom levels to avoid calling every time
      `image.Scale` on the button bitmap.
      
      :param `size`: the original button size, in pixels.


   .. method:: SetCenterZoom(self, center=True)

      Sets to zoom from the center.
      
      :param `center`: if ``True`` button zooms upwards.


   .. method:: SetLabel(self, label)

      Sets the button label.
      
      :param `label`: a string specifying the button label. May be an empty string
       for no label.


   .. method:: SetSize(self, width, height)

      Sets the button size.
      
      :param `width`: the button width;
      :param `height`: the button height.


   .. method:: SetupProps(self, buttonSize)

      Set up the button position and size.
      
      :param `buttonSize`: the button original size (not zoomed), in pixels.


   .. method:: SetZoomFactor(self, zoom)

      Sets the zoom factor for the button. Larger number gives a greater zoom
      effect.
      
      :param `zoom`: a floating point number, greater than or equal to 1.0.


   .. method:: ZoomImage(self, nxcoord)

      Zooms the button bitmap depending on the mouse x position.
      
      :param `nxcoord`: the mouse x position relative to the button center.


