AGW Logo

agw_title zoombar

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


description Description

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

Once you hover mouse over the 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

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.PySimpleApp()

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

app.MainLoop()

This code snippet can be downloaded, see this example script.

Note

Some of the AGW snippets of code in the documentation use images and external files (to create bitmaps or access external data). As these files are not provided in these snippets, you should make the approriate modifications to the code to actually run it.


platforms Supported Platforms

ZoomBar has been tested on the following platforms:
  • Windows (Windows XP).

styles Window Styles

No particular window styles are available for this class.


events Events Processing

This class processes the following events:


Events processing for zoombar
Event Name Description
EVT_ZOOMBAR Process a wxEVT_ZOOMBAR event, when a ZoomBar button is clicked.

license License And Version

ZoomBar is distributed under the wxPython license.

Latest Revision: Andrea Gavana @ 17 Aug 2011, 15.00 GMT

Version 0.1

Module author: Andrea Gavana <andrea.gavana@gmail.com>


hierarchy Inheritance Diagram

Inheritance diagram for module: zoombar

Inheritance diagram of zoombar.ImageBar, zoombar.ZoomBar, zoombar.ZoomBarEvent, zoombar.ZoomBarImage


svn_main SVN Revisions

A graphical representation of the SVN commits in the last year.

Click on any date in the picture to jump to that particular revision page, containing information about committers, log messages and SVN diffs.

zoombar

Revision Graph For zoombar


2to3 Python 3 Issues (via 2to3)

No issues have been detected by 2to3.py.


method_summary Function Summary