phoenix_title wx.lib.agw.thumbnailctrl.ThumbnailCtrl

ThumbnailCtrl is a widget that can be used to display a series of images in a “thumbnail” format.


class_hierarchy Class Hierarchy

Inheritance diagram for class ThumbnailCtrl:

appearance Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


super_classes Known Superclasses

wx.Panel


method_summary Methods Summary

__init__

Default class constructor.

DeleteFiles

Deletes the selected thumbnails and their associated files.

GetShowComboBox

Returns whether the folder combobox is shown.

GetShowDir

Returns the working directory with images.

ListDirectory

Returns list of file info objects for files of particular extensions.

OnComboBox

Handles the wx.EVT_COMBOBOX for the folder combobox.

OnThumbChar

RecreateComboBox

Recreates the folder combobox every time a new directory is explored.

SetBackgroundColour

Set the background color of the widget.

ShowComboBox

Shows/Hide the top folder ComboBox.

ShowDir

Shows thumbnails for a particular folder.

ShowFileNames

Sets whether the user wants to show file names under the thumbnails or not.


api Class API

class ThumbnailCtrl(wx.Panel)

ThumbnailCtrl is a widget that can be used to display a series of images in a “thumbnail” format.


Methods

__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, thumboutline=THUMB_OUTLINE_IMAGE, thumbfilter=None, imagehandler=PILImageHandler)

Default class constructor.

Parameters
  • parent – parent window. Must not be None;

  • id – window identifier. A value of -1 indicates a default value;

  • pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;

  • size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;

  • thumboutline – outline style for ThumbnailCtrl, which may be:

    Outline Flag

    Value

    Description

    THUMB_OUTLINE_NONE

    0

    No outline is drawn on selection

    THUMB_OUTLINE_FULL

    1

    Full outline (image+caption) is drawn on selection

    THUMB_OUTLINE_RECT

    2

    Only thumbnail bounding rectangle is drawn on selection (default)

    THUMB_OUTLINE_IMAGE

    4

    Only image bounding rectangle is drawn.

  • thumbfilter – filter for image/video/audio files. Ignored.

  • imagehandler – can be PILImageHandler if PIL is installed (faster), or NativeImageHandler which only uses wxPython image methods.



DeleteFiles(self, thumbs)

Deletes the selected thumbnails and their associated files. .. warning:: This method deletes the original files too.

Parem thumbsthumbs

List of indexs to thumbnails.



GetShowComboBox(self)

Returns whether the folder combobox is shown.



GetShowDir(self)

Returns the working directory with images.



ListDirectory(self, directory, fileExtList)

Returns list of file info objects for files of particular extensions.

Parameters
  • directory – the folder containing the images to thumbnail;

  • fileExtList – a Python list of file extensions to consider.



OnComboBox(self, event)

Handles the wx.EVT_COMBOBOX for the folder combobox.

Parameters

event – a CommandEvent event to be processed.



OnThumbChar(self, ev)


RecreateComboBox(self, newdir)

Recreates the folder combobox every time a new directory is explored.

Parameters

newdir – the new folder to be explored.



SetBackgroundColour(self, colour)

Set the background color of the widget.

Parameters

colour – the color to which the background is set.



ShowComboBox(self, show=True)

Shows/Hide the top folder ComboBox.

Parameters

showTrue to show the combobox, False otherwise.



ShowDir(self, folder)

Shows thumbnails for a particular folder.

Parameters

folder – a directory containing the images to thumbnail;



ShowFileNames(self, show=True)

Sets whether the user wants to show file names under the thumbnails or not.

Parameters

showTrue to show file names under the thumbnails, False otherwise.