This class represents a possible replacement for wx.DirDialog, with the additional ability of selecting multiple folders at once.
This class represents a possible replacement for wx.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:
And a lot more. Check the demo for an almost complete review of the functionalities.
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()
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.
This class supports the following window styles:
Window Styles | Hex Value | Description |
---|---|---|
DD_NEW_DIR_BUTTON | 0x000 | 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. |
MultiDirDialog is distributed under the wxPython license.
Latest Revision: Andrea Gavana @ 17 Aug 2011, 15.00 GMT
Version 0.3
Module author: Andrea Gavana <andrea.gavana@gmail.com>
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.
Revision Graph For multidirdialog