本文整理匯總了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()