当前位置: 首页>>代码示例>>Python>>正文


Python wx.DD_NEW_DIR_BUTTON属性代码示例

本文整理汇总了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 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:21,代码来源:ProjectController.py

示例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() 
开发者ID:trelby,项目名称:trelby,代码行数:10,代码来源:watermarkdlg.py

示例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() 
开发者ID:trelby,项目名称:trelby,代码行数:11,代码来源:cfgdlg.py

示例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() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:28,代码来源:networkedit.py

示例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 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:9,代码来源:preferencesdialog.py

示例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 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:12,代码来源:application.py

示例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()
#---------------------------------------------------------------- 
开发者ID:peckhams,项目名称:topoflow,代码行数:16,代码来源:GUI_utils.py

示例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() 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:7,代码来源:Beremiz_service.py


注:本文中的wx.DD_NEW_DIR_BUTTON属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。