本文整理汇总了Python中wx.DD_NEW_DIR_BUTTON属性的典型用法代码示例。如果您正苦于以下问题:Python wx.DD_NEW_DIR_BUTTON属性的具体用法?Python wx.DD_NEW_DIR_BUTTON怎么用?Python wx.DD_NEW_DIR_BUTTON使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.DD_NEW_DIR_BUTTON属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SaveProjectAs
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_NEW_DIR_BUTTON [as 别名]
def SaveProjectAs(self):
# Ask user to choose a path with write permissions
if wx.Platform == '__WXMSW__':
path = os.getenv("USERPROFILE")
else:
path = os.getenv("HOME")
dirdialog = wx.DirDialog(
self.AppFrame, _("Choose a directory to save project"), path, wx.DD_NEW_DIR_BUTTON)
answer = dirdialog.ShowModal()
dirdialog.Destroy()
if answer == wx.ID_OK:
newprojectpath = dirdialog.GetPath()
if os.path.isdir(newprojectpath):
if self.CheckNewProjectPath(self.ProjectPath, newprojectpath):
self.ProjectPath, old_project_path = newprojectpath, self.ProjectPath
self.SaveProject(old_project_path)
self._setBuildPath(self.BuildPath)
return True
return False
示例2: OnBrowse
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_NEW_DIR_BUTTON [as 别名]
def OnBrowse(self, event):
dlg = wx.DirDialog(
self.frame, style = wx.DD_NEW_DIR_BUTTON)
if dlg.ShowModal() == wx.ID_OK:
self.dirEntry.SetValue(dlg.GetPath())
dlg.Destroy()
示例3: OnBrowse
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_NEW_DIR_BUTTON [as 别名]
def OnBrowse(self, event):
dlg = wx.DirDialog(
cfgFrame, defaultPath = self.cfg.scriptDir,
style = wx.DD_NEW_DIR_BUTTON)
if dlg.ShowModal() == wx.ID_OK:
self.scriptDirEntry.SetValue(dlg.GetPath())
dlg.Destroy()
示例4: OnNewProjectMenu
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_NEW_DIR_BUTTON [as 别名]
def OnNewProjectMenu(self, event):
if self.NodeList:
defaultpath = os.path.dirname(self.NodeList.GetRoot())
else:
defaultpath = os.getcwd()
dialog = wx.DirDialog(self , _("Choose a project"), defaultpath, wx.DD_NEW_DIR_BUTTON)
if dialog.ShowModal() == wx.ID_OK:
projectpath = dialog.GetPath()
if os.path.isdir(projectpath) and len(os.listdir(projectpath)) == 0:
manager = NodeManager()
nodelist = NodeList(manager)
result = nodelist.LoadProject(projectpath)
if not result:
self.Manager = manager
self.NodeList = nodelist
self.NodeList.SetCurrentSelected(0)
self.RefreshNetworkNodes()
self.RefreshBufferState()
self.RefreshTitle()
self.RefreshProfileMenu()
self.RefreshMainMenu()
else:
message = wx.MessageDialog(self, result, _("ERROR"), wx.OK|wx.ICON_ERROR)
message.ShowModal()
message.Destroy()
示例5: on_widget_path
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_NEW_DIR_BUTTON [as 别名]
def on_widget_path(self, event):
"Create a file choice dialog"
pth = wx.DirSelector(_("Choose a directory:"), os.getcwd(), style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON)
if pth:
self.local_widget_path.SetValue(pth)
# end of class wxGladePreferences
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_NEW_DIR_BUTTON [as 别名]
def __init__(self, parent, wildcard=_("All files|*"), file_message=_("Choose a file"),dir_message=None,file_style=0):
self.prev_dir = config.preferences.codegen_path or ""
self.wildcard = wildcard
self.file_message = file_message
self.dir_message = dir_message
self.file_style = file_style
self.dir_style = wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON
self.parent = parent
self.value = None
self.default_extension = None
示例7: Get_Directory
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_NEW_DIR_BUTTON [as 别名]
def Get_Directory():
dialog = wx.DirDialog(None, "Choose a directory:", \
style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON)
if (dialog.ShowModal() == wx.ID_OK):
directory = dialog.GetPath()
else:
directory = None
dialog.Destroy()
return directory
# Get_Directory()
#----------------------------------------------------------------
示例8: OnTaskBarChangeWorkingDir
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_NEW_DIR_BUTTON [as 别名]
def OnTaskBarChangeWorkingDir(self, evt):
dlg = wx.DirDialog(None, _("Choose a working directory "), self.pyroserver.workdir, wx.DD_NEW_DIR_BUTTON)
if dlg.ShowModal() == wx.ID_OK:
self.pyroserver.workdir = dlg.GetPath()
self.pyroserver.Restart()