本文整理汇总了Python中wx.DD_DEFAULT_STYLE属性的典型用法代码示例。如果您正苦于以下问题:Python wx.DD_DEFAULT_STYLE属性的具体用法?Python wx.DD_DEFAULT_STYLE怎么用?Python wx.DD_DEFAULT_STYLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.DD_DEFAULT_STYLE属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dirBrowser
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [as 别名]
def dirBrowser(self, message, defaultpath):
# show dir dialog
dlg = wx.DirDialog(
self, message=message,
defaultPath= defaultpath,
style=wx.DD_DEFAULT_STYLE)
# Show the dialog and retrieve the user response.
if dlg.ShowModal() == wx.ID_OK:
# load directory
path = dlg.GetPath()
else:
path = ''
# Destroy the dialog.
dlg.Destroy()
return path
示例2: onBrowseFolder
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [as 别名]
def onBrowseFolder(self, event=None):
defdir = self.txt_folder.GetValue()
if defdir in ('', 'Desktop'):
defdir = DESKTOP
dlg = wx.DirDialog(self,
message='Select Folder for Shortcut',
defaultPath=defdir,
style = wx.DD_DEFAULT_STYLE)
if dlg.ShowModal() == wx.ID_OK:
folder = os.path.abspath(dlg.GetPath())
desktop = DESKTOP
if folder.startswith(desktop):
folder.replace(desktop, '')
if folder.startswith('/'):
folder = folder[1:]
self.txt_folder.SetValue(folder)
dlg.Destroy()
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [as 别名]
def __init__(self, parent, *args, **kwargs):
wx.DirDialog.__init__(self, parent, 'Select Directory', style=wx.DD_DEFAULT_STYLE)
示例4: OnChangeMirror
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [as 别名]
def OnChangeMirror(self, event):
new_dir_help = "Your new local mirror directory is set. This will take effect after GoSync restart.\n\nPlease note that GoSync hasn't moved your files from old location. You would need to copy or move your current directory to new location before restarting GoSync."
dlg = wx.DirDialog(None, "Choose target directory", "",
wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST)
if dlg.ShowModal() == wx.ID_OK:
self.sync_model.SetLocalMirrorDirectory(dlg.GetPath())
resp = wx.MessageBox(new_dir_help, "IMPORTANT INFORMATION", (wx.OK | wx.ICON_WARNING))
self.md.SetLabel(self.sync_model.GetLocalMirrorDirectory())
dlg.Destroy()
示例5: on_button
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [as 别名]
def on_button(self, evt):
dlg = wx.DirDialog(self.panel, 'Select directory', style=wx.DD_DEFAULT_STYLE)
result = (dlg.GetPath()
if dlg.ShowModal() == wx.ID_OK
else None)
if result:
self.text_box.SetLabelText(result)
示例6: select_working_dir
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [as 别名]
def select_working_dir(self, event):
cwd = os.getcwd()
dlg = wx.DirDialog(
self,
"Choose the directory where your project will be saved:",
cwd,
style=wx.DD_DEFAULT_STYLE,
)
if dlg.ShowModal() == wx.ID_OK:
self.dir = dlg.GetPath()
示例7: dialog
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [as 别名]
def dialog(self):
dialog = wx.DirDialog(self.parent,
message=self.dialog_title,
style=wx.DD_DEFAULT_STYLE|wx.DD_NEW_DIR_BUTTON)
dialog.SetPath(self.get_choice())
return dialog
示例8: directory_dialog
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [as 别名]
def directory_dialog(self):
dialog = wx.DirDialog(self.parent,
message=self.directory_dialog_title,
style=wx.DD_DEFAULT_STYLE|wx.DD_NEW_DIR_BUTTON)
dialog.SetPath(self.get_choice())
return dialog
示例9: get_save_in
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [as 别名]
def get_save_in(self, *e):
d = wx.DirDialog(self, "", style=wx.DD_DEFAULT_STYLE|wx.DD_NEW_DIR_BUTTON)
d.SetPath(self.config['save_in'])
if d.ShowModal() == wx.ID_OK:
path = d.GetPath()
self.saving_panel.save_in_button.SetLabel(path)
self.setfunc('save_in', path)
示例10: load_file
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [as 别名]
def load_file(self, event):
"""Load a capture manually chosen by the user."""
title = "Choose a capture file:"
dlg = wx.FileDialog(self.parent,
message=title,
defaultDir="~",
defaultFile="capture.py",
style=wx.DD_DEFAULT_STYLE)
if dlg.ShowModal() == wx.ID_OK:
self._capture = self.load_content(dlg.GetPath())
with open(TMP_PATH, 'w') as f:
f.write(self._capture)
dlg.Destroy()
示例11: on_widget_path
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [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
示例12: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [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
示例13: Get_Directory
# 需要导入模块: import wx [as 别名]
# 或者: from wx import DD_DEFAULT_STYLE [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()
#----------------------------------------------------------------