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:
Ability to select a single or multiple 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 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:Windows (Windows XP).
This class supports the following window styles:
Window Styles |
Hex Value |
Description |
---|---|---|
|
0x080 |
Enable/disable the “Make new folder” button |
|
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. |
|
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
A different implementation of |