Package wx :: Package lib :: Package agw :: Module thumbnailctrl

[frames | no frames]

## Module wx.lib.agw.thumbnailctrl

Description:

Thumbnailctrl is a widget that can be used to display a series of images in a "thumbnail" format; it mimics, for example, the windows explorer behavior when you select the "view thumbnails" option. Basically, by specifying a folder that contains some image files, the files in the folder are displayed as miniature versions of the actual images in a wx.scrolledwindow.

The code is partly based on wxVillaLib, a wxWidgets implementation of this control. However, ThumbnailCtrl wouldn't have been so fast and complete without the suggestions and hints from Peter Damoc. So, if he accepts the mention, this control is his as much as mine.

Usage:

ThumbnailCtrl.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size = wx.DefaultSize, thumboutline=THUMB_OUTLINE_RECT, thumbfilter=THUMB_FILTER_IMAGES):

For the full listing of the input parameters, see the ThumbnailCtrl __init__() method.

Methods and Settings:

With ThumbnailCtrl you can:

- Create different thumb outlines (none, images only, full, etc...);
- Highlight thumbnails on mouse hovering;
- Show/hide file names below thumbs;
- Change thumb caption font;
- Zoom in/out thumbs (done via ctrl key + mouse wheel or with "+" and "-" chars, with zoom factor value customizable);
- Rotate thumbs with these specifications: a) "d" key rotates 90 degrees clockwise; b) "s" key rotates 90 degrees counter-clockwise; c) "a" key rotates 180 degrees
- Delete files/thumbnails (via the "del" key);
- Drag and drop thumbs from ThumbnailCtrl to whatever application you want;
- Use local (when at least one thumb is selected) or global (no need for thumb selection) popup menus;
- Show/hide a wx.combobox at the top of ThumbnailCtrl: this combobox contains working directory information and it has history entries;
- possibility to show tooltips on thumbs, which display file information (like file name, size, last modification date and thumb size).

For more info on methods and initial styles, please refer to the __init__() method for ThumbnailCtrl or to the specific functions.

|=========================================================================== | | NOTE: ThumbnailCtrl requires PIL (Python Imaging Library) library to | | be installed. | |=========================================================================== |

Side-note: using highlight thumbnails on mouse hovering may be slow on slower computers.

ThumbnailCtrl control is freeware and distributed under the wxPython license.

Latest revision: andrea gavana @ 15 Oct 2008, 22.30 GMT Version 0.7

Classes
`ScrolledThumbnail` |
`Thumb` |
`ThumbnailCtrl` |
`ThumbnailEvent` |

Function Summary
| ``CmpThumb`(first, second)` Compares two thumbs in terms of file names and ids.
| `getDataBL()`
| `getDataSH()`
| `getDataTR()`
| `GetMondrianBitmap()`
| `GetMondrianData()`
| `GetMondrianImage()`
| `getShadow()`
| ``opj`(path)` Convert paths to the platform-specific separator
| ``SortFiles`(items, sorteditems, filenames)` Sort files in alphabetical order.

Function Details

### CmpThumb(first, second)

Compares two thumbs in terms of file names and ids.

### opj(path)

Convert paths to the platform-specific separator

### SortFiles(items, sorteditems, filenames)

Sort files in alphabetical order.

Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:52:10 2009 | http://epydoc.sf.net