.. wxPython Phoenix documentation

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

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

.. include:: headings.inc

.. module:: wx.lib.agw.zoombar

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

.. highlight:: python



.. _wx.lib.agw.zoombar:

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

:class:`~wx.lib.agw.zoombar.ZoomBar` is a class that *appoximatively* mimics the behaviour of the Mac Dock,
inside a :class:`Panel`.


Description
===========

:class:`ZoomBar` is a class that *appoximatively* mimics the behaviour of the Mac Dock,
inside a :class:`Panel`.

Once you hover mouse over the :class:`ZoomBar` correct button will bubble up, grow to
predefined size, so you can easily see the button you are about to click and
have larger area to click. Difference this makes is amazing.

The buttons are able to be zoomed from the bottom up (bottom fixed) as well
as to zoom from a central point. Also the container is able to move the
remaining buttons around the zoomed button.


Usage
=====

Usage example::

    import os
    import random
    import glob

    import wx
    import wx.lib.agw.zoombar as ZB

    class MyFrame(wx.Frame):

        def __init__(self, parent):

            wx.Frame.__init__(self, parent, -1, "ZoomBar Demo")

            panel = wx.Panel(self)

            bar = ZB.ZoomBar(panel, -1)

            standard = glob.glob(bitmapDir + "/*96.png")
            reflections = glob.glob(bitmapDir + "/*96Flip40.png")

            separatorImage = bitmapDir + "/separator.gif"
            separatorReflection = bitmapDir + "/separatorFlip.png"
            count = 0

            for std, ref in zip(standard, reflections):
                if random.randint(0, 1) == 1 and count > 0:
                    sep1 = wx.Bitmap(separatorImage, wx.BITMAP_TYPE_GIF)
                    sep2 = wx.Bitmap(separatorReflection, wx.BITMAP_TYPE_PNG)
                    bar.AddSeparator(sep1, sep2)

                bname = os.path.split(std)[1][0:-6]
                bar.AddButton(wx.Bitmap(std, wx.BITMAP_TYPE_PNG), wx.Bitmap(ref, wx.BITMAP_TYPE_PNG), bname)
                count += 1

            bar.ResetSize()

            sizer = wx.BoxSizer(wx.HORIZONTAL)
            sizer.Add(bar, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 15)
            panel.SetSizer(sizer)


    # our normal wxApp-derived class, as usual

    app = wx.App(0)

    frame = MyFrame(None)
    app.SetTopWindow(frame)
    frame.Show()

    app.MainLoop()


Supported Platforms
===================

:class:`ZoomBar` has been tested on the following platforms:
  * Windows (Windows XP).


Window Styles
=============

`No particular window styles are available for this class.`


Events Processing
=================

This class processes the following events:

============================== ==================================================
Event Name                     Description
============================== ==================================================
``EVT_ZOOMBAR``                Process a ``wxEVT_ZOOMBAR`` event, when a :class:`ZoomBar` button is clicked.
============================== ==================================================


License And Version
===================

:class:`ZoomBar` is distributed under the wxPython license.

Latest Revision: Andrea Gavana @ 19 Dec 2012, 21.00 GMT

Version 0.1


|function_summary| Functions Summary
====================================

================================================================================ ================================================================================
:func:`~wx.lib.agw.zoombar.MakeDisabledBitmap`                                   Creates a disabled-looking bitmap starting from the input one.
================================================================================ ================================================================================


|


|class_summary| Classes Summary
===============================

================================================================================ ================================================================================
`~wx.lib.agw.zoombar.ImageBar`                                                   This class holds the background button bar on which the buttons float.
`~wx.lib.agw.zoombar.ZoomBar`                                                    :class:`ZoomBar` is a class that *appoximatively* mimics the behaviour of the Mac Dock,
`~wx.lib.agw.zoombar.ZoomBarEvent`                                               Event sent from the :class:`ZoomBar` when a button is activated.
`~wx.lib.agw.zoombar.ZoomBarImage`                                               This simple class holds information about a :class:`ZoomBar` button, such as normal
================================================================================ ================================================================================


|


.. toctree::
   :maxdepth: 1
   :hidden:

   wx.lib.agw.zoombar.ImageBar
   wx.lib.agw.zoombar.ZoomBar
   wx.lib.agw.zoombar.ZoomBarEvent
   wx.lib.agw.zoombar.ZoomBarImage





Functions
------------

.. function:: MakeDisabledBitmap(original)

   Creates a disabled-looking bitmap starting from the input one.
   
   :param `original`: an instance of :class:`wx.Bitmap` to be greyed-out.