.. include:: headings.inc .. module:: lib.agw.zoombar .. currentmodule:: lib.agw.zoombar .. highlight:: python .. _lib.agw.zoombar: ========================================================================================================================================== |phoenix_title| **zoombar** ========================================================================================================================================== :class:`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 @ 17 Aug 2011, 15.00 GMT Version 0.1 | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for module **zoombar** .. raw:: html

Inheritance diagram of zoombar

| |function_summary| Functions Summary ==================================== ================================================================================ ================================================================================ :func:`~lib.agw.zoombar.MakeDisabledBitmap` Creates a disabled-looking bitmap starting from the input one. ================================================================================ ================================================================================ | |class_summary| Classes Summary =============================== ================================================================================ ================================================================================ :ref:`lib.agw.zoombar.ImageBar` This class holds the background button bar on which the buttons float. :ref:`lib.agw.zoombar.ZoomBar` :class:`ZoomBar` is a class that *appoximatively* mimics the behaviour of the Mac Dock, :ref:`lib.agw.zoombar.ZoomBarEvent` Event sent from the :class:`ZoomBar` when a button is activated. :ref:`lib.agw.zoombar.ZoomBarImage` This simple class holds information about a :class:`ZoomBar` button, such as normal ================================================================================ ================================================================================ | .. toctree:: :maxdepth: 1 :hidden: lib.agw.zoombar.ImageBar lib.agw.zoombar.ZoomBar lib.agw.zoombar.ZoomBarEvent lib.agw.zoombar.ZoomBarImage Functions ------------ .. function:: MakeDisabledBitmap(original) Creates a disabled-looking bitmap starting from the input one. :param `original`: an instance of :class:`Bitmap` to be greyed-out.