Added newDirectory flag to DirBrowseButton

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2005-03-01 23:52:44 +00:00
parent 38aff7bb01
commit 280432a984

View File

@ -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()