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:
parent
38aff7bb01
commit
280432a984
@ -346,18 +346,27 @@ class DirBrowseButton(FileBrowseButton):
|
|||||||
dialogTitle = '',
|
dialogTitle = '',
|
||||||
startDirectory = '.',
|
startDirectory = '.',
|
||||||
changeCallback = None,
|
changeCallback = None,
|
||||||
dialogClass = wx.DirDialog):
|
dialogClass = wx.DirDialog,
|
||||||
|
newDirectory = False):
|
||||||
FileBrowseButton.__init__(self, parent, id, pos, size, style,
|
FileBrowseButton.__init__(self, parent, id, pos, size, style,
|
||||||
labelText, buttonText, toolTip,
|
labelText, buttonText, toolTip,
|
||||||
dialogTitle, startDirectory,
|
dialogTitle, startDirectory,
|
||||||
changeCallback = changeCallback)
|
changeCallback = changeCallback)
|
||||||
self.dialogClass = dialogClass
|
self.dialogClass = dialogClass
|
||||||
|
self.newDirectory = newDirectory
|
||||||
#
|
#
|
||||||
|
|
||||||
def OnBrowse(self, ev = None):
|
def OnBrowse(self, ev = None):
|
||||||
|
style=0
|
||||||
|
|
||||||
|
if self.newDirectory:
|
||||||
|
style|=wx.DD_NEW_DIR_BUTTON
|
||||||
|
|
||||||
dialog = self.dialogClass(self,
|
dialog = self.dialogClass(self,
|
||||||
message = self.dialogTitle,
|
message = self.dialogTitle,
|
||||||
defaultPath = self.startDirectory)
|
defaultPath = self.startDirectory,
|
||||||
|
style = style)
|
||||||
|
|
||||||
if dialog.ShowModal() == wx.ID_OK:
|
if dialog.ShowModal() == wx.ID_OK:
|
||||||
self.SetValue(dialog.GetPath())
|
self.SetValue(dialog.GetPath())
|
||||||
dialog.Destroy()
|
dialog.Destroy()
|
||||||
|
Loading…
Reference in New Issue
Block a user