This class represents a possible replacement for DirDialog
, with the additional
ability of selecting multiple folders at once.
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:
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()
MultiDirDialog
has been tested on the following platforms: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. |
No custom events are available for this class.
MultiDirDialog
is distributed under the wxPython license.
Latest Revision: Andrea Gavana @ 19 Dec 2012, 21.00 GMT
Version 0.4