From 280432a984cca430e01e38af9e4d00ac2ce2e0cd Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 1 Mar 2005 23:52:44 +0000 Subject: [PATCH] Added newDirectory flag to DirBrowseButton git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wx/lib/filebrowsebutton.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wxPython/wx/lib/filebrowsebutton.py b/wxPython/wx/lib/filebrowsebutton.py index 9d7d29b567..0a492fd7fc 100644 --- a/wxPython/wx/lib/filebrowsebutton.py +++ b/wxPython/wx/lib/filebrowsebutton.py @@ -346,18 +346,27 @@ class DirBrowseButton(FileBrowseButton): dialogTitle = '', startDirectory = '.', changeCallback = None, - dialogClass = wx.DirDialog): + dialogClass = wx.DirDialog, + newDirectory = False): FileBrowseButton.__init__(self, parent, id, pos, size, style, labelText, buttonText, toolTip, dialogTitle, startDirectory, changeCallback = changeCallback) self.dialogClass = dialogClass + self.newDirectory = newDirectory # def OnBrowse(self, ev = None): + style=0 + + if self.newDirectory: + style|=wx.DD_NEW_DIR_BUTTON + dialog = self.dialogClass(self, message = self.dialogTitle, - defaultPath = self.startDirectory) + defaultPath = self.startDirectory, + style = style) + if dialog.ShowModal() == wx.ID_OK: self.SetValue(dialog.GetPath()) dialog.Destroy() -- 2.50.0