Phoenix Logo

phoenix_title wx.lib.agw.multidirdialog

This class represents a possible replacement for DirDialog, with the additional ability of selecting multiple folders at once.

Description

This class represents a possible replacement for DirDialog, with the additional ability of selecting multiple folders at once. It may be useful when you wish to present to the user a directory browser which allows multiple folder selections. MultiDirDialog sports the following features:

  • Ability to select a single or mutliple folders, depending on the style passed;
  • More colourful and eye-catching buttons;
  • Good old Python code :-D .

And a lot more. Check the demo for an almost complete review of the functionalities.

Usage

Usage example:

import os
import wx

import wx.lib.agw.multidirdialog as MDD

# Our normal wxApp-derived class, as usual
app = wx.App(0)

dlg = MDD.MultiDirDialog(None, title="Custom MultiDirDialog", defaultPath=os.getcwd(),
                         agwStyle=MDD.DD_MULTIPLE|MDD.DD_DIR_MUST_EXIST)

if dlg.ShowModal() != wx.ID_OK:
    print("You Cancelled The Dialog!")
    dlg.Destroy()
    return

paths = dlg.GetPaths()
for indx, path in enumerate(paths):
    print("Path %d: %s"%(indx+1, path))

dlg.Destroy()

app.MainLoop()

Supported Platforms

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

Window Styles

This class supports the following window styles:

Window Styles Hex Value Description
DD_NEW_DIR_BUTTON 0x080 Enable/disable the “Make new folder” button
DD_DIR_MUST_EXIST 0x200 The dialog will allow the user to choose only an existing folder. When this style is not given, a “Create new directory” button is added to the dialog (on Windows) or some other way is provided to the user to type the name of a new folder.
DD_MULTIPLE 0x400 Allows the selection of multiple folders.

Events Processing

No custom events are available for this class.

License And Version

MultiDirDialog is distributed under the wxPython license.

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

Version 0.4

class_summary Classes Summary

MultiDirDialog A different implementation of DirDialog which allows multiple