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


Python CeciliaLib.getPrefPath方法代码示例

本文整理汇总了Python中CeciliaLib.getPrefPath方法的典型用法代码示例。如果您正苦于以下问题:Python CeciliaLib.getPrefPath方法的具体用法?Python CeciliaLib.getPrefPath怎么用?Python CeciliaLib.getPrefPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CeciliaLib的用法示例。


在下文中一共展示了CeciliaLib.getPrefPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createPathsPanel

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getPrefPath [as 别名]
    def createPathsPanel(self, panel):
        pathsPanel = wx.Panel(panel)
        pathsPanel.SetBackgroundColour(BACKGROUND_COLOUR)
        gridSizer = wx.FlexGridSizer(0,2,2,5)

        #Soundfile Player
        textSfPlayerLabel = wx.StaticText(pathsPanel, -1, 'Soundfile Player :')
        textSfPlayerLabel.SetFont(self.font)
        self.textSfPlayerPath = wx.TextCtrl(pathsPanel, -1, CeciliaLib.getSoundfilePlayerPath(), 
                                            size=(270,16), style=wx.TE_PROCESS_ENTER|wx.NO_BORDER)
        self.textSfPlayerPath.SetFont(self.font)       
        self.textSfPlayerPath.Bind(wx.EVT_TEXT_ENTER, self.handleSfPlayerPath)
        self.textSfPlayerPath.SetForegroundColour((50,50,50))
        self.textSfPlayerPath.SetBackgroundColour("#AAAAAA")
        buttonSfPlayerPath = CloseBox(pathsPanel, outFunction=self.changeSfPlayer, label='Set...')           

        #Soundfile Editor
        textSfEditorLabel = wx.StaticText(pathsPanel, -1, 'Soundfile Editor :')
        textSfEditorLabel.SetFont(self.font)       
        self.textSfEditorPath = wx.TextCtrl(pathsPanel, -1, CeciliaLib.getSoundfileEditorPath(), 
                                            size=(270,16), style=wx.TE_PROCESS_ENTER|wx.NO_BORDER)
        self.textSfEditorPath.SetFont(self.font)       
        self.textSfEditorPath.Bind(wx.EVT_TEXT_ENTER, self.handleSfEditorPath)
        self.textSfEditorPath.SetForegroundColour((50,50,50))
        self.textSfEditorPath.SetBackgroundColour("#AAAAAA")
        buttonSfEditorPath = CloseBox(pathsPanel, outFunction=self.changeSfEditor, label='Set...')           

        textPrefPathLabel = wx.StaticText(pathsPanel, -1, 'Preferred paths :')
        textPrefPathLabel.SetFont(self.font)       
        self.textPrefPath = wx.TextCtrl(pathsPanel, -1, CeciliaLib.getPrefPath(), 
                                        size=(270,16), style=wx.TE_PROCESS_ENTER|wx.NO_BORDER)
        self.textPrefPath.SetFont(self.font)       
        self.textPrefPath.Bind(wx.EVT_TEXT_ENTER, self.handleEditPrefPath)
        self.textPrefPath.SetForegroundColour((50,50,50))
        self.textPrefPath.SetBackgroundColour("#AAAAAA")
        buttonPrefPath = CloseBox(pathsPanel, outFunction=self.addPrefPath, label='Add...')           

        gridSizer.AddMany([ 
                            (textSfPlayerLabel, 0, wx.EXPAND | wx.LEFT, PADDING),
                            (wx.StaticText(pathsPanel), 0, wx.EXPAND | wx.RIGHT, 15),
                            (self.textSfPlayerPath, 0, wx.EXPAND | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
                            (buttonSfPlayerPath, 0, wx.RIGHT, 15),
                            (textSfEditorLabel, 0, wx.EXPAND | wx.LEFT | wx.TOP, PADDING),
                            (wx.StaticText(pathsPanel, -1, ''), 0, wx.EXPAND | wx.RIGHT, 15),
                            (self.textSfEditorPath, 0, wx.EXPAND | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
                            (buttonSfEditorPath, 0, wx.RIGHT, 15),
                            (textPrefPathLabel, 0, wx.EXPAND | wx.LEFT | wx.TOP, PADDING),
                            (wx.StaticText(pathsPanel, -1, ''), 0, wx.EXPAND | wx.RIGHT, 15),
                            (self.textPrefPath, 0,  wx.EXPAND | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
                            (buttonPrefPath, 0, wx.RIGHT, 15),
                            ])
        gridSizer.AddGrowableCol(0, 1)
        
        self.textPrefPath.Navigate()
        panel.SetSizerAndFit(gridSizer)
        return pathsPanel
开发者ID:belangeo,项目名称:cecilia4csound,代码行数:58,代码来源:PreferencePanel.py

示例2: addPrefPath

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getPrefPath [as 别名]
    def addPrefPath(self):
        currentPath = CeciliaLib.getPrefPath()

        path = ''
        dlg = wx.DirDialog(self, message="Choose a folder...",
                                 defaultPath=os.path.expanduser('~'))

        if dlg.ShowModal() == wx.ID_OK:
            path = dlg.GetPath()   
        dlg.Destroy()

        if path and currentPath != '':
            path = currentPath + ';' + path
        elif not path:
            return

        CeciliaLib.setPrefPath(path)
        self.textPrefPath.SetValue(path)
开发者ID:belangeo,项目名称:cecilia4csound,代码行数:20,代码来源:PreferencePanel.py


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