AGW Logo

agw_title MultiDirDialog

A different implementation of wx.DirDialog which allows multiple folders to be selected at once.

hierarchy Inheritance Diagram

Inheritance diagram for: MultiDirDialog

Inheritance diagram of MultiDirDialog


appearance Control Appearance


MultiDirDialog

MultiDirDialog


method_summary Methods Summary

__init__Default class constructor.
BindEventsBinds the events to specific methods.
CreateButtonsCreates the OK, Cancel and Make New Folder bitmap buttons.
GetPathsReturns the folders selected by the user, or the default path.
LayoutItemsLayout the widgets using sizers.
OnCancelHandles the wx.EVT_BUTTON event for the dialog.
OnCloseHandles the wx.EVT_CLOSE event for the dialog.
OnKeyUpHandles the wx.EVT_CHAR_HOOK event for the dialog.
OnOkHandles the wx.EVT_BUTTON event for the dialog.
OnSelChangedHandles the wx.EVT_TREE_SEL_CHANGED event for the tree control associated
RecurseTopDirRecurse a directory tree to include the parent-folder.
SetPropertiesSets few properties for the dialog.
SetupDirCtrlSetup the internal wx.GenericDirCtrl (icons, labels, etc...).

API Class API

class MultiDirDialog(wx.Dialog)[source]

A different implementation of wx.DirDialog which allows multiple folders to be selected at once.



__init__(parent, message=_("Choose one or more folders:"), title=_("Browse For Folders"), defaultPath="", style=wx.DD_DEFAULT_STYLE, agwStyle=DD_MULTIPLE, pos=wx.DefaultPosition, size=wx.DefaultSize, name="multidirdialog")[source]

Default class constructor.

Parameters:
  • parent – the dialog parent widget;
  • message – the message to show on the dialog;
  • title – the dialog title;
  • defaultPath – the default path, or the empty string;
  • style – the underlying wx.Dialog window style;
  • agwStyle – the AGW-specific dialog style; this can be a combination of the following bits:


    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.
  • pos – the dialog position;
  • size – the dialog size;
  • name – the dialog name.


BindEvents()[source]

Binds the events to specific methods.



CreateButtons()[source]

Creates the OK, Cancel and Make New Folder bitmap buttons.



GetPaths()[source]

Returns the folders selected by the user, or the default path.



LayoutItems(message)[source]

Layout the widgets using sizers.



OnCancel(event)[source]

Handles the wx.EVT_BUTTON event for the dialog.

Parameters:event – a wx.CommandEvent event to be processed.

Note

This method handles the Cancel button press.



OnClose(event)[source]

Handles the wx.EVT_CLOSE event for the dialog.

Parameters:event – a wx.CloseEvent event to be processed.


OnKeyUp(event)[source]

Handles the wx.EVT_CHAR_HOOK event for the dialog.

Parameters:event – a wx.KeyEvent event to be processed.


OnOk(event)[source]

Handles the wx.EVT_BUTTON event for the dialog.

Parameters:event – a wx.CommandEvent event to be processed.

Note

This method handles the OK button press.



OnSelChanged(event)[source]

Handles the wx.EVT_TREE_SEL_CHANGED event for the tree control associated with MultiDirDialog.

Parameters:event – a wx.TreeEvent event to be processed.


RecurseTopDir(treeCtrl, item, itemText)[source]

Recurse a directory tree to include the parent-folder.

Parameters:
  • treeCtrl – the tree control associated with teh internal wx.GenericDirCtrl;

  • item – the selected tree control item;
  • itemText – the selected tree control item text.


SetProperties(title)[source]

Sets few properties for the dialog.

Parameters:title – the dialog title.


SetupDirCtrl(defaultPath)[source]

Setup the internal wx.GenericDirCtrl (icons, labels, etc...).

Parameters:defaultPath – the default path for MultiDirDialog, can be an empty string.
Tree

Table Of Contents

Previous topic

multidirdialog

Next topic

SVN Revision 68362 For multidirdialog