.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.multidirdialog

.. highlight:: python



.. _wx.lib.agw.multidirdialog.MultiDirDialog:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.multidirdialog.MultiDirDialog**
==========================================================================================================================================

A different implementation of :class:`DirDialog` which allows multiple
folders to be selected at once.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>MultiDirDialog</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.agw.multidirdialog.MultiDirDialog_inheritance.png" alt="Inheritance diagram of MultiDirDialog" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.multidirdialog.MultiDirDialog.html" title="wx.lib.agw.multidirdialog.MultiDirDialog" alt="" coords="5,547,288,576"/> <area shape="rect" id="node2" href="wx.Dialog.html" title="wx.Dialog" alt="" coords="103,469,190,499"/> <area shape="rect" id="node3" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow" alt="" coords="69,392,224,421"/> <area shape="rect" id="node4" href="wx.NonOwnedWindow.html" title="wx.NonOwnedWindow" alt="" coords="63,315,231,344"/> <area shape="rect" id="node5" href="wx.Window.html" title="wx.Window" alt="" coords="98,237,195,267"/> <area shape="rect" id="node6" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="82,160,211,189"/> <area shape="rect" id="node7" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="88,83,205,112"/> <area shape="rect" id="node8" href="wx.Object.html" title="wx.Object" alt="" coords="43,5,130,35"/> <area shape="rect" id="node9" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="155,5,261,35"/> </map> 
   </p>
   </div>

|


|appearance| Control Appearance
===============================

|

.. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.multidirdialog.multidirdialog.png
   :alt: wxMSW
   :figclass: floatleft

   **wxMSW**


.. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png
   :alt: wxMAC
   :figclass: floatright

   **wxMAC**


.. figure:: _static/images/widgets/fullsize/wxgtk/wx.lib.agw.multidirdialog.multidirdialog.png
   :alt: wxGTK
   :figclass: floatcenter

   **wxGTK**


|




|super_classes| Known Superclasses
==================================

:class:`wx.Dialog`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.__init__`                       Default class constructor.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.BindEvents`                     Binds the events to specific methods.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.CreateButtons`                  Creates the ``OK``, ``Cancel`` and ``Make New Folder`` bitmap buttons.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.GetPaths`                       Returns the folders selected by the user, or the default path.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.LayoutItems`                    Layout the widgets using sizers.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.OnCancel`                       Handles the ``wx.EVT_BUTTON`` event for the dialog.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.OnClose`                        Handles the ``wx.EVT_CLOSE`` event for the dialog.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.OnKeyUp`                        Handles the ``wx.EVT_CHAR_HOOK`` event for the dialog.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.OnOk`                           Handles the ``wx.EVT_BUTTON`` event for the dialog.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.OnSelChanged`                   Handles the ``wx.EVT_TREE_SEL_CHANGED`` event for the tree control associated
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.RecurseTopDir`                  Recurse a directory tree to include the parent-folder.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.SetProperties`                  Sets few properties for the dialog.
:meth:`~wx.lib.agw.multidirdialog.MultiDirDialog.SetupDirCtrl`                   Setup the internal :class:`GenericDirCtrl` (icons, labels, etc...).
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: MultiDirDialog(wx.Dialog)

   A different implementation of :class:`DirDialog` which allows multiple
   folders to be selected at once.

   .. method:: __init__(self, 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")

      Default class constructor.
      
      :param `parent`: the dialog parent widget;
      :param `message`: the message to show on the dialog;
      :param `title`: the dialog title;
      :param `defaultPath`: the default path, or the empty string;
      :param `style`: the underlying :class:`Dialog` window style;
      :param `agwStyle`: the AGW-specific dialog style; this can be a combination of the
       following bits:
      
       ===================== =========== ==================================================
       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.
       ===================== =========== ==================================================
      
      :param `pos`: the dialog position;
      :param `size`: the dialog size;
      :param `name`: the dialog name.


   .. method:: BindEvents(self)

      Binds the events to specific methods. 


   .. method:: CreateButtons(self)

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


   .. method:: GetPaths(self)

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


   .. method:: LayoutItems(self, message)

      Layout the widgets using sizers. 


   .. method:: OnCancel(self, event)

      Handles the ``wx.EVT_BUTTON`` event for the dialog.
      
      :param `event`: a :class:`CommandEvent` event to be processed.
      
      :note: This method handles the ``Cancel`` button press.


   .. method:: OnClose(self, event)

      Handles the ``wx.EVT_CLOSE`` event for the dialog.
      
      :param `event`: a :class:`CloseEvent` event to be processed.


   .. method:: OnKeyUp(self, event)

      Handles the ``wx.EVT_CHAR_HOOK`` event for the dialog.
      
      :param `event`: a :class:`KeyEvent` event to be processed.


   .. method:: OnOk(self, event)

      Handles the ``wx.EVT_BUTTON`` event for the dialog.
      
      :param `event`: a :class:`CommandEvent` event to be processed.
      
      :note: This method handles the ``OK`` button press.


   .. method:: OnSelChanged(self, event)

      Handles the ``wx.EVT_TREE_SEL_CHANGED`` event for the tree control associated
      with :class:`MultiDirDialog`.
      
      :param `event`: a :class:`TreeEvent` event to be processed.


   .. method:: RecurseTopDir(self, treeCtrl, item, itemText)

      Recurse a directory tree to include the parent-folder.
      
      :param `treeCtrl`: the tree control associated with teh internal :class:`GenericDirCtrl`;
      :param `item`: the selected tree control item;
      :param `itemText`: the selected tree control item text.


   .. method:: SetProperties(self, title)

      Sets few properties for the dialog.
      
      :param `title`: the dialog title.


   .. method:: SetupDirCtrl(self, defaultPath)

      Setup the internal :class:`GenericDirCtrl` (icons, labels, etc...).
      
      :param `defaultPath`: the default path for :class:`MultiDirDialog`, can be an
       empty string.


